Created attachment 22321 [details] preprocessed source The package ebook-tools fails to build with /usr/bin/gcc -Depub_EXPORTS -Wall -W -Wno-long-long -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -Wshadow -fno-common -fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fPIC -I/usr/src/packages/BUILD/ebook-tools-0.2.0/src/libepub -I/usr/include/libxml2 -o CMakeFiles/epub.dir/epub.o -c /usr/src/packages/BUILD/ebook-tools-0.2.0/src/libepub/epub.c /usr/src/packages/BUILD/ebook-tools-0.2.0/src/libepub/epub.c: In function 'epub_open': /usr/src/packages/BUILD/ebook-tools-0.2.0/src/libepub/epub.c:19:3: internal compiler error: in release_defs, at tree-ssanames.c:313 Please submit a full bug report, with preprocessed source if appropriate. See <http://bugs.opensuse.org/> for instructions. and the cause is -Wwrite-strings as the attached testcase shows > ./cc1 -quiet ~/epub.i -m32 -Wwrite-strings /usr/src/packages/BUILD/ebook-tools-0.2.0/src/libepub/epub.c: In function 'epub_open': /usr/src/packages/BUILD/ebook-tools-0.2.0/src/libepub/epub.c:19:15: internal compiler error: in release_defs, at tree-ssanames.c:313 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
It is caused by revision 164438: http://gcc.gnu.org/ml/gcc-cvs/2010-09/msg00734.html
Reduced testcase (fails without any options, -Wwrite-strings is not needed): __attribute__((gnu_inline, always_inline)) extern inline char * strncpy (char *dest, const char *src, __SIZE_TYPE__ len) { return __builtin_strncpy (dest, src, len); } void foo (char *s) { strncpy (s, "", 0); } The problem is the fold_stmt Honza added to gimplify_call_expr. Unfortunately fold_stmt doesn't expect it is being called when still not in SSA form. Seems gimplify_and_update_call_from_tree has been adjusted for that in PR45073, but update_call_from_tree still needs doing that. Will work on it tomorrow.
Created attachment 22336 [details] gcc46-pr46360.patch Untested fix.
Author: jakub Date: Tue Nov 9 11:54:32 2010 New Revision: 166482 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166482 Log: PR middle-end/46360 * tree-ssa-propagate.c (update_call_from_tree): Fix for use not in SSA mode. * gcc.c-torture/compile/pr46360.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr46360.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-propagate.c
Fixed.