diff options
Diffstat (limited to 'gcc-4.4.3/gcc/testsuite/gcc.dg')
43 files changed, 633 insertions, 24 deletions
diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/always_inline2.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/always_inline2.c index c65df24ea..3e5e2a3fd 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/always_inline2.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/always_inline2.c @@ -1,8 +1,8 @@ /* { dg-do compile } */ /* { dg-options "-Winline -O2" } */ -inline __attribute__ ((always_inline)) void t(void); /* { dg-message "sorry\[^\n\]*body not available" "" } */ +inline __attribute__ ((always_inline)) void t(void); /* { dg-message "error\[^\n\]*body not available" "" } */ void q(void) { - t(); /* { dg-message "sorry\[^\n\]*called from here" "" } */ + t(); /* { dg-message "error\[^\n\]*called from here" "" } */ } diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/always_inline3.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/always_inline3.c index 97c80aa52..d754d7194 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/always_inline3.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/always_inline3.c @@ -2,10 +2,10 @@ /* { dg-options "-Winline -O2" } */ int do_something_evil (void); inline __attribute__ ((always_inline)) void -q2(void) /* { dg-message "sorry\[^\n\]*recursive" "" } */ +q2(void) /* { dg-message "error\[^\n\]*recursive" "" } */ { if (do_something_evil ()) return; - q2(); /* { dg-message "sorry\[^\n\]*called from here" "" } */ + q2(); /* { dg-message "error\[^\n\]*called from here" "" } */ q2(); /* With -O2 we don't warn here, it is eliminated by tail recursion. */ } diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/always_inline4.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/always_inline4.c new file mode 100644 index 000000000..723ff97ac --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/always_inline4.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +/* If f3() is inlined the impossible-to-resolve situation of a cycle + of always_inlined functions is created in the call graph. This + test tests whether this condition is detected and avoided. */ + +inline void f1(int); +inline void f2(int); +inline void f3(int); + +inline void __attribute__((__always_inline__)) f1(int a) { + f3(a); + f3(a); +} + +inline void __attribute__((__always_inline__)) f2(int a) { + f1(a); +} + +inline void f3(int a) { + f2(a); +} diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/autopar/reduc-1.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/autopar/reduc-1.c index ac08d3d2e..1cafaecd2 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/autopar/reduc-1.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/autopar/reduc-1.c @@ -12,7 +12,7 @@ unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; /* Reduction of unsigned-int. */ -void main1 (unsigned int x, unsigned int max_result, unsigned int min_result) +void __attribute__((noinline)) main1 (unsigned int x, unsigned int max_result, unsigned int min_result) { int i; unsigned int udiff = 2; diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/builtin-apply2.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/builtin-apply2.c index bc49a6458..a303e3ddb 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/builtin-apply2.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/builtin-apply2.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { "avr-*-*" } { "*" } { "" } } */ +/* { dg-skip-if "Variadic funcs use Base AAPCS. Normal funcs use VFP variant." { "arm*-*-*" } { "-mfloat-abi=hard" } { "" } } */ /* PR target/12503 */ /* Origin: <pierre.nguyen-tuong@asim.lip6.fr> */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/ipa/ipa-4.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/ipa/ipa-4.c index 9f716f139..02efb7b4e 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/ipa/ipa-4.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/ipa/ipa-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp" } */ +/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp --param inline-address-not-taken-function-emit-probability=100 --param inline-function-size-adjustment=0" } */ /* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ #include <stdio.h> diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn2.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn2.c new file mode 100644 index 000000000..7cfb0718b --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn2.c @@ -0,0 +1,47 @@ +/* This checks if cloning works correctly. Since dispatch and fn1 are hot, they + should be cloned. main should not be cloned.*/ + +/* { dg-do run } */ +/* { dg-options "-O2 -fclone-hot-version-paths -fdump-tree-final_cleanup" } */ + +int __attribute__ ((version_selector)) +featureTest () +{ + return 1; +} + +int __attribute__ ((cold)) +foo () +{ + return 0; +} + +int __attribute__ ((cold)) +bar () +{ + return 1; +} + +int __attribute__ ((hot)) +dispatch () +{ + return __builtin_dispatch (featureTest, (void *)foo, (void *) bar); +} +int __attribute__ ((hot)) +fn1 () +{ + return dispatch (); +} + +int __attribute__ ((cold)) +main () +{ + return fn1 (); +} + +/* { dg-final { scan-tree-dump "fn1_clone_1" "final_cleanup" } } */ +/* { dg-final { scan-tree-dump "dispatch_clone_0" "final_cleanup" } } */ +/* { dg-final { scan-tree-dump "dispatch_clone_1" "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-not "main_clone_0" "final_cleanup" } } */ +/* { dg-final { scan-tree-dump-not "main_clone_1" "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn3.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn3.c new file mode 100644 index 000000000..5085aa924 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn3.c @@ -0,0 +1,30 @@ +/* Simple check if parameters are passed correctly. */ + +/* { dg-do run } */ +/* { dg-options "-O2 -fclone-hot-version-paths" } */ + +int __attribute__ ((version_selector)) +featureTest () +{ + return 1; +} + +int __attribute__ ((cold)) +foo (int a) +{ + if (a == 1729) + return 0; + return 1; +} + +int __attribute__ ((cold)) +bar (int a) +{ + return 1; +} + +int __attribute__ ((cold)) +main () +{ + return __builtin_dispatch (featureTest, (void *)foo, (void *) bar, 1729); +} diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn4.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn4.c new file mode 100644 index 000000000..cd916c981 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn4.c @@ -0,0 +1,29 @@ +/* Check that static feature test functions are correctly handled. This + test case also needs mversn4a.c. extern_func calls foo and returns 0.*/ + +/* { dg-do run } */ +/* { dg-additional-sources "mversn4a.c" } */ +/* { dg-options "-O2" } */ + +#include "mversn4.h" + +extern int extern_func (); + +int foo () +{ + return 0; +} + +int bar () +{ + return 1; +} + +int __attribute__ ((cold)) +main () +{ + int a = 1, b = 1; + a = extern_func (); + b = __builtin_dispatch (featureTest, (void *)bar, (void *) foo); + return a * b; +} diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn4.h b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn4.h new file mode 100644 index 000000000..37067d37f --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn4.h @@ -0,0 +1,5 @@ +static int __attribute__ ((version_selector)) +featureTest () +{ + return 1; +} diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn4a.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn4a.c new file mode 100644 index 000000000..92d4f1240 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn4a.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#include "mversn4.h" + +extern int foo (); +extern int bar (); + + +int extern_func () +{ + return __builtin_dispatch (featureTest, (void *)foo, (void *) bar); +} diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn6.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn6.c new file mode 100644 index 000000000..e83e35165 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn6.c @@ -0,0 +1,29 @@ +/* Check that __builtin_dispatch gets converted and the executable runs fine. + when featureTest () is not marked with "version_selector". foo should be + called and return 0. Cloning and Hoisting is also done. */ +/* { dg-do run } */ +/* { dg-options "-O2 -fclone-hot-version-paths" } */ + +int +featureTest () +{ + return 1; +} + +int __attribute__ ((cold)) +foo () +{ + return 0; +} + +int __attribute__ ((cold)) +bar () +{ + return 1; +} + +int __attribute__ ((cold)) +main () +{ + return __builtin_dispatch (featureTest, (void *)foo, (void *) bar); +} diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn7.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn7.c new file mode 100644 index 000000000..f56331cf0 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/mversn7.c @@ -0,0 +1,45 @@ +/* This test checks if cloning and dispatching works correctly with + a motivating example. The function problem calculates the sum of + numbers from 1 to 10 in two different ways. Hence, after cloning + both clones should return 55, which means main returns 0 if function + "problem" gets inlined. + This example also shows the benefits of function + unswitching. Without cloning, the loop will be done. */ + +/* { dg-do run } */ +/* { dg-options "-O2 -fclone-hot-version-paths -fdump-tree-final_cleanup" } */ + +int __attribute__ ((version_selector)) +featureTest () +{ + return 1; +} + +int foo (int i) +{ + return i; +} + +int bar (int i) +{ + return (11 - i); +} + +/* This calculates the sum of numbers from 1 to 10 in 2 different ways. */ +int problem () +{ + int ret = 0; + int j = 1; + for (j = 1; j<=10; j++) + ret += __builtin_dispatch (featureTest, (void *)foo, (void *)bar, j); + return ret; +} + +int main () +{ + return problem() - 55; +} + + +/* { dg-final { scan-tree-dump "return 55" "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/nrv6.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/nrv6.c new file mode 100644 index 000000000..0fde6b3e4 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/nrv6.c @@ -0,0 +1,22 @@ +/* Verify that changing to -O0 after a candidate for NRV optimization + does not cause ICE. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +struct A { + int i; +}; + +struct A foo (int i) +{ + struct A a; + a.i = i; + return a; +} + +#pragma GCC optimize("-O0") + +int test(void) +{ + return 0; +} diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay1.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay1.c new file mode 100644 index 000000000..a87dfa415 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay1.c @@ -0,0 +1,70 @@ +/* Check that store sinking does not break stack overlay */ +/* { dg-do run } */ +/* { dg-options "-O2 -fearly-stack-alloc" } */ + +extern void abort (void); + +struct a; + +typedef void (*func_t)(struct a*); + +struct a { + func_t impl; +}; + +struct b { + struct a base; +}; + +void +a_impl (struct a *const this) +{ + abort(); +} + +void +b_impl (struct a * const this) +{ +} + +void __attribute__((noinline)) +a_interface (struct a * const this) +{ + this->impl(this); +} + +int +main(int argc, char **argv) +{ + { + struct b obj1; + +L1: + if (argc > 400) + return 0; + obj1.base.impl = b_impl; + +L2: + a_interface (&obj1.base); + obj1.base.impl = b_impl; + obj1.base.impl = a_impl; + if (argc > 200) + return 0; + } + { + struct b obj2; + obj2.base.impl = a_impl; + +L3: + obj2.base.impl = b_impl; + if (argc > 100) + return 0; + +L4: + a_interface (&obj2.base); + obj2.base.impl = b_impl; + obj2.base.impl = a_impl; + } + + return 0; +} diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay2.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay2.c new file mode 100644 index 000000000..acd30282f --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay2.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fearly-stack-alloc -fstack-protector -fno-strict-aliasing -fdump-tree-stack-overlay" } */ +void bar (char *); +void bar2 (int *); +void foo () + { + { + char a[100]; + bar (a); + } + { + int a[100]; + bar2 (a); + } + } + +/* { dg-final { scan-tree-dump "Number of partitions = 2" "stack-overlay" } } */ +/* { dg-final { cleanup-tree-dump "stack-overlay" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay3.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay3.c new file mode 100644 index 000000000..c7218f4f2 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay3.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fearly-stack-alloc -fno-strict-aliasing -fdump-tree-stack-overlay" } */ +void bar (char *); +void bar2 (int *); +void foo () + { + { + char a[100]; + bar (a); + } + { + int a[100]; + bar2 (a); + } + } + +/* { dg-final { scan-tree-dump "Number of partitions = 1" "stack-overlay" } } */ +/* { dg-final { cleanup-tree-dump "stack-overlay" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay4.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay4.c new file mode 100644 index 000000000..8dfc49946 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay4.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fearly-stack-alloc -fno-strict-aliasing -fdump-tree-stack-overlay" } */ +union U { + int a; + float b; +}; +struct A { + union U u1; + char a[100]; +}; +void bar (struct A *); +void foo () + { + { + struct A a; + bar (&a); + } + { + struct A a; + bar (&a); + } + } + +/* { dg-final { scan-tree-dump "Number of partitions = 1" "stack-overlay" } } */ +/* { dg-final { cleanup-tree-dump "stack-overlay" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay5.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay5.c new file mode 100644 index 000000000..a815f23f3 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/overlay5.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fearly-stack-alloc -fno-strict-aliasing -fdump-tree-stack-overlay" } */ +void bar( char *); +int foo() +{ + int i=0; + { + char a[8192]; + bar(a); + i += a[0]; + } + { + char a[8192]; + char b[32]; + bar(a); + i += a[0]; + bar(b); + i += a[0]; + } + return i; +} +/* { dg-final { scan-tree-dump "Number of partitions = 2" "stack-overlay" } } */ +/* { dg-final { scan-tree-dump "size 8192" "stack-overlay" } } */ +/* { dg-final { scan-tree-dump "size 32" "stack-overlay" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/pr43564.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/pr43564.c new file mode 100644 index 000000000..39e0f3ac3 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/pr43564.c @@ -0,0 +1,16 @@ +/* { dg-options "-O0" } */ +/* { dg-do compile } */ + +static inline __attribute__ ((__always_inline__)) +unsigned __clz (unsigned input) +{ + unsigned output; + __asm__ __volatile__ ("clz %0, %1":"=r" (output):"r" (input)); +} +__attribute__ ((optimize ("O2"))) +void foo () +{ + unsigned a; + unsigned b; + a = __clz (b); +} diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-1.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-1.c index 4521ace9e..0941db704 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-1.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-1.c @@ -5,7 +5,7 @@ Contributed by Hans-Peter Nilsson <hp@bitrange.com> */ /* { dg-do run } */ -/* { dg-options "-O2 -foptimize-sibling-calls" } */ +/* { dg-options "-O2 -foptimize-sibling-calls -fno-inline" } */ /* The option -foptimize-sibling-calls is the default, but serves as marker. Self-recursion tail calls are optimized for all targets, diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-2.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-2.c index 4c226c496..b5ca942ef 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-2.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-2.c @@ -5,7 +5,7 @@ Contributed by Hans-Peter Nilsson <hp@bitrange.com> */ /* { dg-do run } */ -/* { dg-options "-O2 -foptimize-sibling-calls" } */ +/* { dg-options "-O2 -foptimize-sibling-calls -fno-inline" } */ /* The option -foptimize-sibling-calls is the default, but serves as marker. Self-recursion tail calls are optimized for all targets, diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-3.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-3.c index e085bfbc7..51f1b0b92 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-3.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-3.c @@ -28,7 +28,7 @@ extern void exit (int); static ATTR void recurser_void1 (int); static ATTR void recurser_void2 (int); -extern void track (int); +static ATTR void track (int); int main () { @@ -66,7 +66,7 @@ recurser_void2 (int n) void *trackpoint; -void +static void __attribute__((noinline)) ATTR track (int n) { char stackpos[1]; diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-4.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-4.c index 11b09d079..cd185d47b 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-4.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-4.c @@ -28,7 +28,7 @@ extern void exit (int); static ATTR void recurser_void1 (void); static ATTR void recurser_void2 (void); -extern void track (void); +static ATTR void track (void); int n = 0; int main () @@ -67,7 +67,7 @@ recurser_void2 (void) void *trackpoint; -void +static void __attribute__((noinline)) ATTR track () { char stackpos[1]; diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-6.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-6.c index 6f2f21881..24e5ae7af 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-6.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/sibcall-6.c @@ -27,7 +27,7 @@ main () exit (0); } -int +int __attribute__((noinline)) bar (b) int b; { @@ -37,7 +37,7 @@ bar (b) abort (); } -int +int __attribute__((noinline)) foo (f) int f; { diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/torture/mversn1.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/torture/mversn1.c new file mode 100644 index 000000000..bd024065c --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/torture/mversn1.c @@ -0,0 +1,31 @@ +/* Check that __builtin_dispatch gets converted and the executable runs fine. + Since featureTest () returns 1, foo should be called and return 0. Cloning + and Hoisting is not even turned on here. */ +/* { dg-do run } */ + +int __attribute__ ((version_selector)) +featureTest () +{ + return 1; +} + +int __attribute__ ((cold)) +foo () +{ + return 0; +} + +int __attribute__ ((cold)) +bar () +{ + return 1; +} + +int __attribute__ ((cold)) +main () +{ + int a, b; + a = __builtin_dispatch (featureTest, (void *)foo, (void *) bar); + b = __builtin_dispatch (featureTest, (void *)bar, (void *) foo); + return a * b; +} diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c index 8b0ff4aff..28dc6106d 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c @@ -1,6 +1,5 @@ /* PR tree-optimization/20076 */ /* { dg-do run } */ -/* { dg-xfail-run-if "b/2070963" { { i?86-*-* x86_64-*-* } && { ilp32 } } { "*" } { "" } } */ extern void abort (void); diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp b/gcc-4.4.3/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp index 3574e4dc8..ef45dbe4d 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp @@ -28,6 +28,7 @@ set additional_flags "" if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then { lappend additional_flags "-mstackrealign" lappend additional_flags "-mpreferred-stack-boundary=5" + lappend additional_flags "-mno-mmx" } dg-init diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-1.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-1.c new file mode 100644 index 000000000..ff93852c3 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-1.c @@ -0,0 +1,14 @@ +/* { dg-options "-lm -ffvpt -ffvpt-functions=log,exp,pow,sqrt -O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */ + +#define VAL 1.0 + +#include "ffvpt-pro.h" + +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(exp\\) to constant value: 1.000000 in main \\(use 2.718282\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(pow\\) with constant argument \\(1.000000\\) optimized in main: \\(count:1000, all:1000\\)" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(log\\) to constant value: 1.000000 in main \\(use 0.000000\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(sqrt\\) to constant value: 1.000000 in main \\(use 1.000000\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ + +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ +/* { dg-final-use { cleanup-tree-dump "tree_profile" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-2.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-2.c new file mode 100644 index 000000000..17da95071 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-2.c @@ -0,0 +1,14 @@ +/* { dg-options "-lm -ffvpt -ffvpt-functions=log,exp,pow,sqrt -O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */ + +#define VAL (1.0/0.0) + +#include "ffvpt-pro.h" + +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(exp\\) to constant value: inf in main \\(use inf\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump-not "Math call \\(pow\\) with constant argument" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(log\\) to constant value: inf in main \\(use inf\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(sqrt\\) to constant value: inf in main \\(use inf\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ + +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ +/* { dg-final-use { cleanup-tree-dump "tree_profile" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-3.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-3.c new file mode 100644 index 000000000..5f2a57d31 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-3.c @@ -0,0 +1,14 @@ +/* { dg-options "-lm -ffvpt -ffvpt-functions=log,exp,pow,sqrt -O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */ + +#define VAL (-1.0/0.0) + +#include "ffvpt-pro.h" + +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(exp\\) to constant value: -inf in main \\(use 0.000000\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump-not "Math call \\(pow\\) with constant argument optimized" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(log\\) to constant value: -inf in main \\(use -?nan\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(sqrt\\) to constant value: -inf in main \\(use -?nan\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ + +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ +/* { dg-final-use { cleanup-tree-dump "tree_profile" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-4.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-4.c new file mode 100644 index 000000000..653a485c2 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro-4.c @@ -0,0 +1,13 @@ +/* { dg-options "-lm -ffvpt -ffvpt-functions=log,exp,pow,sqrt -O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */ + +#define VAL (0.0 / 0.0) /* NAN */ + +#include "ffvpt-pro.h" + +/* { dg-final-use { scan-tree-dump "Math call \\(exp\\) to constant value: nan in main \\(use nan\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump-not "Math call \\(pow\\) with constant argument optimized" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(log\\) to constant value: nan in main \\(use nan\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump "Math call \\(sqrt\\) to constant value: nan in main \\(use nan\\) \\(count:1000, all:1000\\)" "tree_profile"} } */ + +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ +/* { dg-final-use { cleanup-tree-dump "tree_profile" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro.h b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro.h new file mode 100644 index 000000000..182bc48d8 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/ffvpt-pro.h @@ -0,0 +1,17 @@ +#include <math.h> + +double d = VAL; +double s = 0.0; + +int main (void) +{ + int i; + for (i = 0; i < 1000; i++) + { + s += exp(d); + s += pow(d, d); + s += log(d); + s += sqrt(d); + } + return 0; +} diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c index 8d7c87919..bd1e2c645 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c @@ -1,4 +1,4 @@ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fdump-tree-optimized --param inline-address-not-taken-function-emit-probability=100 --param inline-function-size-adjustment=0" } */ int a; int b[100]; void abort (void); diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/alias_bug.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/alias_bug.c new file mode 100644 index 000000000..64fef2787 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/alias_bug.c @@ -0,0 +1,61 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-strict-aliasing -fdump-tree-optimized" } */ + +typedef unsigned u32; +typedef unsigned short u16; +typedef unsigned char u8; +struct biosregs { + union { + struct { + u32 edi; + u32 esi; + u32 ebp; + u32 _esp; + u32 ebx; + u32 edx; + u32 ecx; + u32 eax; + u32 _fsgs; + u32 _dses; + u32 eflags; + }; + struct { + u16 di, hdi; + u16 si, hsi; + u16 bp, hbp; + u16 _sp, _hsp; + u16 bx, hbx; + u16 dx, hdx; + u16 cx, hcx; + u16 ax, hax; + u16 gs, fs; + u16 es, ds; + u16 flags, hflags; + }; + struct { + u8 dil, dih, edi2, edi3; + u8 sil, sih, esi2, esi3; + u8 bpl, bph, ebp2, ebp3; + u8 _spl, _sph, _esp2, _esp3; + u8 bl, bh, ebx2, ebx3; + u8 dl, dh, edx2, edx3; + u8 cl, ch, ecx2, ecx3; + u8 al, ah, eax2, eax3; + }; + }; +}; +void initregs(struct biosregs *regs); +void intcall(u8 int_no, const struct biosregs *ireg, struct biosregs *oreg); +static u32 *const gp = (u32*) 0x32; +void keyboard_set_repeat(void) +{ + struct biosregs ireg; + *gp = 10; + initregs(&ireg); + ireg.ax = 0x0305; + intcall(0x16, &ireg, ((void *)0)); +} + +/* { dg-final { scan-tree-dump-times "ireg.*ax" 1 "optimized"} } */ + +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c index e7cb925e8..72f0115a1 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c @@ -1,6 +1,6 @@ /* { dg-do run { target vect_cmdline_needed } } */ -/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4 -fdump-tree-vect-stats" } */ -/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4 -fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */ +/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4 -fno-inline -fdump-tree-vect-stats" } */ +/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=4 -fno-inline -fdump-tree-vect-stats -mno-sse" { target { i?86-*-* x86_64-*-* } } } */ #include <stdlib.h> diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c new file mode 100644 index 000000000..b102a7a52 --- /dev/null +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized -fno-strict-aliasing" } */ +/* Test with fixed address */ +static int *foo = (int *) (unsigned long) 0x7800000; + +int func(void) __attribute__ ((noinline)); + +extern int bar(void); + +int func(void) +{ + if (*foo) { + return 1; + } + return 0; + +} + +int foobar(void) +{ + + if (func()) { + *foo = 1; + } + return func(); +} + +/* { dg-final { scan-tree-dump-times "= func" 2 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/update-threading.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/update-threading.c index 58b26e615..1d451e82c 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/update-threading.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/tree-ssa/update-threading.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-inline -fdump-tree-optimized" } */ typedef struct { unsigned short a; } A; diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/uninit-13.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/uninit-13.c index 631e8de3a..236330ebb 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/uninit-13.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/uninit-13.c @@ -5,6 +5,7 @@ typedef _Complex float C; C foo() { C f; - __imag__ f = 0; /* { dg-warning "is used" "unconditional" } */ + __imag__ f = 0; /* { dg-warning "is used" "unconditional" { xfail arm*-*-* } } */ return f; } +/* { dg-excess-errors "fails on ARM." { target arm*-*-* } } */ diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp b/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp index 3518de059..2ca85b97e 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp @@ -29,7 +29,7 @@ if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then { set DEFAULT_VECTCFLAGS "" # These flags are used for all targets. -lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model" +lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model" "-fno-inline" # If the target system supports vector instructions, the default action # for a test is 'run', otherwise it's 'compile'. Save current default. diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp b/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp index ff3650ce2..e8f8554a0 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp @@ -30,7 +30,7 @@ if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) set DEFAULT_VECTCFLAGS "" # These flags are used for all targets. -lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model" +lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model" "-fno-inline" # If the target system supports vector instructions, the default action # for a test is 'run', otherwise it's 'compile'. Save current default. diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/vect.exp index c1e19850f..a190e46eb 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/vect.exp +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/vect/vect.exp @@ -24,7 +24,7 @@ load_lib gcc-dg.exp set DEFAULT_VECTCFLAGS "" # These flags are used for all targets. -lappend DEFAULT_VECTCFLAGS "-ftree-vectorize" "-fno-vect-cost-model" +lappend DEFAULT_VECTCFLAGS "-ftree-vectorize" "-fno-vect-cost-model" "-fno-inline" # So that we can read flags in individual tests. proc vect_cflags { } { diff --git a/gcc-4.4.3/gcc/testsuite/gcc.dg/winline-5.c b/gcc-4.4.3/gcc/testsuite/gcc.dg/winline-5.c index ad1fc4100..c033d6dc6 100644 --- a/gcc-4.4.3/gcc/testsuite/gcc.dg/winline-5.c +++ b/gcc-4.4.3/gcc/testsuite/gcc.dg/winline-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-Winline -O2 --param inline-unit-growth=0 --param large-unit-insns=0" } */ +/* { dg-options "-Winline -O2 --param inline-unit-growth=0 --param large-unit-insns=0 --param inline-address-not-taken-function-emit-probability=100 --param inline-function-size-adjustment=0" } */ void big (void); inline int q(void) /* { dg-warning "inline-unit-growth" } */ |