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]

Re: linux-kernels and -foptimize-sibling-calls



> what's the word about linux-2.4, current CVS compilers and 
> -foptimize-sibling-calls (on fby default or -O2)? Unless I disable this 
> option the TCP stack behaves strangely on PPC and I seem to remember a 
> similar comment for x86 from someone else on the GCC lists.

If you suspect a gcc bug, please try to isolate it.  Which function is
miscompiled?

I've searched the archive (use search form at gcc.gnu.org), and I can find
a thread "-foptimize-sibling-calls and passing structs" beginning at
http://gcc.gnu.org/ml/gcc/2000-06/msg00087.html, and another "Bug in
sibling call" at http://gcc.gnu.org/ml/gcc-bugs/2000-04/msg00417.html .  I
don't think either of these is relevant to your problem but who knows?


> If 
> so, I will post a patch on linux-kernel to turn off this optimization if the 
> compiler supports it, similar to what has been done to turn off 
> -fstrict-aliasing during kernel compilation.

But this is not the same thing.  In the case of -fstrict-aliasing, the
Linux kernel does not comply with ISO C, so doing the strict-aliasing
optimization would generate bad code.  (2.95.2 does not able strict
aliasing by default, because violation of this rule is more common than we
thought, but someone might try to compile the kernel with 2.95.0, and we
are going to leave it that way, you won't get the optimization unless you
ask for it.  People with numerical codes that don't do tricky casts might
want to ask for it).  In this case, the flag is the correct solution.

But in this case, you suspect a compiler bug.  Instead of just hiding the
evidence, I hope that some kernel hacker can find the time to help us
find the problem.

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