This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix half of PR69586
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 16 Feb 2016 09:59:59 +0100 (CET)
- Subject: [PATCH] Fix half of PR69586
- Authentication-results: sourceware.org; auth=none
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))