[multiple changes]

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.

From-SVN: r102067
This commit is contained in:
Andrew Pinski 2005-07-15 23:14:07 +00:00 committed by Andrew Pinski
parent 3f774254db
commit 01c0a9fa28
4 changed files with 38 additions and 3 deletions

View file

@ -1,3 +1,9 @@
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.
2005-07-13 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/22376

View file

@ -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))
{

View file

@ -1,3 +1,8 @@
2005-07-15 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/22398
* gcc.c-torture/compile/pr22398.c: New test.
2005-07-15 Mark Mitchell <mark@codesourcery.com>
PR c++/22132

View file

@ -0,0 +1,21 @@
#if ULONG_MAX != 4294967295u && ULONG_MAX != 18446744073709551615ull
int main(void) { exit (0); }
#else
#if ULONG_MAX != 18446744073709551615ull
#define NUM 0xf0000000
#else
#define NUM 0xf000000000000000
#endif
int func1(void *rw)
{
return (rw && (((unsigned long) rw) >= NUM) );
}
void func2(void *rw)
{
while(rw && (((unsigned long) rw) >= NUM) ) {}
}
#endif