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] Fix half of PR69586


While investigating PR69586 I noticed we fail to register asserts for
the seen condition.  This is fixed by the below patch.  I'm still
thinking on how to improve BIT_AND_EXPR handling to catch the missed
jump-threading.

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

Richard.

2016-02-16  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/69586
	* tree-vrp.c (register_edge_assert_for_2): Handle all integral
	types for conversion sources.

Index: gcc/tree-vrp.c
===================================================================
--- gcc/tree-vrp.c	(revision 233418)
+++ gcc/tree-vrp.c	(working copy)
@@ -5449,7 +5466,7 @@ register_edge_assert_for_2 (tree name, e
       cst2 = NULL_TREE;
       if (rhs_code == BIT_AND_EXPR
 	  || (CONVERT_EXPR_CODE_P (rhs_code)
-	      && TREE_CODE (TREE_TYPE (val)) == INTEGER_TYPE
+	      && INTEGRAL_TYPE_P (TREE_TYPE (val))
 	      && TYPE_UNSIGNED (TREE_TYPE (val))
 	      && TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (def_stmt)))
 		 > prec))


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