This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[backport,avr,47] Apply fix for PR60991
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Denis Chertykov <chertykov at gmail dot com>, Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- Date: Tue, 20 May 2014 10:49:16 +0200
- Subject: [backport,avr,47] Apply fix for PR60991
- Authentication-results: sourceware.org; auth=none
Backportet the fix for PR60991 also to 4.7 so that the issue can be closed:
http://gcc.gnu.org/r210635
Johann
gcc/
2014-05-20 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Backport from mainline r210325
2014-05-12 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
PR target/60991
* config/avr/avr.c (avr_out_store_psi): Use correct constant
to restore Y.
gcc/testsuite/
2014-05-20 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Backport from mainline r210325
2014-05-12 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
PR target/60991
* gcc.target/avr/pr60991.c: New testcase.
Index: config/avr/avr.c
===================================================================
--- config/avr/avr.c (revision 210633)
+++ config/avr/avr.c (working copy)
@@ -3643,7 +3643,7 @@ avr_out_store_psi (rtx insn, rtx *op, in
"std Y+61,%A1" CR_TAB
"std Y+62,%B1" CR_TAB
"std Y+63,%C1" CR_TAB
- "sbiw r28,%o0-60", op, plen, -5);
+ "sbiw r28,%o0-61", op, plen, -5);
return avr_asm_len ("subi r28,lo8(-%o0)" CR_TAB
"sbci r29,hi8(-%o0)" CR_TAB
Index: testsuite/gcc.target/avr/pr60991.c
===================================================================
--- testsuite/gcc.target/avr/pr60991.c (revision 0)
+++ testsuite/gcc.target/avr/pr60991.c (revision 0)
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+/* This testcase (simplified from the original bug report) exposes
+ PR60991. The code generated for writing the __int24 value corrupts
+ the frame pointer if the offset is <= 63 + MAX_LD_OFFSET */
+
+#include <stdlib.h>
+
+int main(void)
+{
+ volatile char junk[62];
+ junk[0] = 5;
+ volatile __int24 staticConfig = 0;
+
+ if (junk[0] != 5)
+ abort();
+
+ exit(0);
+ return 0;
+}