aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Elliston <bje@au.ibm.com>2004-10-20 01:29:57 +0000
committerBen Elliston <bje@gcc.gnu.org>2004-10-20 11:29:57 +1000
commitc09521768db0c4a207071cd0cf9deb8ccefee9bf (patch)
tree5e455b02369d515fc8ddf83f69255517d707725b
parentdd3651579649680db8ef4dbb06192526bdcbb319 (diff)
downloadgcc-c09521768db0c4a207071cd0cf9deb8ccefee9bf.zip
gcc-c09521768db0c4a207071cd0cf9deb8ccefee9bf.tar.gz
gcc-c09521768db0c4a207071cd0cf9deb8ccefee9bf.tar.bz2
ifc-20040816-2.c: Use integer arithmetic instead of floating point arithmetic, which could trap.
* gcc.dg/tree-ssa/ifc-20040816-2.c: Use integer arithmetic instead of floating point arithmetic, which could trap. Co-Authored-By: Devang Patel <dpatel@apple.com> From-SVN: r89313
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c27
2 files changed, 19 insertions, 14 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7b8fc48..1a7ccc0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-20 Ben Elliston <bje@au.ibm.com>
+ Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/tree-ssa/ifc-20040816-2.c: Use integer arithmetic instead
+ of floating point arithmetic, which could trap.
+
2004-10-19 Mark Mitchell <mark@codesourcery.com>
PR c++/14035
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c
index 1fd92e1..85a79e7 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c
@@ -1,30 +1,29 @@
/* { dg-do compile } */
/* { dg-options "-c -O2 -ftree-vectorize -fdump-tree-ifcvt-stats" { target *-*-* } } */
-typedef float afloat __attribute__ ((__aligned__(16)));
-void foo(const afloat * __restrict__ zr_in,
- const afloat * __restrict__ zi_in,
- const afloat * __restrict__ zk_in,
- afloat * __restrict__ zr_out,
- afloat * __restrict__ zi_out,
- afloat * __restrict__ zk_out,
- float cr, float ci)
+void foo(const int * __restrict__ zr_in,
+ const int * __restrict__ zi_in,
+ const int * __restrict__ zk_in,
+ int * __restrict__ zr_out,
+ int * __restrict__ zi_out,
+ int * __restrict__ zk_out,
+ int cr, int ci)
{
unsigned int pi;
- float tmp_r, tmp_i, tmp_k;
+ int tmp_r, tmp_i, tmp_k;
for (pi = 0; pi < (512)*(512); pi++) {
- float zr = zr_in[pi];
- float zi = zi_in[pi];
- float zk = zk_in[pi];
+ int zr = zr_in[pi];
+ int zi = zi_in[pi];
+ int zk = zk_in[pi];
- if (zr*zr + zi*zi >= 4.0f) {
+ if (zr*zr + zi*zi >= 4) {
tmp_r = zr;
tmp_i = zi;
tmp_k = zk;
} else {
tmp_r = (zr*zr - zi*zi + cr);
tmp_i = (2 * zr * zi + ci);
- tmp_k = zk + 1.0f;
+ tmp_k = zk + 1;
}
zr_out[pi] = tmp_r;
zi_out[pi] = tmp_i;