This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/80344] -Wuninitialized triggering on a ctor on ARM
- 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, 07 Apr 2017 11:57:07 +0000
- Subject: [Bug tree-optimization/80344] -Wuninitialized triggering on a ctor on ARM
- Auto-submitted: auto-generated
- References: <bug-80344-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80344
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
So it happens when inlining
MEM[(struct &)&<retval>] ={v} {CLOBBER};
and substituting &this_14(D)->http_ver for the address. Then we trigger
id->regimplify = true; but in the end we simplify it to
MEM[(struct &)this_14(D) + 4] ={v} {CLOBBER};
and gimple_regimplify_operands wrecks this via
else if (i == 2
&& is_gimple_assign (stmt)
&& num_ops == 2
&& get_gimple_rhs_class (gimple_expr_code (stmt))
== GIMPLE_SINGLE_RHS)
gimplify_expr (&op, &pre, NULL,
rhs_predicate_for (gimple_assign_lhs (stmt)),
fb_rvalue);
and {CLOBBER} is not is_gimple_mem_rhs_or_call.
Testing
Index: gcc/gimplify.c
===================================================================
--- gcc/gimplify.c (revision 246757)
+++ gcc/gimplify.c (working copy)
@@ -493,7 +493,9 @@ is_gimple_mem_rhs_or_call (tree t)
if (is_gimple_reg_type (TREE_TYPE (t)))
return is_gimple_val (t);
else
- return (is_gimple_val (t) || is_gimple_lvalue (t)
+ return (is_gimple_val (t)
+ || is_gimple_lvalue (t)
+ || TREE_CLOBBER_P (t)
|| TREE_CODE (t) == CALL_EXPR);
}