tree-eh.c (tree_could_trap_p): Allow non-constant floating point trapping divide.
authorDavid Edelsohn <edelsohn@gnu.org>
Mon, 4 Apr 2005 22:50:53 +0000 (22:50 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Mon, 4 Apr 2005 22:50:53 +0000 (18:50 -0400)
2005-04-02  David Edelsohn  <edelsohn@gnu.org>
            Daniel Jacobowitz  <dan@codesourcery.com>

        * tree-eh.c (tree_could_trap_p): Allow non-constant floating point
        trapping divide.
        * rtlanal.c (may_trap_p): Same.

Co-Authored-By: Daniel Jacobowitz <dan@codesourcery.com>
From-SVN: r97582

gcc/ChangeLog
gcc/rtlanal.c
gcc/tree-eh.c

index 2a114c59d380a09202805b7c8ea0bd2271110f8e..36608c762564a8cf6d26f9e341624bd653152865 100644 (file)
@@ -1,3 +1,10 @@
+2005-04-04  David Edelsohn  <edelsohn@gnu.org>
+           Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * tree-eh.c (tree_could_trap_p): Allow non-constant floating point
+       trapping divide.
+       * rtlanal.c (may_trap_p): Same.
+
 2005-04-04  Dale Johannesen  <dalej@apple.com>
 
        * ChangeLog:  remove reference to ChangeLog.12.
index 0686af8c65bc4fe52bf770c60b01860f25d089f7..da9774e488befcad3885d7c6e8d8c5c80e1c828e 100644 (file)
@@ -2105,11 +2105,9 @@ may_trap_p (rtx x)
     case UMOD:
       if (HONOR_SNANS (GET_MODE (x)))
        return 1;
-      if (! CONSTANT_P (XEXP (x, 1))
-         || (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT
-             && flag_trapping_math))
-       return 1;
-      if (XEXP (x, 1) == const0_rtx)
+      if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
+       return flag_trapping_math;
+      if (!CONSTANT_P (XEXP (x, 1)) || (XEXP (x, 1) == const0_rtx))
        return 1;
       break;
 
index ab945ff97017de4c4e763babf3b69717d0fef6af..3dbcfa87ef9ab110fee9757dd79f98fa9dd6808e 100644 (file)
@@ -1787,8 +1787,8 @@ tree_could_trap_p (tree expr)
     case RDIV_EXPR:
       if (honor_snans || honor_trapv)
        return true;
-      if (fp_operation && flag_trapping_math)
-       return true;
+      if (fp_operation)
+       return flag_trapping_math;
       t = TREE_OPERAND (expr, 1);
       if (!TREE_CONSTANT (t) || integer_zerop (t))
         return true;