Message ID | 20110308221606.GL30899@tyan-ft48-01.lab.bos.redhat.com |
---|---|
State | New |
Headers | show |
> and as t isn't AGGREGATE_TYPE nor COMPLEX_TYPE and is a decl, > it is marked MEM_SCALAR_P and e.g. set_mem_attributes_minus_bitpos > once MEM_SCALAR_P is set doesn't change it to MEM_IN_STRUCT_P > because of BIT_FIELD_REF etc. The BIT_FIELD_REF <t, 32, *> = 1 > stores are done through store_field though, and for some reason > the code sets MEM_IN_STRUCT_P in that codepath unconditionally. The irony of marking something scalar when its type is VECTOR_TYPE... > Changing this fixes the testcase, bootstrapped/regtested on x86_64-linux > and i686-linux. I'll try to test this on ia64-linux tomorrow. > > 2011-03-08 Jakub Jelinek <jakub@redhat.com> > > PR rtl-optimization/47866 > * expr.c (store_field): If MEM_SCALAR_P (target), don't use > MEM_SET_IN_STRUCT_P (to_rtx, 1), just set MEM_IN_STRUCT_P (to_rtx) > if target wasn't scalar. I cannot formally approve, but I think it's the way to go. I'd also delete the confusing macro MEM_SET_IN_STRUCT_P altogether and replace its only other use (in assign_stack_temp_for_type) with the manual equivalent, as is already done in set_mem_attributes_minus_bitpos.
On Wed, Mar 9, 2011 at 9:40 AM, Eric Botcazou <ebotcazou@adacore.com> wrote: >> and as t isn't AGGREGATE_TYPE nor COMPLEX_TYPE and is a decl, >> it is marked MEM_SCALAR_P and e.g. set_mem_attributes_minus_bitpos >> once MEM_SCALAR_P is set doesn't change it to MEM_IN_STRUCT_P >> because of BIT_FIELD_REF etc. The BIT_FIELD_REF <t, 32, *> = 1 >> stores are done through store_field though, and for some reason >> the code sets MEM_IN_STRUCT_P in that codepath unconditionally. > > The irony of marking something scalar when its type is VECTOR_TYPE... > >> Changing this fixes the testcase, bootstrapped/regtested on x86_64-linux >> and i686-linux. I'll try to test this on ia64-linux tomorrow. >> >> 2011-03-08 Jakub Jelinek <jakub@redhat.com> >> >> PR rtl-optimization/47866 >> * expr.c (store_field): If MEM_SCALAR_P (target), don't use >> MEM_SET_IN_STRUCT_P (to_rtx, 1), just set MEM_IN_STRUCT_P (to_rtx) >> if target wasn't scalar. > > I cannot formally approve, but I think it's the way to go. Yes, this is ok. I thought about deleting these two flags completely at some point. Richard. > I'd also delete > the confusing macro MEM_SET_IN_STRUCT_P altogether and replace its only other > use (in assign_stack_temp_for_type) with the manual equivalent, as is already > done in set_mem_attributes_minus_bitpos. > > -- > Eric Botcazou >
--- gcc/expr.c.jj 2011-02-04 16:45:02.000000000 +0100 +++ gcc/expr.c 2011-03-08 20:49:19.531545778 +0100 @@ -5924,7 +5924,8 @@ store_field (rtx target, HOST_WIDE_INT b if (to_rtx == target) to_rtx = copy_rtx (to_rtx); - MEM_SET_IN_STRUCT_P (to_rtx, 1); + if (!MEM_SCALAR_P (to_rtx)) + MEM_IN_STRUCT_P (to_rtx) = 1; if (!MEM_KEEP_ALIAS_SET_P (to_rtx) && MEM_ALIAS_SET (to_rtx) != 0) set_mem_alias_set (to_rtx, alias_set);