]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/8828 (gcc reports some code is unreachable when it is not)
authorSteven Bosscher <s.bosscher@student.tudelft.nl>
Sat, 22 Feb 2003 05:37:25 +0000 (06:37 +0100)
committerAndreas Jaeger <aj@gcc.gnu.org>
Sat, 22 Feb 2003 05:37:25 +0000 (06:37 +0100)
2003-02-22  Steven Bosscher  <s.bosscher@student.tudelft.nl>

PR c/8828
* jump.c (never_reached_warning): Don't fall through BARRRIER
insns.  Update comments to reflect what the function really does.

From-SVN: r63276

gcc/ChangeLog
gcc/jump.c

index d3687b3c4e561ff9cf31e42f6d69eb35670263f5..c1476f4fd6b20c0743294269da7a68e23df7f6d4 100644 (file)
@@ -1,3 +1,13 @@
+2003-02-22  Steven Bosscher  <s.bosscher@student.tudelft.nl>
+
+       PR other/3782
+       * toplev.c (process_options): If flag_detailed_statistics is set,
+       then set time_report as well.
+
+       PR c/8828
+       * jump.c (never_reached_warning): Don't fall through BARRRIER
+       insns.  Update comments to reflect what the function really does.
+
 2003-02-21  Richard Henderson  <rth@redhat.com>
 
        2003-01-06  Richard Henderson  <rth@redhat.com>
index f60e16967f3b295cb97355729bea847cfab5fa44..92806fcaa4bf4a0b5f5bbfa6077a080dc37606f7 100644 (file)
@@ -1934,14 +1934,14 @@ delete_for_peephole (from, to)
      is also an unconditional jump in that case.  */
 }
 \f
-/* We have determined that INSN is never reached, and are about to
-   delete it.  Print a warning if the user asked for one.
+/* We have determined that AVOIDED_INSN is never reached, and are
+   about to delete it.  If the insn chain between AVOIDED_INSN and
+   FINISH contains more than one line from the current function, and
+   contains at least one operation, print a warning if the user asked
+   for it.  If FINISH is NULL, look between AVOIDED_INSN and a LABEL.
 
-   To try to make this warning more useful, this should only be called
-   once per basic block not reached, and it only warns when the basic
-   block contains more than one line from the current function, and
-   contains at least one operation.  CSE and inlining can duplicate insns,
-   so it's possible to get spurious warnings from this.  */
+   CSE and inlining can duplicate insns, so it's possible to get
+   spurious warnings from this.  */
 
 void
 never_reached_warning (avoided_insn, finish)
@@ -1951,15 +1951,16 @@ never_reached_warning (avoided_insn, finish)
   rtx a_line_note = NULL;
   int two_avoided_lines = 0, contains_insn = 0, reached_end = 0;
 
-  if (! warn_notreached)
+  if (!warn_notreached)
     return;
 
-  /* Scan forwards, looking at LINE_NUMBER notes, until
-     we hit a LABEL or we run out of insns.  */
+  /* Scan forwards, looking at LINE_NUMBER notes, until we hit a LABEL
+     in case FINISH is NULL, otherwise until we run out of insns.  */
 
   for (insn = avoided_insn; insn != NULL; insn = NEXT_INSN (insn))
     {
-      if (finish == NULL && GET_CODE (insn) == CODE_LABEL)
+      if ((finish == NULL && GET_CODE (insn) == CODE_LABEL)
+         || GET_CODE (insn) == BARRIER)
        break;
 
       if (GET_CODE (insn) == NOTE              /* A line number note?  */