Commit 4d097718 by Jan Hubicka Committed by Jan Hubicka

990208-1.c: Add noinline attributes as needed.

	* gcc.c-torture/execute/990208-1.c:  Add noinline attributes as needed.
	* gcc.c-torture/execute/eeprof-1.c:  Likewise.
	* gcc.c-torture/execute/stdio-opt-*.c: Likewise.
	* gcc.c-torture/execute/string-opt-*.c: Likewise.

From-SVN: r61563
parent 5c64ead4
Tue Jan 21 18:01:35 CET 2003 Jan Hubicka <jh@suse.cz>
* gcc.c-torture/execute/990208-1.c: Add noinline attributes as needed.
* gcc.c-torture/execute/eeprof-1.c: Likewise.
* gcc.c-torture/execute/stdio-opt-*.c: Likewise.
* gcc.c-torture/execute/string-opt-*.c: Likewise.
2003-01-20 Nick Clifton <nickc@redhat.com> 2003-01-20 Nick Clifton <nickc@redhat.com>
* gcc.c-torture/execute/20030117-1.c: New test case. Exposes * gcc.c-torture/execute/20030117-1.c: New test case. Exposes
......
...@@ -14,16 +14,19 @@ static __inline__ void doit(void **pptr, int cond) ...@@ -14,16 +14,19 @@ static __inline__ void doit(void **pptr, int cond)
} }
} }
__attribute__ ((noinline))
static void f(int cond) static void f(int cond)
{ {
doit (&ptr1, cond); doit (&ptr1, cond);
} }
__attribute__ ((noinline))
static void g(int cond) static void g(int cond)
{ {
doit (&ptr2, cond); doit (&ptr2, cond);
} }
__attribute__ ((noinline))
static void bar(void); static void bar(void);
int main() int main()
......
...@@ -5,13 +5,16 @@ int entry_calls, exit_calls; ...@@ -5,13 +5,16 @@ int entry_calls, exit_calls;
void (*last_fn_entered)(); void (*last_fn_entered)();
void (*last_fn_exited)(); void (*last_fn_exited)();
__attribute__ ((noinline))
int main () NOCHK; int main () NOCHK;
__attribute__ ((noinline))
void foo () void foo ()
{ {
ASSERT (last_fn_entered == foo); ASSERT (last_fn_entered == foo);
} }
__attribute__ ((noinline))
static void foo2 () static void foo2 ()
{ {
ASSERT (entry_calls == 1 && exit_calls == 0); ASSERT (entry_calls == 1 && exit_calls == 0);
...@@ -22,6 +25,7 @@ static void foo2 () ...@@ -22,6 +25,7 @@ static void foo2 ()
ASSERT (last_fn_exited == foo); ASSERT (last_fn_exited == foo);
} }
__attribute__ ((noinline))
void nfoo (void) NOCHK; void nfoo (void) NOCHK;
void nfoo () void nfoo ()
{ {
...@@ -55,11 +59,13 @@ int main () ...@@ -55,11 +59,13 @@ int main ()
void __cyg_profile_func_enter (void (*fn)(), void (*parent)()) NOCHK; void __cyg_profile_func_enter (void (*fn)(), void (*parent)()) NOCHK;
void __cyg_profile_func_exit (void (*fn)(), void (*parent)()) NOCHK; void __cyg_profile_func_exit (void (*fn)(), void (*parent)()) NOCHK;
__attribute__ ((noinline))
void __cyg_profile_func_enter (void (*fn)(), void (*parent)()) void __cyg_profile_func_enter (void (*fn)(), void (*parent)())
{ {
entry_calls++; entry_calls++;
last_fn_entered = fn; last_fn_entered = fn;
} }
__attribute__ ((noinline))
void __cyg_profile_func_exit (void (*fn)(), void (*parent)()) void __cyg_profile_func_exit (void (*fn)(), void (*parent)())
{ {
exit_calls++; exit_calls++;
......
/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> 2002-05-27. */ /* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> 2002-05-27. */
/* Use a different function for each test so the link failures /* Use a different function for each test so the link failures
......
...@@ -58,6 +58,7 @@ int main() ...@@ -58,6 +58,7 @@ int main()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static int static int
fputs(const char *string, FILE *stream) fputs(const char *string, FILE *stream)
{ {
......
...@@ -45,6 +45,7 @@ int main() ...@@ -45,6 +45,7 @@ int main()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static int static int
printf (const char *string, ...) printf (const char *string, ...)
{ {
......
...@@ -57,6 +57,7 @@ int main() ...@@ -57,6 +57,7 @@ int main()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static int static int
fprintf (FILE *stream, const char *string, ...) fprintf (FILE *stream, const char *string, ...)
{ {
......
...@@ -37,6 +37,7 @@ int main() ...@@ -37,6 +37,7 @@ int main()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static char * static char *
strstr(const char *s1, const char *s2) strstr(const char *s1, const char *s2)
{ {
......
...@@ -76,6 +76,7 @@ int main () ...@@ -76,6 +76,7 @@ int main ()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static char * static char *
strncat (char *s1, const char *s2, size_t n) strncat (char *s1, const char *s2, size_t n)
{ {
......
...@@ -58,6 +58,7 @@ int main () ...@@ -58,6 +58,7 @@ int main ()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static size_t static size_t
strspn (const char *s1, const char *s2) strspn (const char *s1, const char *s2)
{ {
......
...@@ -58,6 +58,7 @@ int main () ...@@ -58,6 +58,7 @@ int main ()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static size_t static size_t
strcspn (const char *s1, const char *s2) strcspn (const char *s1, const char *s2)
{ {
......
...@@ -49,6 +49,7 @@ main () ...@@ -49,6 +49,7 @@ main ()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static size_t static size_t
strlen (const char *s) strlen (const char *s)
{ {
......
...@@ -25,12 +25,14 @@ main () ...@@ -25,12 +25,14 @@ main ()
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static void * static void *
memset (void *s, int c, size_t n) memset (void *s, int c, size_t n)
{ {
abort (); abort ();
} }
__attribute__ ((noinline))
static void * static void *
memcpy (void *dest, const void *src, size_t n) memcpy (void *dest, const void *src, size_t n)
{ {
......
...@@ -37,6 +37,7 @@ main () ...@@ -37,6 +37,7 @@ main ()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static int static int
memcmp (const char *p1, const char *p2, size_t len) memcmp (const char *p1, const char *p2, size_t len)
{ {
......
...@@ -28,6 +28,7 @@ main (int argc) ...@@ -28,6 +28,7 @@ main (int argc)
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static int static int
memcmp (const void *s1, const void *s2, size_t len) memcmp (const void *s1, const void *s2, size_t len)
{ {
...@@ -36,6 +37,7 @@ memcmp (const void *s1, const void *s2, size_t len) ...@@ -36,6 +37,7 @@ memcmp (const void *s1, const void *s2, size_t len)
#else #else
/* When not optimizing, the above tests may generate references to /* When not optimizing, the above tests may generate references to
the function link_error, but should never actually call it. */ the function link_error, but should never actually call it. */
__attribute__ ((noinline))
static void static void
link_error () link_error ()
{ {
......
...@@ -40,6 +40,7 @@ main (int argc) ...@@ -40,6 +40,7 @@ main (int argc)
/* When optimizing, most of the above cases should be transformed into /* When optimizing, most of the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
for short lengths should abort. */ for short lengths should abort. */
__attribute__ ((noinline))
static void * static void *
memset (void *dst, int c, size_t len) memset (void *dst, int c, size_t len)
{ {
......
...@@ -46,6 +46,7 @@ int main() ...@@ -46,6 +46,7 @@ int main()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static char * static char *
strpbrk(const char *s1, const char *s2) strpbrk(const char *s1, const char *s2)
{ {
......
...@@ -104,18 +104,21 @@ rindex (const char *s, int c) ...@@ -104,18 +104,21 @@ rindex (const char *s, int c)
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static __SIZE_TYPE__ static __SIZE_TYPE__
strlen (const char *s) strlen (const char *s)
{ {
abort (); abort ();
} }
__attribute__ ((noinline))
static int static int
strcmp (const char *s1, const char *s2) strcmp (const char *s1, const char *s2)
{ {
abort (); abort ();
} }
__attribute__ ((noinline))
static char * static char *
strrchr (const char *s, int c) strrchr (const char *s, int c)
{ {
......
...@@ -53,6 +53,7 @@ index (const char *s, int c) ...@@ -53,6 +53,7 @@ index (const char *s, int c)
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static char * static char *
strchr (const char *s, int c) strchr (const char *s, int c)
{ {
......
...@@ -45,6 +45,7 @@ int main() ...@@ -45,6 +45,7 @@ int main()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static char * static char *
strcpy (char *d, const char *s) strcpy (char *d, const char *s)
{ {
......
...@@ -69,6 +69,7 @@ int main () ...@@ -69,6 +69,7 @@ int main ()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static char * static char *
strncpy(char *s1, const char *s2, size_t n) strncpy(char *s1, const char *s2, size_t n)
{ {
......
...@@ -231,6 +231,7 @@ int main () ...@@ -231,6 +231,7 @@ int main ()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static int static int
strncmp(const char *s1, const char *s2, size_t n) strncmp(const char *s1, const char *s2, size_t n)
{ {
......
...@@ -46,6 +46,7 @@ int main () ...@@ -46,6 +46,7 @@ int main ()
/* When optimizing, all the above cases should be transformed into /* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function something else. So any remaining calls to the original function
should abort. */ should abort. */
__attribute__ ((noinline))
static char * static char *
strcat (char *s1, const char *s2) strcat (char *s1, const char *s2)
{ {
......
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