This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, avr] Fix broken stack-usage-1.c test
- From: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Mike Stump <mikestump at comcast dot net>, Jeff Law <law at redhat dot com>
- Date: Wed, 8 Jun 2016 16:50:56 +0530
- Subject: [Patch, avr] Fix broken stack-usage-1.c test
- Authentication-results: sourceware.org; auth=none
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.
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__)