This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30333] New: Segmentation fault for -O2 on legal code
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Dec 2006 11:27:37 -0000
- Subject: [Bug c/30333] New: Segmentation fault for -O2 on legal code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I just tried to compile Suse package gdm-2.16.1-43
with the GNU C compiler version 4.3 snapshot 20061223.
The compiler said
if gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I. -I../../gui -I../../daemon
-I../../vicious-extensions -DAUTHDIR=\""/var/lib/gdm"\"
-DDATADIR=\""/opt/gnome/share"\" -DDMCONFDIR=\""/etc/opt/gnome/dm"\"
-DGDM_CONFIG_FILE=\"/etc/opt/gnome/gdm/gdm.conf\"
-DGDMLOCALEDIR=\""/etc/opt/gnome/gdm"\"
-DGNOMELOCALEDIR=\""/opt/gnome/share/locale"\"
-DLIBEXECDIR=\""/opt/gnome/lib64/gdm"\" -DSBINDIR=\""/opt/gnome/sbin"\"
-DPIXMAPDIR=\""/opt/gnome/share/pixmaps"\" -I/usr/include/cairo
-I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libxml2
-I/opt/gnome/include/gtk-2.0 -I/opt/gnome/lib64/gtk-2.0/include
-I/opt/gnome/include/atk-1.0 -I/opt/gnome/include/pango-1.0
-I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib64/glib-2.0/include
-I/opt/gnome/include/libglade-2.0 -I/usr/include/cairo
-I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libart-2.0
-I/usr/include/libxml2 -I/opt/gnome/include/gtk-2.0
-I/opt/gnome/lib64/gtk-2.0/include -I/opt/gnome/include/atk-1.0
-I/opt/gnome/include/pango-1.0 -I/opt/gnome/include/glib-2.0
-I/opt/gnome/lib64/glib-2.0/include -I/opt/gnome/include/libgnomecanvas-2.0
-I/opt/gnome/include/librsvg-2 -O2 -g -fmessage-length=0
-D_FORTIFY_SOURCE=2 -fno-strict-aliasing -Wall -Wmissing-prototypes -MT
greeter_canvas_item.o -MD -MP -MF ".deps/greeter_canvas_item.Tpo" -c -o
greeter_canvas_item.o greeter_canvas_item.c; \
then mv -f ".deps/greeter_canvas_item.Tpo"
".deps/greeter_canvas_item.Po"; else rm -f ".deps/greeter_canvas_item.Tpo";
exit 1; fi
greeter_canvas_item.c:144: warning: no previous prototype for 'menubar_done'
greeter_canvas_item.c: In function 'greeter_item_create_canvas_item':
greeter_canvas_item.c:705: warning: passing argument 2 of 'g_timeout_add' from
incompatible pointer
type
greeter_canvas_item.c:926: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Source code attached. Flag -O2 required.
Here is a bit more detail from valgrind
bug31.c: In function 'greeter_item_create_canvas_item':
bug31.c:45565: warning: passing argument 2 of 'g_timeout_add' from incompatible
pointer type
==27527== Invalid read of size 1
==27527== at 0x7BB932: subreg_nregs (rtlanal.c:3153)
==27527== by 0x8DBE2E: add_stored_regs (caller-save.c:548)
==27527== by 0x8DBB16: insert_one_insn (caller-save.c:858)
==27527== by 0x8DBCDD: insert_restore (caller-save.c:698)
==27527== by 0x8DC02E: save_call_clobbered_regs (caller-save.c:487)
==27527== by 0x7B5CA4: reload (reload1.c:976)
==27527== by 0x8FBC22: rest_of_handle_global_alloc (global.c:627)
==27527== by 0x80DE14: execute_one_pass (passes.c:926)
==27527== by 0x80DFDB: execute_pass_list (passes.c:971)
==27527== by 0x80DFED: execute_pass_list (passes.c:972)
==27527== by 0x49E75D: tree_rest_of_compilation (tree-optimize.c:463)
==27527== by 0x40DF0B: c_expand_body (c-decl.c:6855)
==27527== Address 0xAFAFAFAF0000002B is not stack'd, malloc'd or (recently)
free'd
bug31.c:45786: internal compiler error: Segmentation fault
--
Summary: Segmentation fault for -O2 on legal code
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: x86_64-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30333