diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2007-07-03 12:55:13 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@gcc.gnu.org> | 2007-07-03 12:55:13 +0000 |
commit | 78d3c323b910765310ff6795cc64aeeae190fc1e (patch) | |
tree | aad27b9bed042a917db4921388ce2c84ebeba26a /gcc | |
parent | b6bcd67696f64c2ad33633be8657609068581dca (diff) | |
download | gcc-78d3c323b910765310ff6795cc64aeeae190fc1e.zip gcc-78d3c323b910765310ff6795cc64aeeae190fc1e.tar.gz gcc-78d3c323b910765310ff6795cc64aeeae190fc1e.tar.bz2 |
tree-ssa-sccvn.c (set_ssa_val_to): Check for operand_equal_p before declaring inequality.
2007-07-03 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-sccvn.c (set_ssa_val_to): Check for operand_equal_p
before declaring inequality.
From-SVN: r126252
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/ssa-pre-1.c | 19 | ||||
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 5 |
4 files changed, 32 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b21e230..d8ed672 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-07-03 Daniel Berlin <dberlin@dberlin.org> + + * tree-ssa-sccvn.c (set_ssa_val_to): Check for operand_equal_p + before declaring inequality. + 2007-07-03 Rask Ingemann Lambertsen <rask@sygehus.dk> * combine.c (recog_for_combine): Log the success or failure of diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1d3db36..609643e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-07-02 Daniel Berlin <dberlin@dberlin.org> + + * gcc.c-torture/compile/ssa-pre-1.c: New test. + 2007-07-03 Tobias Burnus <burnus@net-b.de> PR fortran/20888 diff --git a/gcc/testsuite/gcc.c-torture/compile/ssa-pre-1.c b/gcc/testsuite/gcc.c-torture/compile/ssa-pre-1.c new file mode 100644 index 0000000..eda370d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/ssa-pre-1.c @@ -0,0 +1,19 @@ +void washQtoM3(double m[9], double q[4]); +double sqrt(double); +int f(int samp) +{ + double clp[2], xyz[3], q[4], len; + double mRF[9]; + int xi; + for (xi=0; xi<samp; xi++) + { + q[0] = 1.0; + q[1] = ( ((double)(1)-(-1))*((double)((float)xi)-(-0.5)) / ((double)(samp-0.5)-(-0.5)) + (-1)); + q[2] = ( ((double)(1)-(-1))*((double)((float)0)-(-0.5)) / ((double)(samp-0.5)-(-0.5)) + (-1)); + q[3] = ( ((double)(1)-(-1))*((double)((float)0)-(-0.5)) / ((double)(samp-0.5)-(-0.5)) + (-1)); + len = (sqrt((((q))[0]*((q))[0] + ((q))[1]*((q))[1] + ((q))[2]*((q))[2] + ((q))[3]*((q))[3]))); + ((q)[0] = (q)[0]*1.0/len, (q)[1] = (q)[1]*1.0/len, (q)[2] = (q)[2]*1.0/len, (q)[3] = (q)[3]*1.0/len); + washQtoM3(mRF, q); + } + return 0; +} diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index b0db122..0f08229 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1014,6 +1014,7 @@ print_scc (FILE *out, VEC (tree, heap) *scc) static inline bool set_ssa_val_to (tree from, tree to) { + tree currval; gcc_assert (to != NULL); /* Make sure we don't create chains of copies, so that we get the @@ -1037,7 +1038,9 @@ set_ssa_val_to (tree from, tree to) fprintf (dump_file, "\n"); } - if (SSA_VAL (from) != to) + currval = SSA_VAL (from); + + if (currval != to && !operand_equal_p (currval, to, OEP_PURE_SAME)) { SSA_VAL (from) = to; return true; |