4.1-rc1 fails with O3 optimization

Andev debiandev at gmail.com
Sun Apr 26 22:03:24 EDT 2015

Hello Newbies,

I usually compile my kernel with an unsupported O3 option(why not? :).
Today after running the latest 4.1-rc1 kernel with O3, I got a boot
failure. This is the first time this has happened for me.

If someone is interested in debugging this, please read on.

Can you try to reproduce this bug? If yes, can you also bisect this? I
am a bit swamped right now and can try to reproduce this only on
Wednesday. If you are interested, apply the following patch, compile
and see if the kernel boots. Thanks!

diff --git a/Makefile b/Makefile
index 14c722f..05950ca 100644
--- a/Makefile
+++ b/Makefile
@@ -297,8 +297,8 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then
echo $$BASH; \

 HOSTCC       = gcc
 HOSTCXX      = g++
-HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2
-fomit-frame-pointer -std=gnu89
+HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O3
-fomit-frame-pointer -std=gnu89

 ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
 HOSTCFLAGS  += -Wno-unused-value -Wno-unused-parameter \
@@ -616,7 +616,7 @@ KBUILD_CFLAGS       += $(call
 KBUILD_CFLAGS  += -Os $(call cc-disable-warning,maybe-uninitialized,)


More information about the Kernelnewbies mailing list