aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1997-12-06 17:31:01 -0700
committerJeff Law <law@gcc.gnu.org>1997-12-06 17:31:01 -0700
commit956d69504d77d301015532d2f0564213f0efc706 (patch)
treeec80f8d1e46852ac1ba45aecdcda7201c302ac6f /gcc/cse.c
parent27b6b158c29b45fd80c2f104d5da1f4bc818d7ab (diff)
downloadgcc-956d69504d77d301015532d2f0564213f0efc706.zip
gcc-956d69504d77d301015532d2f0564213f0efc706.tar.gz
gcc-956d69504d77d301015532d2f0564213f0efc706.tar.bz2
Merge from gcc-2.8
From-SVN: r16987
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 593d075..9b1ffe1 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -30,6 +30,7 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "recog.h"
+#include "expr.h"
#include <setjmp.h>
@@ -3390,6 +3391,10 @@ simplify_binary_operation (code, mode, op0, op1)
f1 = real_value_truncate (mode, f1);
#ifdef REAL_ARITHMETIC
+#ifndef REAL_INFINITY
+ if (code == DIV && REAL_VALUES_EQUAL (f1, dconst0))
+ return 0;
+#endif
REAL_ARITHMETIC (value, rtx_to_tree_code (code), f0, f1);
#else
switch (code)
@@ -4769,6 +4774,10 @@ fold_rtx (x, insn)
since they are used only for lists of args
in a function call's REG_EQUAL note. */
case EXPR_LIST:
+ /* Changing anything inside an ADDRESSOF is incorrect; we don't
+ want to (e.g.,) make (addressof (const_int 0)) just because
+ the location is known to be zero. */
+ case ADDRESSOF:
return x;
#ifdef HAVE_cc0
@@ -5019,7 +5028,7 @@ fold_rtx (x, insn)
&& GET_CODE (XEXP (addr, 1)) == SYMBOL_REF)
base = XEXP (addr, 1);
else if (GET_CODE (addr) == ADDRESSOF)
- XEXP (x, 0) = addr;
+ return change_address (x, VOIDmode, addr);
/* If this is a constant pool reference, we can fold it into its
constant to allow better value tracking. */
@@ -6410,7 +6419,7 @@ cse_insn (insn, in_libcall_block)
a pseudo that is set more than once, do not record SRC. Using
SRC as a replacement for anything else will be incorrect in that
situation. Note that this usually occurs only for stack slots,
- in which case all the RTL would be refering to SRC, so we don't
+ in which case all the RTL would be referring to SRC, so we don't
lose any optimization opportunities by not having SRC in the
hash table. */