This fixes PR53437, at -O0 as we are not having debug stmts there,
we need a dummy init stmt.

Bootstrapped and tested on x86_64-unknown-linux-gnu applied.

Richard.

2012-05-21  Richard Guenther  <rguent...@suse.de>

        PR middle-end/53437
        * tree-inline.c (setup_one_parameter): Create a dummy init
        statement for unused parameters when not optimizing.

Index: gcc/tree-inline.c
===================================================================
--- gcc/tree-inline.c   (revision 187709)
+++ gcc/tree-inline.c   (working copy)
@@ -2701,7 +2701,8 @@ setup_one_parameter (copy_body_data *id,
       STRIP_USELESS_TYPE_CONVERSION (rhs);
 
       /* If we are in SSA form properly remap the default definition
-         or omit the initialization if the parameter is unused.  */
+         or assign to a dummy SSA name if the parameter is unused and
+        we are not optimizing.  */
       if (gimple_in_ssa_p (cfun) && is_gimple_reg (p))
        {
          if (def)
@@ -2711,6 +2712,11 @@ setup_one_parameter (copy_body_data *id,
              SSA_NAME_IS_DEFAULT_DEF (def) = 0;
              set_default_def (var, NULL);
            }
+         else if (!optimize)
+           {
+             def = make_ssa_name (var, NULL);
+             init_stmt = gimple_build_assign (def, rhs);
+           }
        }
       else
         init_stmt = gimple_build_assign (var, rhs);

Reply via email to