Message ID | alpine.LSU.2.20.1703021051250.30051@zhemvz.fhfr.qr |
---|---|
State | New |
Headers | show |
On Thu, Mar 02, 2017 at 10:52:08AM +0100, Richard Biener wrote: > > Another case of missed TREE_ADDRESSABLE on vector indexing. > > Bootstrapped and tested on x86_64-unknown-linux-gnu. > > Ok for trunk? Ok (given what Joseph wrote in the PR and that c_fully_fold_internal handles VIEW_CONVERT_EXPR). Marek
Index: gcc/c-family/c-common.c =================================================================== --- gcc/c-family/c-common.c (revision 245833) +++ gcc/c-family/c-common.c (working copy) @@ -6534,6 +6534,8 @@ complete_array_type (tree *ptype, tree i 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: gcc/testsuite/gcc.dg/vector-1.c =================================================================== --- gcc/testsuite/gcc.dg/vector-1.c (nonexistent) +++ gcc/testsuite/gcc.dg/vector-1.c (working copy) @@ -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; +}