This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/23453] [4.0/4.1 regression] miscompilation of PARI/GP on x86 with gcse after reload
- From: "belyshev at depni dot sinp dot msu dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Aug 2005 19:51:18 -0000
- Subject: [Bug rtl-optimization/23453] [4.0/4.1 regression] miscompilation of PARI/GP on x86 with gcse after reload
- References: <20050818072512.23453.debian-gcc@lists.debian.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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