This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix cse related fail of pure-1.c on powerpc64-linux
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Zack Weinberg <zack at codesourcery dot com>
- Date: Wed, 3 Dec 2003 21:40:19 +1030
- Subject: Re: Fix cse related fail of pure-1.c on powerpc64-linux
- References: <20030328115633.GN931@bubble.sa.bigpond.net.au>
Zack gave the OK to this, or at least to the code added here. I've
added an explanatory comment as well.
PR target/11229
* cse.c (cse_insn): Set classp using src_const_elt if
src_eqv_elt is NULL.
Index: gcc/cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.276
diff -u -p -r1.276 cse.c
--- gcc/cse.c 27 Nov 2003 21:45:26 -0000 1.276
+++ gcc/cse.c 3 Dec 2003 10:55:10 -0000
@@ -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
--
Alan Modra
IBM OzLabs - Linux Technology Centre