This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][3/n] Remove GENERIC stmt combining from SCCVN


This allows (p + 1) + 2 to be combined to p + 3 (also a good sign
on why that single_use stuff is "bad" - bad in case we have restricted
simplifications to a single stmt as result anyway).

This shows up in gcc.dg/20020415-1.c (and more places)

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

Richard.

2015-06-25  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.

Index: gcc/match.pd
===================================================================
--- gcc/match.pd	(revision 224893)
+++ gcc/match.pd	(working copy)
@@ -503,7 +520,8 @@ (define_operator_list swapped_tcc_compar
 /* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]