mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-23 19:03:59 +08:00
Fix PR 106560: Another ICE after conflicting types of redeclaration
This another one of these ICE after error issues with the gimplifier and a fallout from r12-3278-g823685221de986af. The problem here is gimplify_modify_expr does not check if either from or to was an error operand. This adds the check and fixes the ICE. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * gimplify.cc (gimplify_modify_expr): If either *from_p or *to_p were error_operand return early. gcc/testsuite/ChangeLog: * gcc.dg/redecl-23.c: New test. * gcc.dg/redecl-24.c: New test. * gcc.dg/redecl-25.c: New test.
This commit is contained in:
parent
183db4fb73
commit
b03ad138a6
@ -6054,6 +6054,9 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
||||
location_t loc = EXPR_LOCATION (*expr_p);
|
||||
gimple_stmt_iterator gsi;
|
||||
|
||||
if (error_operand_p (*from_p) || error_operand_p (*to_p))
|
||||
return GS_ERROR;
|
||||
|
||||
gcc_assert (TREE_CODE (*expr_p) == MODIFY_EXPR
|
||||
|| TREE_CODE (*expr_p) == INIT_EXPR);
|
||||
|
||||
|
6
gcc/testsuite/gcc.dg/redecl-23.c
Normal file
6
gcc/testsuite/gcc.dg/redecl-23.c
Normal file
@ -0,0 +1,6 @@
|
||||
/* We used to ICE in the gimplifier, PR 106560. */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-w" } */
|
||||
void **a; /* { dg-note "" } */
|
||||
void b() { void **c = a; }
|
||||
a; /* { dg-error "" } */
|
6
gcc/testsuite/gcc.dg/redecl-24.c
Normal file
6
gcc/testsuite/gcc.dg/redecl-24.c
Normal file
@ -0,0 +1,6 @@
|
||||
/* We used to ICE in the gimplifier, PR 106560 */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-w" } */
|
||||
void **a, **b; /* { dg-note "" } */
|
||||
c(){b = a;}
|
||||
a = /* { dg-error "" } */
|
9
gcc/testsuite/gcc.dg/redecl-25.c
Normal file
9
gcc/testsuite/gcc.dg/redecl-25.c
Normal file
@ -0,0 +1,9 @@
|
||||
/* We used to ICE in the gimplifier, PR 106560 */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-w" } */
|
||||
void **a; /* { dg-note "" } */
|
||||
void b() {
|
||||
void **c;
|
||||
c = a /* { dg-error "" } */
|
||||
}
|
||||
a; /* { dg-error "" } */
|
Loading…
Reference in New Issue
Block a user