[Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 21 11:18:00 GMT 2012


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.



More information about the Gcc-bugs mailing list