This is the mail archive of the 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

1) -mmmx/-msse/-msse2 to override the -mpreferred-stack-boundary effect of -Os
2) dynamic stack alignment (but this is contrary to the spirit of -Os)
3) warning or hard error

Trying to think like a "typical GCC user," it's not clear to me why -Os could cause warnings or hard errors. I'd always assumed that optimizations were optional; if they couldn't be done correctly, they won't be done (unless there's a bug).

I'll agree that "-mpreferred-stack-boundary=2 -msse2" is a recipe for bad code if obeyed literally, and grounds for a warning or error. But only if they appear on the same commandline.

IMHO, #3 isn't a good solution. Since we don't have 2), that leaves 1). Is there a 4) I didn't think of ?

stuart hastings
Apple Computer

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