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: RFC: Preserving order of functions and top-level asms via cgraph


Daniel Jacobowitz wrote:
On Sun, Apr 10, 2005 at 05:56:55PM -0700, Mark Mitchell wrote:

I don't really know how to prove the theory that we can lose the functionality. I can see how we can disprove the theory: someone can present an example (as you did), for which we develop the consensus "yes, that's a reasonable thing for a user to do, so we must support this." I suppose we could hardwire -funit-at-a-time to on for a while (as it happens to break the ordering), and see how many people yell at us, and then, if there was no persuasive yelling, consider that we've proved the theory.


It's on by default; it has been for a long time.  People explicitly
turn it off, i.e. there are users of the -fno-unit-at-a-time option.
I think that qualifies as proof by yelling.

What I'd like to know is why these users are using the option, so that we can see if we think those uses are reasonable.


If we simply take the position that we can't break existing code, then we certainly can't do what I'm suggesting. In general, we certainly don't want to break existing code, but maybe if we look at the examples, we'll decide we don't mind. On the other hand, maybe we'll decide they're valid. Or, maybe we'll decide that there are so many examples that breaking the code is a bad idea, even if each individual example is a disgusting hack.

There might also be better ways to do the things that people are currently doing, so that we could break existing code, but provide a useful workaround. For example, we could add an asm_before function attribute that contained literal assembly code to be emitted directly before the function. That might serve the MIPS kernel needs, in a cleaner way than the current implicit ordering constraint. A further advantage would be that if, say, the compiler could prove the function unused (which will not be the case in the situation you describe), then the assembly code would never be emitted. Right now, we might get in trouble if the assembly fragment were emitted, but the function elided.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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