the attached test case (which comes from GTK+) causes GCC to ICE due to the -O2 -fPIC flags:
sh4-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I.. -DG_LOG_DOMAIN=\"Gtk\" -DGTK_LIBDIR=\"/usr/lib\" -DGTK_DATADIR=\"/usr/share\" -DGTK_ DATA_PREFIX=\"/usr\" -DGTK_SYSCONFDIR=\"/etc\" -DGTK_VERSION=\"2.12.7\" -DGTK_BINARY_VERSION=\"2.10.0\" -DGTK_HOST=\"sh4-unknown-linux-gnu\" -DGTK_COMPILATION -DGTK_PRINT_BACKENDS=\"file,lpr\" "-DGTK_PRINT_PREVIEW_COMMAND=\"evince --unlink-tempfile --preview --print-settings %s % f\"" -I../gtk -I.. -I../gdk -I../gdk -I../gdk-pixbuf -I../gdk-pixbuf -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_FILE_SYS TEM_ENABLE_UNSUPPORTED -DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED -DG_DISABLE_CAST_CHECKS -pthread -D_REENTRANT -I/usr/include/glib-2.0 -I/usr/l ib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 - I/usr/include/atk-1.0 -pipe -O2 -Wall -MT gtknotebook.lo -MD -MP -MF .deps/gtknotebook.Tpo -c gtknotebook.c -fPIC -DPIC -o .libs/gtknoteboo k.o gtknotebook.c: In function 'gtk_notebook_set_focus_child': gtknotebook.c:3927: warning: dereferencing type-punned pointer will break strict-aliasing rules gtknotebook.c:3930: warning: dereferencing type-punned pointer will break strict-aliasing rules gtknotebook.c: In function 'gtk_notebook_real_remove': gtknotebook.c:4378: warning: dereferencing type-punned pointer will break strict-aliasing rules gtknotebook.c: In function 'gtk_notebook_calculate_tabs_allocation': gtknotebook.c:5488: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /tmp/cc3v7chW.out file, please attach this to your bugreport. gcc-4.2.2 and gcc-4.2.3 fail while gcc-4.1.1 works. occurs both natively on sh and when cross-compiling from powerpc. -- Summary: [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4 Product: gcc Version: 4.2.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: vapier at gentoo dot org GCC target triplet: sh4-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35225