[avr] Fix broken stack-usage-1.c test

Submitted by Senthil Kumar Selvaraj on June 8, 2016, 11:20 a.m.

Details

Message ID 87pors2ag7.fsf@atmel.com
State New
Headers show

Commit Message

Senthil Kumar Selvaraj June 8, 2016, 11:20 a.m.
Hi,

  A recent patch I submitted fixed broken -fstack-usage for the avr
  target, by including the size of the return address pushed to the stack
  (https://gcc.gnu.org/ml/gcc-patches/2016-05/msg01715.html).

  I forgot to send this testcase modification with that patch - here's
  the fix for making gcc.dg/stack-usage-1.c pass again for avr.

  If this is ok, could someone commit please? I don't have commit
  access.

Regards
Senthil

gcc/testsuite/ChangeLog

2016-06-08  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/stack-usage-1.c (SIZE): Consider return address
  when setting SIZE.

Comments

Mike Stump June 9, 2016, 2:33 p.m.
On Jun 8, 2016, at 4:20 AM, Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> wrote:
> 
>  I forgot to send this testcase modification with that patch - here's
>  the fix for making gcc.dg/stack-usage-1.c pass again for avr.
> 
>  If this is ok, could someone commit please? I don't have commit
>  access.

Ok.

Committed revision 237266.

> 2016-06-08  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
> 
> 	* gcc.dg/stack-usage-1.c (SIZE): Consider return address
>  when setting SIZE.

Patch hide | download patch | download mbox

diff --git gcc/testsuite/gcc.dg/stack-usage-1.c gcc/testsuite/gcc.dg/stack-usage-1.c
index 7864c6a..bdc5656 100644
--- gcc/testsuite/gcc.dg/stack-usage-1.c
+++ gcc/testsuite/gcc.dg/stack-usage-1.c
@@ -64,7 +64,11 @@ 
 #    define SIZE 240
 #  endif
 #elif defined (__AVR__)
-#  define SIZE 254
+#if defined (__AVR_3_BYTE_PC__ )
+#  define SIZE 251 /* 256 - 2 bytes for Y - 3 bytes for return address */
+#else
+#  define SIZE 252 /* 256 - 2 bytes for Y - 2 bytes for return address */
+#endif
 #elif defined (__s390x__)
 #  define SIZE 96  /* 256 - 160 bytes for register save area */
 #elif defined (__s390__)