diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gimplify.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr94726.c | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 9163dcd..943c5cb 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -6232,6 +6232,9 @@ gimplify_save_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) gcc_assert (TREE_CODE (*expr_p) == SAVE_EXPR); val = TREE_OPERAND (*expr_p, 0); + if (TREE_TYPE (val) == error_mark_node) + return GS_ERROR; + /* If the SAVE_EXPR has not been resolved, then evaluate it once. */ if (!SAVE_EXPR_RESOLVED_P (*expr_p)) { diff --git a/gcc/testsuite/gcc.dg/pr94726.c b/gcc/testsuite/gcc.dg/pr94726.c new file mode 100644 index 0000000..d6911a6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr94726.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +typedef unsigned int type __attribute__ ( ( vector_size ( 2*sizeof(int) ) ) ) ; +type a , b; +/* { dg-message "note: previous declaration" "previous declaration" { target *-*-* } .-1 } */ +void foo ( void ) { + type var = { 2 , 2 } ; + b = __builtin_shuffle ( a , var ) ; +} + +void * a [ ] = { } ; /* { dg-error "conflicting types" } */ |