This is the mail archive of the gcc@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: Is store_expr(e,t,v!=m) safe?


On Mon, Apr 07, 2003 at 03:25:21PM -0600, Roger Sayle wrote:
> I was wondering, for yet another work-around for PR opt/8634, when
> is it safe to turn the the local variable "const foo = ..." into the
> almost equivalent "static const foo = ..."?

I don't know.  More often than not, probably.

Indeed, most of the time I see this, the programmer is not
*intending* to ensure that the variable is present on the
stack, but instead has simply forgotten the static keyword.

I wonder if it would be worthwhile noting when someone
explicitly wrote "auto" to suppress this...

> Perhaps it would be possible for the front-ends to determine that
> all of the fields/entries of an initializer are dense compile time
> constants, and set TREE_STATIC on the DECL prior to calling the
> middle-end.

Yes.  It would be useful if this was actually a routine in the
middle end, callable by all front ends.  I'm not certain that
I'd Just Decide to stick it in the middle end based on differing
language constraints.



r~


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