public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix SLSR issue
@ 2017-09-06  7:47 Richard Biener
  2017-09-06 12:54 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2017-09-06  7:47 UTC (permalink / raw)
  To: gcc-patches


This fixes a bogus check for a mode when the type matters.  The
test can get fooled by vector ops with integral mode and thus we
later ICE trying to use wide-ints operating on vector constants.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2017-09-06  Richard Biener  <rguenther@suse.de>

	* gimple-ssa-strength-reduction.c
	(find_candidates_dom_walker::before_doom_children): Use a
	type and not a mode check.

Index: gcc/gimple-ssa-strength-reduction.c
===================================================================
--- gcc/gimple-ssa-strength-reduction.c	(revision 251710)
+++ gcc/gimple-ssa-strength-reduction.c	(working copy)
@@ -1742,8 +1742,7 @@ find_candidates_dom_walker::before_dom_c
 	slsr_process_ref (gs);
 
       else if (is_gimple_assign (gs)
-	       && SCALAR_INT_MODE_P
-	            (TYPE_MODE (TREE_TYPE (gimple_assign_lhs (gs)))))
+	       && INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (gs))))
 	{
 	  tree rhs1 = NULL_TREE, rhs2 = NULL_TREE;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix SLSR issue
  2017-09-06  7:47 [PATCH] Fix SLSR issue Richard Biener
@ 2017-09-06 12:54 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2017-09-06 12:54 UTC (permalink / raw)
  To: gcc-patches

On Wed, 6 Sep 2017, Richard Biener wrote:

> 
> This fixes a bogus check for a mode when the type matters.  The
> test can get fooled by vector ops with integral mode and thus we
> later ICE trying to use wide-ints operating on vector constants.
> 
> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Promptly overlooked some regressions, fixed as follows.

Richard.

2017-09-06  Richard Biener  <rguenther@suse.de>

	* gimple-ssa-strength-reduction.c
	(find_candidates_dom_walker::before_dom_children): Also allow
	pointer types.

Index: gcc/gimple-ssa-strength-reduction.c
===================================================================
--- gcc/gimple-ssa-strength-reduction.c	(revision 251753)
+++ gcc/gimple-ssa-strength-reduction.c	(working copy)
@@ -1742,7 +1742,8 @@ find_candidates_dom_walker::before_dom_c
 	slsr_process_ref (gs);
 
       else if (is_gimple_assign (gs)
-	       && INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (gs))))
+	       && (INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (gs)))
+		   || POINTER_TYPE_P (TREE_TYPE (gimple_assign_lhs (gs)))))
 	{
 	  tree rhs1 = NULL_TREE, rhs2 = NULL_TREE;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-06 12:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06  7:47 [PATCH] Fix SLSR issue Richard Biener
2017-09-06 12:54 ` 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).