aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2002-03-28 13:25:21 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2002-03-28 12:25:21 +0000
commitf5eb5fd0d6e8d476d164c57d4c1ca1248e83c8ee (patch)
treec975b4080bd3d5dadf4179b7b9ad2f7233bac1f2 /gcc/rtlanal.c
parentac43cbb50723665947ac875f70f0035e09f00680 (diff)
downloadgcc-f5eb5fd0d6e8d476d164c57d4c1ca1248e83c8ee.zip
gcc-f5eb5fd0d6e8d476d164c57d4c1ca1248e83c8ee.tar.gz
gcc-f5eb5fd0d6e8d476d164c57d4c1ca1248e83c8ee.tar.bz2
rtlanal.c: Include flags.h
* rtlanal.c: Include flags.h (may_trap_p): Do not mark FP operations if trapping if !flag_trapping_math * Makefile.in (rtlanal.o): Add dependency on flag.h * ifcvt.c (noce_operand_ok): Avoid the lameness. From-SVN: r51508
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 79ccf9d..9348fd0 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -28,6 +28,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "insn-config.h"
#include "recog.h"
#include "tm_p.h"
+#include "flags.h"
/* Forward declarations */
static int global_reg_mentioned_p_1 PARAMS ((rtx *, void *));
@@ -2348,7 +2349,8 @@ may_trap_p (x)
case UDIV:
case UMOD:
if (! CONSTANT_P (XEXP (x, 1))
- || GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
+ || (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT
+ && flag_trapping_math))
return 1;
/* This was const0_rtx, but by not using that,
we can link this file into other programs. */
@@ -2367,6 +2369,8 @@ may_trap_p (x)
case LT:
case COMPARE:
/* Some floating point comparisons may trap. */
+ if (!flag_trapping_math)
+ break;
/* ??? There is no machine independent way to check for tests that trap
when COMPARE is used, though many targets do make this distinction.
For instance, sparc uses CCFPE for compares which generate exceptions
@@ -2387,7 +2391,8 @@ may_trap_p (x)
default:
/* Any floating arithmetic may trap. */
- if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
+ if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT
+ && flag_trapping_math)
return 1;
}