Following testcase extracted from WINE crashes in gimple_add_tmp_var, at gimplify.c:535 /home/marcus/projects/gcc/BIN/bin/gcc -O2 -c dialog.i dialog.i: In function 'f': dialog.i:8: internal compiler error: in gimple_add_tmp_var, at gimplify.c:535 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. gcc version 4.1.0 20050610 (experimental)
Created attachment 9067 [details] dialog.i gcc -c -O2 dialog.i
Problem seems to be that the C front end assumes something without a DECL_NAME is not yet in the unexpanded variables list. Don't ask me why :-/ Hack: Index: c-gimplify.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/c-gimplify.c,v retrieving revision 2.30 diff -u -3 -p -r2.30 c-gimplify.c --- c-gimplify.c 1 Jun 2005 02:50:51 -0000 2.30 +++ c-gimplify.c 11 Jun 2005 09:10:51 -0000 @@ -185,9 +185,11 @@ gimplify_compound_literal_expr (tree *ex tree decl = DECL_EXPR_DECL (decl_s); /* This decl isn't mentioned in the enclosing block, so add it to the - list of temps. FIXME it seems a bit of a kludge to say that - anonymous artificial vars aren't pushed, but everything else is. */ - if (DECL_NAME (decl) == NULL_TREE) + list of temps if it is not already in that list. + FIXME it seems a bit of a kludge to say that anonymous artificial + vars aren't pushed, but everything else is. */ + if (DECL_NAME (decl) == NULL_TREE + && !DECL_SEEN_IN_BIND_EXPR_P (decl)) gimple_add_tmp_var (decl); gimplify_and_add (decl_s, pre_p);
Confirmed.
*** Bug 22050 has been marked as a duplicate of this bug. ***
Testing a patch for bugs 22013 and 22098.
Subject: Bug 22013 CVSROOT: /cvs/gcc Module name: gcc Changes by: jsm28@gcc.gnu.org 2005-07-05 17:50:24 Modified files: gcc : ChangeLog c-objc-common.h c-tree.h c-typeck.c langhooks-def.h langhooks.c langhooks.h tree.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/compile: pr22013-1.c gcc/testsuite/gcc.c-torture/execute: pr22098-1.c pr22098-2.c pr22098-3.c Log message: PR c/22013 PR c/22098 * langhooks.h (struct lang_hooks): Add expr_to_decl. * langhooks.c (lhd_expr_to_decl): New. * langhooks-def.h (lhd_expr_to_decl, LANG_HOOKS_EXPR_TO_DECL): New. (LANG_HOOKS_INITIALIZER): Update. * tree.c (recompute_tree_invarant_for_addr_expr): Call expr_to_decl langhook. * c-tree.h (c_expr_to_decl): Declare. * c-typeck.c (c_expr_to_decl): New. (build_unary_op): Do not handle ADDR_EXPR of COMPOUND_LITERAL_EXPR specially. * c-objc-common.h (LANG_HOOKS_EXPR_TO_DECL): Define. testsuite: * gcc.c-torture/compile/pr22013-1.c, gcc.c-torture/execute/pr22098-1.c, gcc.c-torture/execute/pr22098-2.c, gcc.c-torture/execute/pr22098-3.c: New tests. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9345&r2=2.9346 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-objc-common.h.diff?cvsroot=gcc&r1=2.7&r2=2.8 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-tree.h.diff?cvsroot=gcc&r1=1.207&r2=1.208 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.463&r2=1.464 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/langhooks-def.h.diff?cvsroot=gcc&r1=1.99&r2=1.100 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/langhooks.c.diff?cvsroot=gcc&r1=1.83&r2=1.84 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/langhooks.h.diff?cvsroot=gcc&r1=1.107&r2=1.108 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&r1=1.493&r2=1.494 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5725&r2=1.5726 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr22013-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22098-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22098-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22098-3.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 22013 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: jsm28@gcc.gnu.org 2005-07-08 13:08:15 Modified files: gcc : ChangeLog c-objc-common.h c-tree.h c-typeck.c langhooks-def.h langhooks.c langhooks.h tree.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/compile: pr22013-1.c gcc/testsuite/gcc.c-torture/execute: pr22098-1.c pr22098-2.c pr22098-3.c Log message: PR c/22013 PR c/22098 * langhooks.h (struct lang_hooks): Add expr_to_decl. * langhooks.c (lhd_expr_to_decl): New. * langhooks-def.h (lhd_expr_to_decl, LANG_HOOKS_EXPR_TO_DECL): New. (LANG_HOOKS_INITIALIZER): Update. * tree.c (recompute_tree_invarant_for_addr_expr): Call expr_to_decl langhook. * c-tree.h (c_expr_to_decl): Declare. * c-typeck.c (c_expr_to_decl): New. (build_unary_op): Do not handle ADDR_EXPR of COMPOUND_LITERAL_EXPR specially. * c-objc-common.h (LANG_HOOKS_EXPR_TO_DECL): Define. testsuite: * gcc.c-torture/compile/pr22013-1.c, gcc.c-torture/execute/pr22098-1.c, gcc.c-torture/execute/pr22098-2.c, gcc.c-torture/execute/pr22098-3.c: New tests. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.297&r2=2.7592.2.298 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-objc-common.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.4&r2=2.4.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.193.4.4&r2=1.193.4.5 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.419.2.7&r2=1.419.2.8 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/langhooks-def.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.97&r2=1.97.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/langhooks.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.81&r2=1.81.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/langhooks.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.104&r2=1.104.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.466.4.4&r2=1.466.4.5 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.249&r2=1.5084.2.250 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr22013-1.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.6.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22098-1.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.6.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22098-2.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.6.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22098-3.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.6.1
Fixed for 4.0.2 and above.