[Bug c/38136] vim crashes on startup when compiled with -O3 but works with -O2

dominique dot pelle at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Nov 16 13:49:00 GMT 2008



------- Comment #7 from dominique dot pelle at gmail dot com  2008-11-16 13:48 -------
reading through the man page of gcc, I stumbled upon this in
the section about -O2:

==================================================
 NOTE: In Ubuntu 8.10 and later versions, -D_FORTIFY_SOURCE=2
 is set by default, and is activated when -O is set to 2 or higher.
 This enables additional compile-time and run-time checks for several
 libc functions.  To disable, specify either -U_FORTIFY_SOURCE or
 -D_FORTIFY_SOURCE=0.
==================================================

So I tried adding compiling with -O3 -D_FORTIFY_SOURCE=0
and it makes it work!

So far I don't observe anything wrong with
-O3 -D_FORTIFY_SOURCE=0.  'make test' succeeds
in every tests.

I'm not 100% sure whether adding -D_FORTIFY_SOURCE=0
silents a real bug in vim, or whether it was reporting
a spurious error (hence bug in gcc). But even if it
silents a spurious bug in this case, adding
-D_FORTIFY_SOURCE=0 may also silent other real
bugs, which is a shame.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38136



More information about the Gcc-bugs mailing list