gcc -O2 vs. without causes error

I hit this when trying to compile https://www.spec.org/cpu2017/Docs/benchmarks/602.gcc_s.html with GCC.

Ironically, the bootstrap process would fail due to GCC apparently not understanding GNU extensions.

Turning on -fgnu89-inline got rid of any problems I was having. Alternatively, use -std=gnu89.


Try compiling with -fno-builtins. If that fixes it then you've obviously got some sort of problem, but it's probably not in your source.


I'd simply download a different (slightly older?) kernel build:

Here's a bug report, for whatever it's worth:

https://bugs.archlinux.org/task/27100

And no, I have no idea why "-O2" would have anything to do with this particular error...

ADDENDUM: This link might give you more explanation about the error message itself. But again - I'd suggest trying a different kernel build as your first step:

http://gcc.gnu.org/ml/gcc-patches/2007-09/msg00675.html

Tags:

Linux

C

Gcc