2006-03-09 Roger Sayle <roger@eyesopen.com> Eric Botcazou <ebotcazou@libertysurf.fr> PR middle-end/26561 * fold-const.c (fold_div_compare): When optimizing X/C1 op C2 as X op C3, consider whether C3 overflows towards +Inf or -Inf. * gcc.c-torture/execute/divcmp-5.c: New test case. Co-Authored-By: Eric Botcazou <ebotcazou@libertysurf.fr> From-SVN: r111862
32 lines
356 B
C
32 lines
356 B
C
/* PR middle-end/26561 */
|
|
|
|
extern void abort(void);
|
|
|
|
int always_one_1 (int a)
|
|
{
|
|
if (a/100 >= -999999999)
|
|
return 1;
|
|
else
|
|
return 0;
|
|
}
|
|
|
|
int always_one_2 (int a)
|
|
{
|
|
if (a/100 < -999999999)
|
|
return 0;
|
|
else
|
|
return 1;
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
if (always_one_1 (0) != 1)
|
|
abort ();
|
|
|
|
if (always_one_2 (0) != 1)
|
|
abort ();
|
|
|
|
return 0;
|
|
}
|
|
|