summaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-28 12:25:21 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-28 12:25:21 +0000
commit350b17ef4ffedff588e2c5ff04c4220ef2729bc8 (patch)
treec975b4080bd3d5dadf4179b7b9ad2f7233bac1f2 /gcc/rtlanal.c
parent57132eee5c43009828515c533c86f7c2e712ecda (diff)
downloadgcc-350b17ef4ffedff588e2c5ff04c4220ef2729bc8.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51508 138bc75d-0d04-0410-961f-82ee72b054a4
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 79ccf9d4bc0..9348fd01d11 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;
}