This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR9226


In optimization/9226 GCSE is replacing the stack pointer register by a
pseudo reg that happens to contain the same value.  Shouldn't there be a
check in do_local_cprop that the register to be replaced is not a fixed
register?

2003-01-08  Andreas Schwab  <schwab@suse.de>

	* gcse.c (do_local_cprop): Don't replace a fixed register.

Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.225
diff -u -p -a -u -p -a -r1.225 gcc/gcse.c
--- gcc/gcse.c	7 Jan 2003 22:14:42 -0000	1.225
+++ gcc/gcse.c	8 Jan 2003 16:13:29 -0000
@@ -4262,7 +4262,8 @@ do_local_cprop (x, insn, alter_jumps, li
   if (GET_CODE (x) == REG
       && (REGNO (x) >= FIRST_PSEUDO_REGISTER
           || (GET_CODE (PATTERN (insn)) != USE
-	      && asm_noperands (PATTERN (insn)) < 0)))
+	      && asm_noperands (PATTERN (insn)) < 0
+	      && ! fixed_regs[REGNO (x)])))
     {
       cselib_val *val = cselib_lookup (x, GET_MODE (x), 0);
       struct elt_loc_list *l;

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]