This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: x86: -Os -msse2 needs -maccumulate-outgoing-args


> 
> On Jan 13, 2004, at 12:51 PM, Jan Hubicka wrote:
> 
> >>This testcase
> >
> >Hi,
> >this is not -maccumulate-outgoing-args that breaks, it is
> >-mpreffered-stack-boundary=2 implied by -Os.  We still don't have the
> >dynamic stack alignment code merged in, unfortunately.
> >It would be probably sane to give some warning or hard error when SSE
> >register is put onto stack, but I don't see easy way to do this, as we
> >should not output such a warning for long doubles that have same
> >alignment properties.
> >Ideas?
> 
> Well, the hardware insists upon alignment for vectors, and -Os is only 
> advisory ("optimize for space, please"), so I would expect either

You are arguing similar way as I did originally, but the idea was that
RedHat will merge dynamic alignment that will make this work even with
-mpreferred-stack-boundary=2.  Bernd posted versions of this patch, but
then it just falled to the cracks.  Not sure what happent, but it would
be nice to have it for 3.5 at least.
> 
> 1) -mmmx/-msse/-msse2 to override the -mpreferred-stack-boundary effect 
> of -Os

The problem is that -mpreferred-stack-boundary must be specified
consistently for all modules and -march=xxx swithces imply -msse that
would increase boundary preferences, so this sollution does not sound
too good for me.
> 2) dynamic stack alignment (but this is contrary to the spirit of -Os)

I think majority of function don't need 128bit aligned stack frame even
if you do use MMX, so it would work.
> 3) warning or hard error

I would like to have this unless 2) gets implemented, but still I just
don't know how to do it.  We probably need some hook to export
information on whether alignment is mandatory and do error in
function.c:
  /* Ignore alignment we can't do with expected alignment of the
    boundary.  */
  if (alignment * BITS_PER_UNIT > PREFERRED_STACK_BOUNDARY)
     alignment = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;

Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]