aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2005-07-15 23:14:07 +0000
committerAndrew Pinski <pinskia@physics.uc.edu>2005-07-15 23:14:07 +0000
commit5e32cea209ea97221f8e79035a6a3a790bd369e8 (patch)
tree05c7c317bcf26c08712164956da8462eec8e8c68 /gcc/fold-const.c
parentba8a4d7ba4b85dd35201b36b48c16ee703abe460 (diff)
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: https://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.c9
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))
{