This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20280] [4.0/4.1 regression] ICE in create_tmp_var, at gimplify.c:368
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Mar 2007 00:42:44 -0000
- Subject: [Bug c++/20280] [4.0/4.1 regression] ICE in create_tmp_var, at gimplify.c:368
- References: <bug-20280-8961@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #19 from pinskia at gcc dot gnu dot org 2007-03-14 00:42 -------
I have a patch which fixes after my patch for PR 30132. The way I fixed it is
an all front-end fix:
Index: typeck.c
===================================================================
--- typeck.c (revision 122880)
+++ typeck.c (working copy)
@@ -4060,6 +4060,14 @@ build_address (tree t)
if (error_operand_p (t) || !cxx_mark_addressable (t))
return error_mark_node;
+ if (TREE_CODE (t) == COND_EXPR)
+ {
+ tree ptrtype = build_pointer_type (TREE_TYPE (t));
+ return build3 (COND_EXPR, ptrtype, TREE_OPERAND (t, 0),
+ build_address (TREE_OPERAND (t, 1)),
+ build_address (TREE_OPERAND (t, 2)));
+ }
+
addr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (t)), t);
return addr;
Create a new COND_EXPR for when we want to create an address of a COND_EXPR, by
this point, we should have errored out.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20280