From c5e004046a04dfa21751bbaa75ec910ccc8c6e41 Mon Sep 17 00:00:00 2001 From: krebbel Date: Thu, 30 Apr 2009 06:54:54 +0000 Subject: [PATCH] 2009-04-30 Andreas Krebbel * gcse.c (gcse_constant_p): Make sure the constant is sharable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146997 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/gcse.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c2943a6..f5a4bd8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2009-04-30 Andreas Krebbel + + * gcse.c (gcse_constant_p): Make sure the constant is sharable. + 2009-04-29 James E. Wilson * config/mips/mips.c (mips_add_offset): Use gen_int_mode for 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 -- 2.7.4