public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Backport PR61750 fix
@ 2014-11-21  8:32 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2014-11-21  8:32 UTC (permalink / raw)
  To: gcc-patches


The following backports a fix I applied to match.pd whilst merging
from match-and-simplify to the original tree-ssa-forwprop.c code
on the 4.9 branch.

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

Richard.

2014-11-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/61750
	* tree-ssa-forwprop.c (simplify_vce): Verify type sizes
	match for the resulting VIEW_CONVERT_EXPR.

Index: gcc/tree-ssa-forwprop.c
===================================================================
--- gcc/tree-ssa-forwprop.c	(revision 217764)
+++ gcc/tree-ssa-forwprop.c	(working copy)
@@ -3178,7 +3178,9 @@ simplify_vce (gimple_stmt_iterator *gsi)
 	  && (INTEGRAL_TYPE_P (TREE_TYPE (def_op))
 	      || POINTER_TYPE_P (TREE_TYPE (def_op)))
 	  && (TYPE_PRECISION (TREE_TYPE (op))
-	      == TYPE_PRECISION (TREE_TYPE (def_op))))
+	      == TYPE_PRECISION (TREE_TYPE (def_op)))
+	  && (TYPE_SIZE (TREE_TYPE (op))
+	      == TYPE_SIZE (TREE_TYPE (def_op))))
 	{
 	  TREE_OPERAND (gimple_assign_rhs1 (stmt), 0) = def_op;
 	  update_stmt (stmt);

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

only message in thread, other threads:[~2014-11-21  8:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-21  8:32 [PATCH] Backport PR61750 fix 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).