diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2018-07-16 08:59:09 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2018-07-16 08:59:09 +0000 |
commit | 5e5ef52c23448a0c4c4be3f2093470c990c8c01f (patch) | |
tree | 63f579a414eb7635d127d6bebeadf29ea98487b5 /gcc/tree-ssa-reassoc.c | |
parent | f030b30e32a19a8e7c2c43ec8a5407818c840368 (diff) | |
download | gcc-5e5ef52c23448a0c4c4be3f2093470c990c8c01f.zip gcc-5e5ef52c23448a0c4c4be3f2093470c990c8c01f.tar.gz gcc-5e5ef52c23448a0c4c4be3f2093470c990c8c01f.tar.bz2 |
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) <CASE_CONVERT>: Return for a
conversion to a boolean type from a type with greater precision.
From-SVN: r262684
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r-- | gcc/tree-ssa-reassoc.c | 9 |
1 files changed, 7 insertions, 2 deletions
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; |