aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/match.pd10
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gfortran.dg/reassoc_3.f903
4 files changed, 21 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 92cacd4..21627b4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2015-06-26 Richard Biener <rguenther@suse.de>
+
+ * match.pd: Allow associating FLOAT_TYPE_P when flag_associative_math.
+
+2015-06-26 Richard Biener <rguenther@suse.de>
+
+ * match.pd: Allow (p +p off1) +p off2 to (p +p (off1 + off2))
+ irrespective on whether the inner operation has a single use
+ of both off are constant.
+
2015-06-26 Uros Bizjak <ubizjak@gmail.com>
Segher Boessenkool <segher@kernel.crashing.org>
diff --git a/gcc/match.pd b/gcc/match.pd
index 292ce6d..b1a8827 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -503,7 +503,8 @@ along with GCC; see the file COPYING3. If not see
/* Associate (p +p off1) +p off2 as (p +p (off1 + off2)). */
(simplify
(pointer_plus (pointer_plus@2 @0 @1) @3)
- (if (single_use (@2))
+ (if (single_use (@2)
+ || (TREE_CODE (@1) == INTEGER_CST && TREE_CODE (@3) == INTEGER_CST))
(pointer_plus @0 (plus @1 @3))))
/* Pattern match
@@ -561,9 +562,10 @@ along with GCC; see the file COPYING3. If not see
&& !TYPE_OVERFLOW_SANITIZED (type))
(convert @1)))
- /* We can't reassociate floating-point or fixed-point plus or minus
- because of saturation to +-Inf. */
- (if (!FLOAT_TYPE_P (type) && !FIXED_POINT_TYPE_P (type))
+ /* We can't reassociate floating-point unless -fassociative-math
+ or fixed-point plus or minus because of saturation to +-Inf. */
+ (if ((!FLOAT_TYPE_P (type) || flag_associative_math)
+ && !FIXED_POINT_TYPE_P (type))
/* Match patterns that allow contracting a plus-minus pair
irrespective of overflow issues. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 74462f9..bccda4a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2015-06-26 Richard Biener <rguenther@suse.de>
+
+ * gfortran.dg/reassoc_3.f90: Adjust.
+
2015-06-26 Uros Bizjak <ubizjak@gmail.com>
PR target/66412
diff --git a/gcc/testsuite/gfortran.dg/reassoc_3.f90 b/gcc/testsuite/gfortran.dg/reassoc_3.f90
index 7331b0c..ac2f6aa 100644
--- a/gcc/testsuite/gfortran.dg/reassoc_3.f90
+++ b/gcc/testsuite/gfortran.dg/reassoc_3.f90
@@ -14,5 +14,4 @@ function test(a)
end
! { dg-final { scan-tree-dump "b = 5" "original" } }
-! { dg-final { scan-tree-dump "c_. = .a" "optimized" } }
-! { dg-final { scan-tree-dump "return c_.;" "optimized" } }
+! { dg-final { scan-tree-dump-times " = " 1 "optimized" } }