diff options
| author | hutchinsonandy <hutchinsonandy@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-06-18 22:11:05 +0000 |
|---|---|---|
| committer | hutchinsonandy <hutchinsonandy@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-06-18 22:11:05 +0000 |
| commit | b0a6726e50f97b29cfb5d784a5bf24c363722581 (patch) | |
| tree | 3eaa6bf69928606e4e083201e32079a0372d1b55 | |
| parent | d0f4c60774600f4076e0a776aa48a8461f24a7bc (diff) | |
| download | ppe42-gcc-b0a6726e50f97b29cfb5d784a5bf24c363722581.tar.gz ppe42-gcc-b0a6726e50f97b29cfb5d784a5bf24c363722581.zip | |
* gcc.dg/tree-ssa/forwprop-6.c: Use long or int to match size of float. Otherwise error.
* gcc.dg/tree-ssa/ssa-fre-7.c: Ditto.
* gcc.dg/tree-ssa/ssa-fre-8.c: Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136923 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c | 12 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c | 13 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c | 12 |
4 files changed, 35 insertions, 9 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 32b3887322b..8b38601d9de 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,12 @@ 2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com> + * gcc.dg/tree-ssa/forwprop-6.c: Use long or int to match size of + float. Otherwise error. + * gcc.dg/tree-ssa/ssa-fre-7.c: Ditto. + * gcc.dg/tree-ssa/ssa-fre-8.c: Ditto. + +2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com> + * gcc.c-torture/execute/20020619-1.c: Correct for targets without 32 bit int. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c index 7df9f45ab17..987f8a3909a 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c @@ -1,13 +1,19 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-forwprop1 -W -Wall" } */ +#if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) +typedef int intflt; +#elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) +typedef long intflt; +#else +#error Add target support here for type that will union float size +#endif - -int b; +intflt b; void f(void) { float a; a = 1; - b = *(int*)&a; /* { dg-warning "aliasing" } */ + b = *(intflt*)&a; /* { dg-warning "aliasing" } */ } /* We should be able to convert the cast to a VCE in forwprop1, diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c index a66adeb8c99..bd81831eba8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c @@ -1,16 +1,23 @@ /* { dg-do compile } */ /* { dg-options "-O -fdump-tree-fre-details -fdump-tree-optimized" } */ +#if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) +typedef int intflt; +#elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) +typedef long intflt; +#else +#error Add target support here for type that will union float size +#endif struct X { int i; union { - int j; - int k; + intflt j; + intflt k; float f; } u; }; -int foo(int j) +intflt foo(intflt j) { struct X a; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c index 84a9aeb60ee..6e17bd531b3 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c @@ -1,11 +1,17 @@ /* { dg-do compile } */ /* { dg-options "-O -fdump-tree-fre-details" } */ - +#if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) +typedef int intflt; +#elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) +typedef long intflt; +#else +#error Add target support here for type that will union float size +#endif union U { - int i; + intflt i; float f; }; -int foo(int i, int b) +intflt foo(int i, int b) { union U u; if (b) |

