aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-05-14 10:35:06 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-05-14 10:35:06 +0000
commit485fa7041bee21893c7db73884e9a87ac8eb286a (patch)
treecbf92621d9af4f7620384e19da6da2f7efe2a7ea /gcc
parentc86ed2f12bccff7558c1032e22bc603e73941547 (diff)
downloadgcc-485fa7041bee21893c7db73884e9a87ac8eb286a.zip
gcc-485fa7041bee21893c7db73884e9a87ac8eb286a.tar.gz
gcc-485fa7041bee21893c7db73884e9a87ac8eb286a.tar.bz2
match-and-simplify.texi: Adjust :s documentation.
2018-05-14 Richard Biener <rguenther@suse.de> * doc/match-and-simplify.texi: Adjust :s documentation. From-SVN: r260223
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/doc/match-and-simplify.texi12
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index edf2e41..c8bb4c7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2018-05-14 Richard Biener <rguenther@suse.de>
+
+ * doc/match-and-simplify.texi: Adjust :s documentation.
+
2018-05-14 Alexander Monakov <amonakov@ispras.ru>
* sort.cc (REORDER_23): Pass the type for the temporaries instead of
diff --git a/gcc/doc/match-and-simplify.texi b/gcc/doc/match-and-simplify.texi
index 6bc2c47..024d747 100644
--- a/gcc/doc/match-and-simplify.texi
+++ b/gcc/doc/match-and-simplify.texi
@@ -250,7 +250,9 @@ come second in commutative expressions.
The second supported flag is @code{s} which tells the code
generator to fail the pattern if the expression marked with
-@code{s} does have more than one use. For example in
+@code{s} does have more than one use and the simplification
+results in an expression with more than one operator.
+For example in
@smallexample
(simplify
@@ -261,6 +263,14 @@ generator to fail the pattern if the expression marked with
this avoids the association if @code{(pointer_plus @@0 @@1)} is
used outside of the matched expression and thus it would stay
live and not trivially removed by dead code elimination.
+Now consider @code{((x + 3) + -3)} with the temporary
+holding @code{(x + 3)} used elsewhere. This simplifies down
+to @code{x} which is desirable and thus flagging with @code{s}
+does not prevent the transform. Now consider @code{((x + 3) + 1)}
+which simplifies to @code{(x + 4)}. Despite being flagged with
+@code{s} the simplification will be performed. The
+simplification of @code{((x + a) + 1)} to @code{(x + (a + 1))} will
+not performed in this case though.
More features exist to avoid too much repetition.