This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Nov 2012 11:18:22 +0000
- Subject: [Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
- Auto-submitted: auto-generated
- References: <bug-55419-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-21 11:18:22 UTC ---
/* We always set TREE_SIDE_EFFECTS so that expand_expr does not
ignore the TARGET_EXPR. If there really turn out to be no
side-effects, then the optimizer should be able to get rid of
whatever code is generated anyhow. */
TREE_SIDE_EFFECTS (t) = 1;
+ if (literal_type_p (type))
+ TREE_CONSTANT (t) = TREE_CONSTANT (value);
So we end up with TARGET_EXPR with TREE_SIDE_EFFECTS, but TREE_CONSTANT set
too, which is what the gimplifier is complaining about. constants shouldn't
have side-effects. If this is some trick internal to the C++ FE, then at least
the genericizer should drop TREE_CONSTANT from TARGET_EXPRs with
TREE_SIDE_EFFECTS set that are passed down to the middle-end.