From: Richard Biener Date: Tue, 6 Sep 2016 12:49:53 +0000 (+0000) Subject: re PR tree-optimization/77450 (ICE: in verify_ssa, at tree-ssa.c:1016 on very simple... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b772a56562fa8272a188d39a38492d52bdc797fd;p=gcc.git re PR tree-optimization/77450 (ICE: in verify_ssa, at tree-ssa.c:1016 on very simple code with vectors) 2016-09-06 Richard Biener PR c/77450 c-family/ * c-common.c (c_common_mark_addressable_vec): Handle COMPOUND_LITERAL_EXPR. * c-c++-common/vector-subscript-7.c: Adjust. * c-c++-common/vector-subscript-8.c: New testcase. From-SVN: r240006 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index f3280d07333..9d9344ffa9f 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2016-09-06 Richard Biener + + PR c/77450 + * c-common.c (c_common_mark_addressable_vec): Handle + COMPOUND_LITERAL_EXPR. + 2016-09-05 Marek Polacek PR c/77423 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 63b1e283628..de9f881e236 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -10918,7 +10918,9 @@ c_common_mark_addressable_vec (tree t) { while (handled_component_p (t)) t = TREE_OPERAND (t, 0); - if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL) + if (!VAR_P (t) + && TREE_CODE (t) != PARM_DECL + && TREE_CODE (t) != COMPOUND_LITERAL_EXPR) return; TREE_ADDRESSABLE (t) = 1; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b8e4b021261..28409ccf062 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-09-06 Richard Biener + + PR c/77450 + * c-c++-common/vector-subscript-7.c: Adjust. + * c-c++-common/vector-subscript-8.c: New testcase. + 2016-09-06 Senthil Kumar Selvaraj * gcc.dg/Wno-frame-address.c: Skip for avr-*-*. diff --git a/gcc/testsuite/c-c++-common/vector-subscript-7.c b/gcc/testsuite/c-c++-common/vector-subscript-7.c index e8418f24be9..8e8fa0c1bdc 100644 --- a/gcc/testsuite/c-c++-common/vector-subscript-7.c +++ b/gcc/testsuite/c-c++-common/vector-subscript-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-ccp1" } */ +/* { dg-options "-O -fdump-tree-fre1" } */ typedef int v4si __attribute__ ((vector_size (16))); @@ -11,4 +11,4 @@ main (int argc, char** argv) return ((v4si){1, 2, 42, 0})[j]; } -/* { dg-final { scan-tree-dump "return 42;" "ccp1" } } */ +/* { dg-final { scan-tree-dump "return 42;" "fre1" } } */ diff --git a/gcc/testsuite/c-c++-common/vector-subscript-8.c b/gcc/testsuite/c-c++-common/vector-subscript-8.c new file mode 100644 index 00000000000..8b0e0ff8977 --- /dev/null +++ b/gcc/testsuite/c-c++-common/vector-subscript-8.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ + +typedef int V __attribute__((vector_size(4))); + +void +foo(void) +{ + (V){ 0 }[0] = 0; +}