This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/79825] [7 Regression] Uninitialized uses in aggregate copies of empty structs (missed DCE in C++ gimplify)
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 03 Mar 2017 10:00:42 +0000
- Subject: [Bug c++/79825] [7 Regression] Uninitialized uses in aggregate copies of empty structs (missed DCE in C++ gimplify)
- Auto-submitted: auto-generated
- References: <bug-79825-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79825
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
gimplifying
D.2394 = TARGET_EXPR <D.2392, p1>;, <<< Unknown tree: empty_class_expr >>>;
doesn't hit the
else if (simple_empty_class_p (TREE_TYPE (op0), op1))
{
/* Remove any copies of empty classes. Also drop volatile
variables on the RHS to avoid infinite recursion from
gimplify_expr trying to load the value. */
case. Fix:
Index: gcc/cp/cp-gimplify.c
===================================================================
--- gcc/cp/cp-gimplify.c (revision 245863)
+++ gcc/cp/cp-gimplify.c (working copy)
@@ -549,6 +549,7 @@ simple_empty_class_p (tree type, tree op
return
((TREE_CODE (op) == COMPOUND_EXPR
&& simple_empty_class_p (type, TREE_OPERAND (op, 1)))
+ || TREE_CODE (op) == EMPTY_CLASS_EXPR
|| is_gimple_lvalue (op)
|| INDIRECT_REF_P (op)
|| (TREE_CODE (op) == CONSTRUCTOR