This is the mail archive of the gcc-bugs@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]

[Bug rtl-optimization/23453] [4.0/4.1 regression] miscompilation of PARI/GP on x86 with gcse after reload


------- Additional Comments From belyshev at depni dot sinp dot msu dot ru  2005-08-19 19:51 -------
gcse after reload may move loads from stack around stack pointer changes. here
is simple workaround, it is supposed to prevent gcse after reload from touching
expressions containing stack pointer at all.

Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.359
diff -u -r1.359 cse.c
--- cse.c	29 Jul 2005 05:57:37 -0000	1.359
+++ cse.c	19 Aug 2005 19:33:49 -0000
@@ -2221,6 +2221,14 @@
 		return 0;
 	      }
 	  }
+	else
+	  {
+	    if (x == stack_pointer_rtx)
+	      {
+		*do_not_record_p = 1;
+		return 0;
+	      }
+	  }
 
 	hash += ((unsigned int) REG << 7);
         hash += (have_reg_qty ? (unsigned) REG_QTY (regno) : regno);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23453


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