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: [PATCH][MIPS] mwarn-framesize= option


Mark Mitchell wrote:
Andreas Krebbel wrote:
Hello,

Here is patch to add -mwarn-framesize=<size> option to MIPS.

There is a generic implementation of this already on the trunk as
-Wframe-larger-than=N.

The generic option does not necessarily do the same thing.

Right; in fact, the -Wframe-larger docs say:


The computation done to determine the stack frame size is approximate
and not conservative.
The actual requirements may be somewhat greater than @var{len}
even if you do not get a warning.  In addition, any space allocated
via @code{alloca}, variable-length arrays, or related constructs
is not included by the compiler when determining
whether or not to issue a warning.

So, I do think Maxim's patch is a good thing. (I'm not approving it though; I'm expecting that a MIPS backend maintainer will probably comment on it soon.)


Perhaps it would be a nice (orthogonal) improvement if -Wframe-larger-than used the back-end specific code, though. We could have a target hook to compute the frame size, using the generic code in get_framesize as a fallback guess. Then, the user interface would always be -Wframe-larger-than which would work on all targets -- it's just that on some the answers would be more accurate than others.


FWIW, I agree that this is the way to go.


Since we are in stage 1, this would be the time to get this in. We would then not have two different ways to specify very nearly the same thing. It would also save us the trouble of deprecating and removing a mips specific version in the future.

David Daney


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