From 5e5ef52c23448a0c4c4be3f2093470c990c8c01f Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 16 Jul 2018 08:59:09 +0000 Subject: re PR tree-optimization/86514 (wrong manipulation of 2-dimensional packed array at -O) PR tree-optimization/86514 * tree-ssa-reassoc.c (init_range_entry) : Return for a conversion to a boolean type from a type with greater precision. From-SVN: r262684 --- gcc/tree-ssa-reassoc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/tree-ssa-reassoc.c') diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 97a53cd..41a37ab 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -2168,8 +2168,13 @@ init_range_entry (struct range_entry *r, tree exp, gimple *stmt) continue; CASE_CONVERT: if (is_bool) - goto do_default; - if (TYPE_PRECISION (TREE_TYPE (arg0)) == 1) + { + if ((TYPE_PRECISION (exp_type) == 1 + || TREE_CODE (exp_type) == BOOLEAN_TYPE) + && TYPE_PRECISION (TREE_TYPE (arg0)) > 1) + return; + } + else if (TYPE_PRECISION (TREE_TYPE (arg0)) == 1) { if (TYPE_UNSIGNED (TREE_TYPE (arg0))) is_bool = true; -- cgit v1.1