]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/19551 (pure (complex types) function call removed as dead (LAPACK...
authorJakub Jelinek <jakub@redhat.com>
Mon, 24 Jan 2005 09:10:53 +0000 (10:10 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 24 Jan 2005 09:10:53 +0000 (10:10 +0100)
* flow.c (propagate_one_insn): Formatting.

PR middle-end/19551
* flow.c (libcall_dead_p): Be more conservative if unsure.
If there are any instructions between insn and call, see if they are
all dead before saying the libcall is dead.

* gcc.c-torture/execute/20050121-1.c: New test.

From-SVN: r94149

gcc/ChangeLog
gcc/flow.c
gcc/testsuite/ChangeLog

index d5b90bc76211b7a821db146bdee1b9e9171c5043..2053b9b87204b849736d69c89393df940c98d423 100644 (file)
@@ -1,3 +1,12 @@
+2005-01-24  Jakub Jelinek  <jakub@redhat.com>
+
+       * flow.c (propagate_one_insn): Formatting.
+
+       PR middle-end/19551
+       * flow.c (libcall_dead_p): Be more conservative if unsure.
+       If there are any instructions between insn and call, see if they are
+       all dead before saying the libcall is dead.
+
 2005-01-22  Ralf Corsepius  <ralf.corsepius@rtems.org>
 
        PR target/19548
index 94a27c36f457c91e3bf5a8538e7f448f85244145..fed908dc451f3c85cd7bf9adb9fadc6fde65ad07 100644 (file)
@@ -1591,7 +1591,7 @@ propagate_one_insn (struct propagate_block_info *pbi, rtx insn)
       pbi->cc0_live = 0;
 
       if (libcall_is_dead)
-       prev = propagate_block_delete_libcall ( insn, note);
+       prev = propagate_block_delete_libcall (insn, note);
       else
        {
 
@@ -2268,7 +2268,7 @@ libcall_dead_p (struct propagate_block_info *pbi, rtx note, rtx insn)
     {
       rtx r = SET_SRC (x);
 
-      if (GET_CODE (r) == REG)
+      if (GET_CODE (r) == REG || GET_CODE (r) == SUBREG)
        {
          rtx call = XEXP (note, 0);
          rtx call_pat;
@@ -2302,10 +2302,20 @@ libcall_dead_p (struct propagate_block_info *pbi, rtx note, rtx insn)
              call_pat = XVECEXP (call_pat, 0, i);
            }
 
-         return insn_dead_p (pbi, call_pat, 1, REG_NOTES (call));
+         if (! insn_dead_p (pbi, call_pat, 1, REG_NOTES (call)))
+           return 0;
+
+         while ((insn = PREV_INSN (insn)) != call)
+           {
+             if (! INSN_P (insn))
+               continue;
+             if (! insn_dead_p (pbi, PATTERN (insn), 0, REG_NOTES (insn)))
+               return 0;
+           }
+         return 1;
        }
     }
-  return 1;
+  return 0;
 }
 
 /* Return 1 if register REGNO was used before it was set, i.e. if it is
index cc4e1108dbde3521c3d9ee19facaeb5b49864b88..2076e09b26a91da7b8995a8b5b723089e6807465 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/19551
+       * gcc.c-torture/execute/20050121-1.c: New test.
+
 2005-01-24 David Billinghurst (David.Billinghurst@riotinto.com)
 
        PR other/16403