This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/33424] New: segmentation fault for legal code with -O2
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Sep 2007 20:08:23 -0000
- Subject: [Bug c/33424] New: segmentation fault for legal code with -O2
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I just tried to compile Suse Linux package mysql-5.0.45-18
with the GNU C compiler version 4.3 snapshot 20070907.
The compiler said
if gcc -DHAVE_CONFIG_H -I. -I../../strings -I.. -I../include -I../../include
-DDBUG_OFF -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -DPIC -fPIC
-DUNDEF_HAVE_INITGROUPS -DFORCE_INIT_OF_VARS -fno-strict-aliasing -MT
ctype-utf8.o -MD -MP -MF ".deps/ctype-utf8.Tpo" -c -o ctype-utf8.o
../../strings/ctype-utf8.c; \
then mv -f ".deps/ctype-utf8.Tpo" ".deps/ctype-utf8.Po"; else rm -f
".deps/ctype-utf8.Tpo"; exit 1; fi
In file included from ../../strings/ctype-utf8.c:21:
../../include/my_global.h:556: warning: function declaration isn't a prototype
../../strings/ctype-utf8.c: In function 'my_strnncollsp_utf8':
../../strings/ctype-utf8.c:2448: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Here is some help from valgrind
==19535== Invalid read of size 2
==19535== at 0x9FFF59: cse_cc_succs (cse.c:6737)
==19535== by 0xA08F11: rest_of_handle_cse2 (cse.c:6962)
==19535== by 0x631218: execute_one_pass (passes.c:1115)
==19535== by 0x6313EF: execute_pass_list (passes.c:1168)
==19535== by 0x631404: execute_pass_list (passes.c:1169)
==19535== by 0x70957F: tree_rest_of_compilation (tree-optimize.c:404)
==19535== by 0x8767DF: cgraph_expand_function (cgraphunit.c:1077)
==19535== by 0x878A3D: cgraph_optimize (cgraphunit.c:1146)
==19535== by 0x41625D: c_write_global_declarations (c-decl.c:8080)
==19535== by 0x6B095F: toplev_main (toplev.c:1058)
==19535== by 0x52BDB43: (below main) (in /lib64/libc-2.6.so)
==19535== Address 0x0 is not stack'd, malloc'd or (recently) free'd
/tmp/q.i: In function 'my_strnncollsp_utf8':
/tmp/q.i:10725: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Preprocessed source attached. Flag -O2 required.
--
Summary: segmentation fault for legal code with -O2
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dcb314 at hotmail dot com
GCC host triplet: suse-linux-x86_64
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33424