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


On Sun, Apr 10, 2005 at 06:13:14PM -0400, Daniel Jacobowitz wrote:
> This has been on the table for ages, but no one's gotten around to doing it. 
> I'm attaching a (mostly untested) patch which fixes the simple cases.  For
> instance, it causes this test to come out in the expected order:
> 
> void func1() { }
> asm ("# ASM");
> void func2() { }
> 
> It doesn't handle variable declarations, and it won't be useful until it
> does.  Right now declarations are written to the assembly file early, before
> functions are assembled.  Steven pointed out (thank you, Steven) that this
> is much easier on the tree-profiling branch, where that is no longer the
> case.  So, I'm not going to extend the patch to declarations until that
> piece is merged.
> 
> In the mean time, any fundamental objections to the approach?
> 
> Also, are there any other major reasons why people use -fno-unit-at-a-time,
> besides this one?  I would like to see the option go away, and to enable
> unit-at-a-time always.  If for no other reason than to simplify the bits of
> cgraph which handle it.
> 
> Yes, that does incur a measurable (~2% ?) memory and time overhead at -O0. 
> Much less than I would have expected, but my measurements were not very
> thorough.  Note that C++ already does this, and has for a while.

I have not retested this patch, but I would like to restart discussion
on it.  Rereading, the only person with an objection seemed to be
Richard Sandiford; Richard, you wanted specific extensions instead
(which I think is impractical) or better documentation (which is sane
but I don't think I'm qualified to write).  Is that right?

Does anyone else object to the patch?  Anyone interested in writing
the documentation saying what is (after the patch) supported for
-funit-at-a-time?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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