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][match-and-simplify] Fix equality check of matches


We don't share all trees for things we want to prove equivalent
(FP constants for example).

Bootstrapped on x86_64-unknown-linux-gnu, installed.

Richard.

2014-07-15  Richard Biener  <rguenther@suse.de>

	* genmatch.c (dt_operand::gen_match_op): Fall back to
	use operand_equal_p if literal equality does not hold.

Index: gcc/genmatch.c
===================================================================
--- gcc/genmatch.c	(revision 212548)
+++ gcc/genmatch.c	(working copy)
@@ -1007,7 +1007,8 @@ dt_operand::gen_match_op (FILE *f, const
 {
   char match_opname[20];
   match_dop->get_name (match_opname);
-  fprintf (f, "if (%s == %s)\n", opname, match_opname);
+  fprintf (f, "if (%s == %s || operand_equal_p (%s, %s, 0))\n",
+	   opname, match_opname, opname, match_opname);
   fprintf (f, "{\n");
   return 1;
 }


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