From eb0e7c34d71173a90a2c48f2acbf4c7995240fa0 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 2 Mar 2017 11:44:16 +0000 Subject: [PATCH] re PR middle-end/79756 (ICE in execute_todo, at passes.c:2011) 2017-03-02 Richard Biener 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 | 6 ++++++ gcc/c-family/c-common.c | 2 ++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/vector-1.c | 8 ++++++++ 4 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/vector-1.c diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index b97a7e731e5..d80844558f3 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2017-03-02 Richard Biener + + PR c/79756 + * c-common.c (c_common_mark_addressable_vec): Look through + C_MAYBE_CONST_EXPR. + 2017-02-28 Martin Liska * c.opt: Replace space with tabular for options of diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index fed7718507a..885ea6d2d70 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9f2315451b0..a4a77792f15 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-02 Richard Biener + + PR c/79756 + * gcc.dg/vector-1.c: New testcase. + 2017-03-02 Bin Cheng 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 index 00000000000..a5eaa2a8c2d --- /dev/null +++ b/gcc/testsuite/gcc.dg/vector-1.c @@ -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; +} -- 2.30.2