aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel1@de.ibm.com>2009-04-30 06:54:54 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2009-04-30 06:54:54 +0000
commit82f5c05de6fdbff6ce599419a24d63b400ea900a (patch)
treee2fd954fbec5e73aff18c47dfb44b175bcca2f06 /gcc/gcse.c
parent6d8f135b27947caf8e4dbdcaf050f2ae0b9957e1 (diff)
downloadgcc-82f5c05de6fdbff6ce599419a24d63b400ea900a.zip
gcc-82f5c05de6fdbff6ce599419a24d63b400ea900a.tar.gz
gcc-82f5c05de6fdbff6ce599419a24d63b400ea900a.tar.bz2
gcse.c (gcse_constant_p): Make sure the constant is sharable.
2009-04-30 Andreas Krebbel <krebbel1@de.ibm.com> * gcse.c (gcse_constant_p): Make sure the constant is sharable. From-SVN: r146997
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index c7b4b8f..fefdb8f 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -1301,7 +1301,9 @@ gcse_constant_p (const_rtx x)
&& ! FLOAT_MODE_P (GET_MODE (XEXP (x, 1))))
return true;
- return CONSTANT_P (x);
+ /* Since X might be inserted more than once we have to take care that it
+ is sharable. */
+ return CONSTANT_P (x) && (GET_CODE (X) != CONST || shared_const_p (x));
}
/* Scan pattern PAT of INSN and add an entry to the hash TABLE (set or