This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/80344] -Wuninitialized triggering on a ctor on ARM


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);
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]