combine.c (distribute_notes): If non-call exceptions, put the note on the trapping...
authorRichard Henderson <rth@redhat.com>
Wed, 28 Mar 2001 05:40:43 +0000 (21:40 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 28 Mar 2001 05:40:43 +0000 (21:40 -0800)
        * combine.c (distribute_notes) [REG_EH_REGION]: If non-call
        exceptions, put the note on the trapping instruction.

From-SVN: r40907

gcc/ChangeLog
gcc/combine.c

index 156756fb9a5764a7048db7e04713b68adc7d611a..92105e086ecd93a3eda254981d7b715b485aa308 100644 (file)
@@ -20,6 +20,9 @@
        * except.h (flag_non_call_exceptions): Move ...
        * flags.h: ... here.
 
+       * combine.c (distribute_notes) [REG_EH_REGION]: If non-call
+       exceptions, put the note on the trapping instruction.
+
 2001-03-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * configure.in: Don't check for bcopy.
index 4a148b9ce7ab97f4798e8154c63c3f344fe0f6fb..4aa7721e8807ad1120f18a6aebcdbe9224846619 100644 (file)
@@ -12074,6 +12074,25 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
          break;
 
        case REG_EH_REGION:
+         /* These notes must remain with the call or trapping instruction.  */
+         if (GET_CODE (i3) == CALL_INSN)
+           place = i3;
+         else if (i2 && GET_CODE (i2) == CALL_INSN)
+           place = i2;
+         else if (flag_non_call_exceptions)
+           {
+             if (may_trap_p (i3))
+               place = i3;
+             else if (i2 && may_trap_p (i2))
+               place = i2;
+             /* ??? Otherwise assume we've combined things such that we
+                can now prove that the instructions can't trap.  Drop the
+                note in this case.  */
+           }
+         else
+           abort ();
+         break;
+
        case REG_EH_RETHROW:
        case REG_NORETURN:
          /* These notes must remain with the call.  It should not be