This patch keeps gcc-4.0.0-snapshot from segfaulting when building glibc with -O3 or -finline-functions. See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19345 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-rhl-branch&r1=1.570.4.2&r2=1.570.4.3 =================================================================== RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v retrieving revision 1.570.4.2 retrieving revision 1.570.4.3 diff -u -r1.570.4.2 -r1.570.4.3 --- gcc/gcc/dwarf2out.c 2005/03/09 00:33:56 1.570.4.2 +++ gcc/gcc/dwarf2out.c 2005/03/11 13:06:40 1.570.4.3 @@ -10497,8 +10497,12 @@ if (TYPE_P (fn)) fn = TYPE_STUB_DECL (fn); + + /* TYPE_STUB_DECL may have given us a NULL, which decl_function_context + won't like. */ + if (fn) + fn = decl_function_context (fn); - fn = decl_function_context (fn); if (fn) dwarf2out_abstract_function (fn); }