public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR66916
@ 2015-07-23  8:22 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2015-07-23  8:22 UTC (permalink / raw)
  To: gcc-patches


The following adds a single-use restriction to the widening/sing-change
comparison pattern which fixes PR66916.

Bootstrapped and tested on x86_64-unknown-linux-gnu.  Verified the
arm testcase produces expected assembly with a cc1 cross.

Richard.

2015-07-22  Richard Biener  <rguenther@suse.de>

	PR middle-end/66916
	* match.pd: Guard widen and sign-change comparison simplification
	with single_use.

Index: gcc/match.pd
===================================================================
--- gcc/match.pd	(revision 226042)
+++ gcc/match.pd	(working copy)
@@ -1679,7 +1719,8 @@ (define_operator_list CBRT BUILT_IN_CBRT
 	  type on targets that require function pointer canonicalization.  */
        && !(targetm.have_canonicalize_funcptr_for_compare ()
 	    && TREE_CODE (TREE_TYPE (@00)) == POINTER_TYPE
-	    && TREE_CODE (TREE_TYPE (TREE_TYPE (@00))) == FUNCTION_TYPE))
+	    && TREE_CODE (TREE_TYPE (TREE_TYPE (@00))) == FUNCTION_TYPE)
+       && single_use (@0))
    (if (TYPE_PRECISION (TREE_TYPE (@00)) == TYPE_PRECISION (TREE_TYPE (@0))
 	&& (TREE_CODE (@10) == INTEGER_CST
 	    || (@1 != @10 && types_match (TREE_TYPE (@10), TREE_TYPE (@00))))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-23  7:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-23  8:22 [PATCH] Fix PR66916 Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).