diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-15 23:14:07 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-15 23:14:07 +0000 |
commit | 2fdd1d9f108ee0d69d0f8c4d38093f4cbc40e8e4 (patch) | |
tree | 05c7c317bcf26c08712164956da8462eec8e8c68 /gcc/fold-const.c | |
parent | ebf5d1a8bc1ede9128673a160be7cb7c9753e862 (diff) | |
download | gcc-2fdd1d9f108ee0d69d0f8c4d38093f4cbc40e8e4.tar.gz |
2005-07-15 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/22398
* gcc.c-torture/compile/pr22398.c: New test.
2005-07-11 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/22398
* fold-const.c (build_range_check): Convert high/low to etype
if we are only comparing against exp.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102067 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 3bc27eb5d3b..0e414bc2bf1 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3943,13 +3943,16 @@ build_range_check (tree type, tree exp, int in_p, tree low, tree high) return fold_convert (type, integer_one_node); if (low == 0) - return fold_build2 (LE_EXPR, type, exp, high); + return fold_build2 (LE_EXPR, type, exp, + fold_convert (etype, high)); if (high == 0) - return fold_build2 (GE_EXPR, type, exp, low); + return fold_build2 (GE_EXPR, type, exp, + fold_convert (etype, low)); if (operand_equal_p (low, high, 0)) - return fold_build2 (EQ_EXPR, type, exp, low); + return fold_build2 (EQ_EXPR, type, exp, + fold_convert (etype, low)); if (integer_zerop (low)) { |