aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2003-12-03 11:09:55 +0000
committerAlan Modra <amodra@gcc.gnu.org>2003-12-03 21:39:55 +1030
commit1fcc57f1958ac52239279de6d3a6b1979e32700b (patch)
treed81a6525397ab505d39610eaf941b61b75e1676a /gcc/cse.c
parent01c43039cf554b3943f4746651cbd8d757227a79 (diff)
downloadgcc-1fcc57f1958ac52239279de6d3a6b1979e32700b.zip
gcc-1fcc57f1958ac52239279de6d3a6b1979e32700b.tar.gz
gcc-1fcc57f1958ac52239279de6d3a6b1979e32700b.tar.bz2
re PR target/11229 (pure-1.c fails on powerpc64-linux with -O1)
PR target/11229 * cse.c (cse_insn): Set classp using src_const_elt if src_eqv_elt is NULL. From-SVN: r74225
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index faaf187..4b0f1ec 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5827,6 +5827,16 @@ cse_insn (rtx insn, rtx libcall_insn)
enum machine_mode mode
= GET_MODE (src) == VOIDmode ? GET_MODE (dest) : GET_MODE (src);
+ /* It's possible that we have a source value known to be
+ constant but don't have a REG_EQUAL note on the insn.
+ Lack of a note will mean src_eqv_elt will be NULL. This
+ can happen where we've generated a SUBREG to access a
+ CONST_INT that is already in a register in a wider mode.
+ Ensure that the source expression is put in the proper
+ constant class. */
+ if (!classp)
+ classp = sets[i].src_const_elt;
+
if (sets[i].src_elt == 0)
{
/* Don't put a hard register source into the table if this is