OSDN Git Service

PR debug/39267
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 1 Mar 2009 11:02:30 +0000 (11:02 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 1 Mar 2009 11:02:30 +0000 (11:02 +0000)
* tree-inline.c (setup_one_parameter): Do not copy propagate
arguments when not optimizing.
PR debug/39267
* gcc.dg/debug/dwarf2/inline1.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144515 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/dwarf2/inline1.c [new file with mode: 0644]
gcc/tree-inline.c

index 1db21e5..dba3b12 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-28  Jan Hubicka  <jh@suse.cz>
+
+       PR debug/39267
+       * tree-inline.c (setup_one_parameter): Do not copy propagate
+       arguments when not optimizing.
+
 2009-02-28  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/39327
index aeec72a..c6b8017 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-01  Jan Hubicka  <jh@suse.cz>
+
+       PR debug/39267
+       * gcc.dg/debug/dwarf2/inline1.c: New testcase.
+
 2009-03-01  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/pack12.adb: New test.
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/inline1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/inline1.c
new file mode 100644 (file)
index 0000000..11c8fad
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf-2 -dA" } */
+void e(int);
+__attribute__ ((always_inline)) inline int
+t(int function_parameter)
+{
+  e(function_parameter);
+}
+
+void test (int function_parameter2)
+{
+  t(function_parameter2);
+}
+
+/* Verify that we get both function_parameter and function_parameter2 declared
+   in test.  Overall we should have 3 variables with location defined (also
+   function_parameter in offline copy of t.  */
+/* { dg-final { scan-assembler-times " DW_AT_location" 3 } } */
index a7e25fd..65d5b88 100644 (file)
@@ -2048,6 +2048,7 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
      We might want to introduce a notion that single SSA_NAME might
      represent multiple variables for purposes of debugging. */
   if (gimple_in_ssa_p (cfun) && rhs && def && is_gimple_reg (p)
+      && optimize
       && (TREE_CODE (rhs) == SSA_NAME
          || is_gimple_min_invariant (rhs))
       && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def))
@@ -2058,7 +2059,7 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
 
   /* If the value of argument is never used, don't care about initializing
      it.  */
-  if (gimple_in_ssa_p (cfun) && !def && is_gimple_reg (p))
+  if (optimize && gimple_in_ssa_p (cfun) && !def && is_gimple_reg (p))
     {
       gcc_assert (!value || !TREE_SIDE_EFFECTS (value));
       return NULL;