This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Fix gcc.dg/sibcall-[34].c. (take 2)
Hi Richard and HP,
> > The patch fixes the problem by making all functions extern to prevent
> > inlining.
>
> This does not prevent inlining. Use attribute noinline instead.
OK. Please find a revised version below.
Tested on h8300-elf. OK to apply?
Kazu Hirata
2004-02-28 Kazu Hirata <kazu@cs.umass.edu>
* gcc.dg/sibcall-3.c (recurser_void1): Make it an extern
function with __attribute__((noinline)).
(recurser_void2): Likewise.
* gcc.dg/sibcall-4.c (recurser_void1): Likewise.
(recurser_void2): Likewise.
Index: sibcall-3.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/sibcall-3.c,v
retrieving revision 1.3
diff -u -r1.3 sibcall-3.c
--- sibcall-3.c 4 Feb 2004 05:13:42 -0000 1.3
+++ sibcall-3.c 28 Feb 2004 18:44:08 -0000
@@ -13,8 +13,8 @@
(except targets where the test does not work due to the return address
not saved on the regular stack). */
-static void recurser_void1 (int);
-static void recurser_void2 (int);
+extern void recurser_void1 (int);
+extern void recurser_void2 (int);
extern void track (int);
int main ()
@@ -27,7 +27,7 @@
reasonably sure is to make them have the same contents (regarding the
n tests). */
-static void
+void __attribute__((noinline))
recurser_void1 (int n)
{
if (n == 0 || n == 7 || n == 8)
@@ -39,7 +39,7 @@
recurser_void2 (n + 1);
}
-static void
+void __attribute__((noinline))
recurser_void2 (int n)
{
if (n == 0 || n == 7 || n == 8)
Index: sibcall-4.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/sibcall-4.c,v
retrieving revision 1.3
diff -u -r1.3 sibcall-4.c
--- sibcall-4.c 4 Feb 2004 05:13:42 -0000 1.3
+++ sibcall-4.c 28 Feb 2004 18:44:08 -0000
@@ -13,8 +13,8 @@
(except targets where the test does not work due to the return address
not saved on the regular stack). */
-static void recurser_void1 (void);
-static void recurser_void2 (void);
+extern void recurser_void1 (void);
+extern void recurser_void2 (void);
extern void track (void);
int n = 0;
@@ -28,7 +28,7 @@
reasonably sure is to make them have the same contents (regarding the
n tests). */
-static void
+void __attribute__((noinline))
recurser_void1 (void)
{
if (n == 0 || n == 7 || n == 8)
@@ -40,7 +40,7 @@
recurser_void2 ();
}
-static void
+void __attribute__((noinline))
recurser_void2 (void)
{
if (n == 0 || n == 7 || n == 8)