forwprop-6.c: Use long or int to match size of float.

* 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.

From-SVN: r136923
This commit is contained in:
Andy Hutchinson 2008-06-18 22:11:05 +00:00 committed by Andy Hutchinson
parent 5d597439cb
commit 458426d934
4 changed files with 35 additions and 9 deletions

View File

@ -1,3 +1,10 @@
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> 2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com>
* gcc.c-torture/execute/20020619-1.c: Correct for targets * gcc.c-torture/execute/20020619-1.c: Correct for targets

View File

@ -1,13 +1,19 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-forwprop1 -W -Wall" } */ /* { 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
intflt b;
int b;
void f(void) void f(void)
{ {
float a; float a;
a = 1; 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, /* We should be able to convert the cast to a VCE in forwprop1,

View File

@ -1,16 +1,23 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -fdump-tree-fre-details -fdump-tree-optimized" } */ /* { 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 { struct X {
int i; int i;
union { union {
int j; intflt j;
int k; intflt k;
float f; float f;
} u; } u;
}; };
int foo(int j) intflt foo(intflt j)
{ {
struct X a; struct X a;

View File

@ -1,11 +1,17 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -fdump-tree-fre-details" } */ /* { 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 { union U {
int i; intflt i;
float f; float f;
}; };
int foo(int i, int b) intflt foo(int i, int b)
{ {
union U u; union U u;
if (b) if (b)