final intermodule patch

Nathanael Nerode neroden@twcny.rr.com
Mon Jul 14 22:52:00 GMT 2003


>Right.  My patch does not implement any optimisations, and it is not a
>change to the optimizers.  You do not get better code generation just
>because you use it; you must use -Osomething too.

In other words, at -O0 we will *never* get *any* interaction between 
different translation units, even with your patch?  That's what one 
would expect from the C++ and C standards...

>Yes.  That's why my patch supports -O0 as well as -O3: it lets you do
>debugging without changing your build system.

That's all very well, but -O0 should really follow the principle of 
least surprise.  -O0 -enable-intermodule or some such is just fine.

Put it this way:  If I'm doing ordinary C programming, I expect "gcc -c 
file1.c file2.c -o foo.o" to be flagged as a *mistake* by my compiler 
(this kind of mistake can creep into complex Makefiles fairly easily), 
not as an instruction silently invoking a different mode of operation.  
And indeed, this is how it used to work.  The current situation is a 
regression in this regard.  Does this make sense?

-- 
Nathanael Nerode  <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html



More information about the Gcc-patches mailing list