diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-01-07 10:08:10 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2005-01-07 10:08:10 +0100 |
commit | 2a0958c5f6dcc88ec21418f65ff0a75e50c592ef (patch) | |
tree | 63fa10dd04b8390aaf8f713cf0d4f78f5b708e64 /gcc/fold-const.c | |
parent | ebc0c8bbfccfc08835e7268ba4e9f5a1cecc3844 (diff) | |
download | gcc-2a0958c5f6dcc88ec21418f65ff0a75e50c592ef.zip gcc-2a0958c5f6dcc88ec21418f65ff0a75e50c592ef.tar.gz gcc-2a0958c5f6dcc88ec21418f65ff0a75e50c592ef.tar.bz2 |
re PR tree-optimization/19283 (Bad code generated in final_cleanup)
PR tree-optimization/19283
* fold-const.c (fold_widened_comparison): Return NULL if shorter_type
is not shorter than the original type.
* gcc.c-torture/execute/20050106-1.c: New test.
From-SVN: r93043
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index a3d1f1d..21ee14c 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -5993,7 +5993,10 @@ fold_widened_comparison (enum tree_code code, tree type, tree arg0, tree arg1) if (arg0_unw == arg0) return NULL_TREE; shorter_type = TREE_TYPE (arg0_unw); - + + if (TYPE_PRECISION (TREE_TYPE (arg0)) <= TYPE_PRECISION (shorter_type)) + return NULL_TREE; + arg1_unw = get_unwidened (arg1, shorter_type); if (!arg1_unw) return NULL_TREE; |