Re: PATCH: PR middle-end/48608: Alignment adjust of local variables is lost

2011-04-15 Thread Michael Matz
Hi, On Thu, 14 Apr 2011, H.J. Lu wrote: > >> > +  if (align > DECL_ALIGN (decl)) > >> > +    DECL_ALIGN (decl) = align; > >> > >> Shouldn't this unconditionally set DECL_ALIGN in case > >> LOCAL_DECL_ALINGMENT returns something smaller? > > > > Decreasing alignment of DECLs points to a problem el

Re: PATCH: PR middle-end/48608: Alignment adjust of local variables is lost

2011-04-14 Thread Richard Guenther
On Thu, Apr 14, 2011 at 5:48 PM, H.J. Lu wrote: > On Thu, Apr 14, 2011 at 8:26 AM, Michael Matz wrote: >> Hi, >> >> On Thu, 14 Apr 2011, Richard Guenther wrote: >> >>> > +  if (align > DECL_ALIGN (decl)) >>> > +    DECL_ALIGN (decl) = align; >>> >>> Shouldn't this unconditionally set DECL_ALIGN i

Re: PATCH: PR middle-end/48608: Alignment adjust of local variables is lost

2011-04-14 Thread H.J. Lu
On Thu, Apr 14, 2011 at 8:26 AM, Michael Matz wrote: > Hi, > > On Thu, 14 Apr 2011, Richard Guenther wrote: > >> > +  if (align > DECL_ALIGN (decl)) >> > +    DECL_ALIGN (decl) = align; >> >> Shouldn't this unconditionally set DECL_ALIGN in case >> LOCAL_DECL_ALINGMENT returns something smaller? >

Re: PATCH: PR middle-end/48608: Alignment adjust of local variables is lost

2011-04-14 Thread Michael Matz
Hi, On Thu, 14 Apr 2011, Richard Guenther wrote: > > +  if (align > DECL_ALIGN (decl)) > > +    DECL_ALIGN (decl) = align; > > Shouldn't this unconditionally set DECL_ALIGN in case > LOCAL_DECL_ALINGMENT returns something smaller? Decreasing alignment of DECLs points to a problem elsewhere, so

Re: PATCH: PR middle-end/48608: Alignment adjust of local variables is lost

2011-04-14 Thread Richard Guenther
On Thu, Apr 14, 2011 at 4:27 PM, H.J. Lu wrote: > On Thu, Apr 14, 2011 at 7:09 AM, Richard Guenther > wrote: >> On Thu, Apr 14, 2011 at 4:01 PM, H.J. Lu wrote: >>> On Thu, Apr 14, 2011 at 6:57 AM, Richard Guenther >>> wrote: On Thu, Apr 14, 2011 at 3:34 PM, H.J. Lu wrote: > We have >>

Re: PATCH: PR middle-end/48608: Alignment adjust of local variables is lost

2011-04-14 Thread H.J. Lu
On Thu, Apr 14, 2011 at 7:09 AM, Richard Guenther wrote: > On Thu, Apr 14, 2011 at 4:01 PM, H.J. Lu wrote: >> On Thu, Apr 14, 2011 at 6:57 AM, Richard Guenther >> wrote: >>> On Thu, Apr 14, 2011 at 3:34 PM, H.J. Lu wrote: We have static unsigned int get_decl_align_unit (tree

Re: PATCH: PR middle-end/48608: Alignment adjust of local variables is lost

2011-04-14 Thread Richard Guenther
On Thu, Apr 14, 2011 at 4:01 PM, H.J. Lu wrote: > On Thu, Apr 14, 2011 at 6:57 AM, Richard Guenther > wrote: >> On Thu, Apr 14, 2011 at 3:34 PM, H.J. Lu wrote: >>> We have >>> >>> static unsigned int >>> get_decl_align_unit (tree decl) >>> { >>>  unsigned int align = LOCAL_DECL_ALIGNMENT (decl);

Re: PATCH: PR middle-end/48608: Alignment adjust of local variables is lost

2011-04-14 Thread H.J. Lu
On Thu, Apr 14, 2011 at 6:57 AM, Richard Guenther wrote: > On Thu, Apr 14, 2011 at 3:34 PM, H.J. Lu wrote: >> We have >> >> static unsigned int >> get_decl_align_unit (tree decl) >> { >>  unsigned int align = LOCAL_DECL_ALIGNMENT (decl); >>  return align / BITS_PER_UNIT; >> } >> >> LOCAL_DECL_ALI

Re: PATCH: PR middle-end/48608: Alignment adjust of local variables is lost

2011-04-14 Thread Richard Guenther
On Thu, Apr 14, 2011 at 3:34 PM, H.J. Lu wrote: > We have > > static unsigned int > get_decl_align_unit (tree decl) > { >  unsigned int align = LOCAL_DECL_ALIGNMENT (decl); >  return align / BITS_PER_UNIT; > } > > LOCAL_DECL_ALIGNMENT may increase alignment for local variable.  But it is > never s

PATCH: PR middle-end/48608: Alignment adjust of local variables is lost

2011-04-14 Thread H.J. Lu
We have static unsigned int get_decl_align_unit (tree decl) { unsigned int align = LOCAL_DECL_ALIGNMENT (decl); return align / BITS_PER_UNIT; } LOCAL_DECL_ALIGNMENT may increase alignment for local variable. But it is never saved. DECL_ALIGN (decl) returns the old alignment. This patch upd