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: RFC: #pragma optimization_level



On 2005-04-05, at 16:12, Nix wrote:

I could turn the question back: What's so hard about grepping the source?

Because one does not expect to find compilation flags embedded in the source?

One does - if not grown up in the limited gcc "community". All the high scale
compilers out there DO IT.


Because generated source is fairly common?

No it isn't.


 Because eventually
that runs you into `what's so hard about predicting the behaviour of
this code generator in order to...' and then you ram straight into
the halting problem, or, worse, Qt's qmake program. :)

(None of these are strong arguments, I'll admit, but if your argument
*for* is `it's convenient', then an argument *against* of `it's
unexpected' is stronger than it looks.

... Lot's of perfectly valid descriptions of by autoconf/automake are a horror from
software maintenance point of view deleted... Please look around the corner
away from the JBLD (Joes Bloated Linux Distro). It doesn't have to be all
the difficult to just control the compilation process ...



Actually, glibc is a good argument *against* the need for this feature:
it has a large number of places where unusual one-off CFLAGS are
required, and it manages to do them all via one-file overrides in the
makefiles. See e.g. linuxthreads/sysdeps/i386/Makefile for an extensive
use of this. csu/Makefile has an example of *completely* overriding the
CFLAGS for a single file that is especially delicate (initfini.s).

Please reread what you describe: You describe a packages, which needs a genuine
way to fine control the compilation options. I think it can't be questioned that
a sufficiently low level of system programming there is such a need.
Another striking example is the need of the Linux kernel to disable the frame pointer
firmly in the schedule() function to maintain the stack layout for a context switch.
You see: The requirement is for a single function and not a file.
Some goes for glibc where what you describe is less then esthetically neutral.


Since those packages don't have any other choice they resort to ugly manipulating of
very very fragile thing: environment variables.


Look there *are* good reasons why so many high grade professional compilers do it.
It's not something pretty. But the alternatives are just plain ugly (glibc/kernel).



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