tree-ssa-live.c (remove_unused_scope_block_p): Remove again DECL_IGNORED_P non-reg...
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 22 Jun 2012 06:41:09 +0000 (06:41 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 22 Jun 2012 06:41:09 +0000 (06:41 +0000)
* tree-ssa-live.c (remove_unused_scope_block_p): Remove again
DECL_IGNORED_P non-reg vars even if they are used.

From-SVN: r188872

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/lto15.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/lto15.ads [new file with mode: 0644]
gcc/tree-ssa-live.c

index 5ae0db9f76d4f9c47fc78384d551353079729707..8326b55101a242c774367b64865a889f54fdf35b 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-22  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * tree-ssa-live.c (remove_unused_scope_block_p): Remove again
+       DECL_IGNORED_P non-reg vars even if they are used.
+
 2012-06-21  Alexandre Oliva  <aoliva@redhat.com>
 
        PR debug/53671
@@ -48,7 +53,7 @@
        x_cur_stmt_list field of the restored language function.
 
 2012-06-21   Sterling Augustine  <saugustine@google.com>
-        Cary Coutant  <ccoutant@google.com>
+             Cary Coutant  <ccoutant@google.com>
 
        * dwarf2out.c (is_cu_die, is_namespace_die, is_class_die,
        add_AT_pubnames, add_enumerator_pubname, want_pubnames): New functions.
index 48f5f4e79632f6fdf125dc1c6823df0d283afff9..fe32345683805ec28eb34fabae1dc5c626628015 100644 (file)
@@ -1,3 +1,7 @@
+2012-06-22  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/lto15.ad[sb]: New test.
+
 2012-06-21  Meador Inge  <meadori@codesourcery.com>
 
        PR c/53702
diff --git a/gcc/testsuite/gnat.dg/lto15.adb b/gcc/testsuite/gnat.dg/lto15.adb
new file mode 100644 (file)
index 0000000..b1bc251
--- /dev/null
@@ -0,0 +1,11 @@
+-- { dg-do compile }
+-- { dg-options "-O -flto -g" }
+
+package body Lto15 is
+
+   function Proc (Data : Arr) return R is
+   begin
+      return (Data'Length, Data);
+   end;
+
+end Lto15;
diff --git a/gcc/testsuite/gnat.dg/lto15.ads b/gcc/testsuite/gnat.dg/lto15.ads
new file mode 100644 (file)
index 0000000..297ea0c
--- /dev/null
@@ -0,0 +1,11 @@
+package Lto15 is
+
+   type Arr is array (Positive range <>) of Integer;
+
+   type R(Size : Positive) is record
+      Data : Arr (1 .. Size);
+   end record;
+
+   function Proc (Data : Arr) return R;
+
+end Lto15;
index 252020624b444e740ff41202a9f77ed1a2e3b1cb..8f504f005fe39dfbde1817db95728e889561431c 100644 (file)
@@ -458,11 +458,8 @@ remove_unused_scope_block_p (tree scope, bitmap global_unused_vars)
       else if (TREE_CODE (*t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (*t))
        unused = false;
 
-      /* Remove everything we don't generate debug info for.
-        Don't remove larger vars though, because BLOCK_VARS are
-        used also during expansion to determine which variables
-        might share stack space.  */
-      else if (DECL_IGNORED_P (*t) && is_gimple_reg (*t))
+      /* Remove everything we don't generate debug info for.  */
+      else if (DECL_IGNORED_P (*t))
        {
          *t = DECL_CHAIN (*t);
          next = t;