Commit 079f1420 by Senthil Kumar Selvaraj Committed by Denis Chertykov

re PR target/60991 ([avr] Stack corruption when using 24-bit integers __int24 or…

re PR target/60991 ([avr] Stack corruption when using 24-bit integers __int24 or __memx pointers in large stack frame)

gcc/ChangeLog

	PR target/60991
	* config/avr/avr.c (avr_out_store_psi): Use correct constant
	to restore Y.

gcc/testsuite/ChangeLog

	PR target/60991
	* gcc.target/avr/pr60991.c: New testcase.

From-SVN: r210325
parent c7ae26aa
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.
2014-05-12 Georg-Johann Lay <avr@gjlay.de> 2014-05-12 Georg-Johann Lay <avr@gjlay.de>
* config/arm/arm.h (License): Add GCC Runtime Library Exception. * config/arm/arm.h (License): Add GCC Runtime Library Exception.
......
...@@ -3999,7 +3999,7 @@ avr_out_store_psi (rtx insn, rtx *op, int *plen) ...@@ -3999,7 +3999,7 @@ avr_out_store_psi (rtx insn, rtx *op, int *plen)
"std Y+61,%A1" CR_TAB "std Y+61,%A1" CR_TAB
"std Y+62,%B1" CR_TAB "std Y+62,%B1" CR_TAB
"std Y+63,%C1" 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 return avr_asm_len ("subi r28,lo8(-%o0)" CR_TAB
"sbci r29,hi8(-%o0)" CR_TAB "sbci r29,hi8(-%o0)" CR_TAB
......
2014-05-12 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
PR target/60991
* gcc.target/avr/pr60991.c: New testcase.
2014-05-12 Paolo Carlini <paolo.carlini@oracle.com> 2014-05-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60054 PR c++/60054
......
/* { 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment