re PR tree-optimization/77450 (ICE: in verify_ssa, at tree-ssa.c:1016 on very simple...
authorRichard Biener <rguenther@suse.de>
Tue, 6 Sep 2016 12:49:53 +0000 (12:49 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 6 Sep 2016 12:49:53 +0000 (12:49 +0000)
2016-09-06  Richard Biener  <rguenther@suse.de>

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

gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/vector-subscript-7.c
gcc/testsuite/c-c++-common/vector-subscript-8.c [new file with mode: 0644]

index f3280d073337d62b3fb2bda6565b07b2c3175caf..9d9344ffa9f20ebca2f49d52e42848154fcaa139 100644 (file)
@@ -1,3 +1,9 @@
+2016-09-06  Richard Biener  <rguenther@suse.de>
+
+       PR c/77450
+       * c-common.c (c_common_mark_addressable_vec): Handle
+       COMPOUND_LITERAL_EXPR.
+
 2016-09-05  Marek Polacek  <polacek@redhat.com>
 
        PR c/77423
index 63b1e28362894de0616ccb5f9c0b2847282b346a..de9f881e2362c835eb61ed7a2156e46800fdfbf4 100644 (file)
@@ -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;
 }
index b8e4b0212611c3c8825aa90506bbc5a63b588fd5..28409ccf06283157fe09bf4a90e6fc9b78d51c52 100644 (file)
@@ -1,3 +1,9 @@
+2016-09-06  Richard Biener  <rguenther@suse.de>
+
+       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  <senthil_kumar.selvaraj@atmel.com>
 
        * gcc.dg/Wno-frame-address.c: Skip for avr-*-*.
index e8418f24be9d0fcc0e8f4821f99cd0146e85e576..8e8fa0c1bdc5e312dd8869e186ffccb6e7a68f34 100644 (file)
@@ -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 (file)
index 0000000..8b0e0ff
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+typedef int V __attribute__((vector_size(4)));
+
+void
+foo(void)
+{
+  (V){ 0 }[0] = 0;
+}