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: Allow cgraph nodes to change name


On Saturday, August 23, 2003, at 04:36 PM, Zack Weinberg wrote:

Geoff Keating <geoffk@geoffk.org> writes:

because without unit-at-a-time, the function is output before GCC
knows it has a different name.  I think we want to make it invalid,
otherwise we have to do unit-at-a-time always which is too expensive
for -O0.

I think we should make unit-at-a-time cheap enough that it can be not just on at -O0, but impossible to turn off. There are some nice front end cleanups that would fall out of that.

I think we should simply declare that you must use asm("") only on the
very first declaration of a function, and enforce this with an error
message.  Does that make sense to you?

That might be a bit too strict for e.g. glibc with generic declarations in <foo.h> and then reading system-specific declarations from <bits/foo.h>.

How about "must appear before the first use of the function"?

I like Geoff's rule because it's simple to specify and because it's easy to know whether you've violating it by examining the program text. I think there are some corner cases that make defining "first use" a bit slippery.

--Matt



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