re PR middle-end/79756 (ICE in execute_todo, at passes.c:2011)
authorRichard Biener <rguenther@suse.de>
Thu, 2 Mar 2017 11:44:16 +0000 (11:44 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 2 Mar 2017 11:44:16 +0000 (11:44 +0000)
2017-03-02  Richard Biener  <rguenther@suse.de>

PR c/79756
* c-common.c (c_common_mark_addressable_vec): Look through
C_MAYBE_CONST_EXPR.

* gcc.dg/vector-1.c: New testcase.

From-SVN: r245838

gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vector-1.c [new file with mode: 0644]

index b97a7e731e5e84cc8fbb939aee0c2833e3f9d782..d80844558f382ca57f187f8b384f6cde2d1c6ca0 100644 (file)
@@ -1,3 +1,9 @@
+2017-03-02  Richard Biener  <rguenther@suse.de>
+
+       PR c/79756
+       * c-common.c (c_common_mark_addressable_vec): Look through
+       C_MAYBE_CONST_EXPR.
+
 2017-02-28  Martin Liska  <mliska@suse.cz>
 
        * c.opt: Replace space with tabular for options of <number>
index fed7718507aef2d4f34c90c7c1c5e6d92a13ffcc..885ea6d2d70e22c900f3299635b179b3488142ad 100644 (file)
@@ -6534,6 +6534,8 @@ complete_array_type (tree *ptype, tree initial_value, bool do_default)
 void 
 c_common_mark_addressable_vec (tree t)
 {   
+  if (TREE_CODE (t) == C_MAYBE_CONST_EXPR)
+    t = C_MAYBE_CONST_EXPR_EXPR (t);
   while (handled_component_p (t))
     t = TREE_OPERAND (t, 0);
   if (!VAR_P (t)
index 9f2315451b068f8add610c78f5945dfa76987bf7..a4a77792f157a5c0e322e61fd292de7cc9195370 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-02  Richard Biener  <rguenther@suse.de>
+
+       PR c/79756
+       * gcc.dg/vector-1.c: New testcase.
+
 2017-03-02  Bin Cheng  <bin.cheng@arm.com>
 
        PR tree-optimization/66768
diff --git a/gcc/testsuite/gcc.dg/vector-1.c b/gcc/testsuite/gcc.dg/vector-1.c
new file mode 100644 (file)
index 0000000..a5eaa2a
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu90" } */
+
+typedef int V __attribute__ ((vector_size(4)));
+void fn1 ()
+{
+  (V){(1,0)}[0] = 0;
+}