re PR middle-end/79756 (ICE in execute_todo, at passes.c:2011)

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
This commit is contained in:
Richard Biener 2017-03-02 11:44:16 +00:00 committed by Richard Biener
parent 653a4b32fe
commit eb0e7c34d7
4 changed files with 21 additions and 0 deletions

View 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>

View 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)

View 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

View File

@ -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;
}