I just tried to compile Suse package gnome-print-0.37-18 with a recent GNU C compiler version 4.2 snapshot 20060429. The compiler snapshot said if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.. -I/usr/include/freetype2 -I/opt/gnome/include/gnome-1.0 -DNEED_GNOMESUPPORT_H -I/opt/gnome/lib64/gnome-libs/include -I/opt/gnome/include -I/opt/gnome/include/gtk-1.2 -I/opt/gnome/include/glib-1.2 -I/opt/gnome/lib64/glib/include -I/usr/X11R6/include -I/opt/gnome/include/gdk-pixbuf-1.0 -I/usr/include/gnome-xml -DGNOMELOCALEDIR=\""/opt/gnome/share/locale"\" -DBINDIR=\""/opt/gnome/bin"\" -DDATADIR=\""/opt/gnome/share"\" -DSYSCONFDIR=\""/etc/opt/gnome"\" -DLIBDIR=\""/opt/gnome/lib64"\" -DFONTMAPDIR_STATIC=\""/opt/gnome/share/gnome/fonts"\" -DFONTMAPDIR_DYNAMIC=\""/etc/opt/gnome/gnome/fonts"\" -DVERSION=\""0.37"\" -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -MT gf-fontmap.o -MD -MP -MF ".deps/gf-fontmap.Tpo" -c -o gf-fontmap.o gf-fontmap.c; \ then mv -f ".deps/gf-fontmap.Tpo" ".deps/gf-fontmap.Po"; else rm -f ".deps/gf-fontmap.Tpo"; exit 1; fi gf-fontmap.c: In function 'gf_fontmap_load_file': gf-fontmap.c:257: internal compiler error: in propagate_rhs_into_lhs, at tree-ssa-dom.c:2307 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. Preprocessed source code attached. Flag -O2 required.
Created attachment 11357 [details] C source code
Reducing.
Confirmed. Reduced testcase: typedef char gchar; typedef unsigned char xmlChar; typedef struct _xmlNode xmlNode; typedef xmlNode *xmlNodePtr; struct _xmlNode { struct _xmlNode *next; struct _xmlNode *childs; }; typedef struct _GFFileEntry GFFileEntry; struct _GFFileEntry { gchar *path; }; gf_fm_load_font_2_0_truetype (xmlNodePtr node) { xmlNodePtr child; GFFileEntry ttf; ttf.path = ((void *)0); for (child = node->childs; child != ((void *)0); child = child->next) { xmlChar *type, *xmlpath; if (type && !__builtin_strcmp (type, "ttf") && !ttf.path) { if (xmlpath) { ttf.path = g_strdup (xmlpath); } } if (type) free((type)); if (ttf.path) break; } }
Caused by Author: amacleod Date: Fri Apr 28 20:39:18 2006 New Revision: 113356 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113356 Log: The condition the assert was flawed. 2006-04-28 Andrew MacLeod <amacleod@redhat.com> * tree-ssa-dom.c (propagate_rhs_into_lhs): Fix assert clause. Modified: trunk/gcc/ChangeLog trunk/gcc/tree-ssa-dom.c
The assert condition is not flawed. It has exposed a second bug with the old immuse iterator scheme that was also hidden by the old algorithm work around Jeff had implemented. When iterating over the immediate uses, and deleting a stmt (such as a conditional) causes an edge to be removed, PHI nodes have an argument deleted. when we remove PHI arguments, we move the last phi argument to whatever position we actually deleted, and reduce the argument count. When arguments are moved, they were simply being delinked and then linked back into the use chain. In this particular example, the argument being moved was another occurence of the ssa_name being iterated over, and by delinking it and linking it back in, it was moved back to the beginning of the immuse list. This caused it to be missed during the iteration pahse, and rightfully triggered the assert. The fix is to simply keep the same linked position when the argument is moved instead of removing it from the list and linking it back in. Patch is currently being tested. Andrew
Created attachment 11361 [details] proposed patch This is the patch undergoing testing.
Subject: Bug 27381 Author: amacleod Date: Wed May 3 17:13:37 2006 New Revision: 113499 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113499 Log: 2006-05-02 Andrew MacLeod <amacleod@redhat.com> PR tree-optimization/27381 * tree-phinodes.c (remove_phi_arg_num): When moving a phi argument, maintain the same immediate_use links. * tree-ssa-operands.c (dump_immediate_uses_for): Show iteration marker node rather than segfaulting. Modified: trunk/gcc/ChangeLog trunk/gcc/tree-phinodes.c trunk/gcc/tree-ssa-operands.c
Fixed.