mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-27 21:15:20 +08:00
re PR rtl-optimization/23047 (Combine ignores flag_wrapv)
2005-07-27 James A. Morrison <phython@gcc.gnu.org> PR rtl-optimization/23047 * simplify-rtx.c (simplify_const_relational_operation): Respect flag_wrapv for comparisons with ABS. From-SVN: r102459
This commit is contained in:
parent
ff08cbee5d
commit
77d1d8e01f
@ -1,3 +1,9 @@
|
||||
2005-07-25 James A. Morrison <phython@gcc.gnu.org>
|
||||
|
||||
PR rtl-optimization/23047
|
||||
* simplify-rtx.c (simplify_const_relational_operation): Respect
|
||||
flag_wrapv for comparisons with ABS.
|
||||
|
||||
2005-07-27 James A. Morrison <phython@gcc.gnu.org>
|
||||
|
||||
PR tree-optimization/22493
|
||||
|
@ -3236,7 +3236,9 @@ simplify_const_relational_operation (enum rtx_code code,
|
||||
|
||||
case LT:
|
||||
/* Optimize abs(x) < 0.0. */
|
||||
if (trueop1 == CONST0_RTX (mode) && !HONOR_SNANS (mode))
|
||||
if (trueop1 == CONST0_RTX (mode)
|
||||
&& !HONOR_SNANS (mode)
|
||||
&& !(flag_wrapv && INTEGRAL_MODE_P (mode)))
|
||||
{
|
||||
tem = GET_CODE (trueop0) == FLOAT_EXTEND ? XEXP (trueop0, 0)
|
||||
: trueop0;
|
||||
@ -3247,7 +3249,9 @@ simplify_const_relational_operation (enum rtx_code code,
|
||||
|
||||
case GE:
|
||||
/* Optimize abs(x) >= 0.0. */
|
||||
if (trueop1 == CONST0_RTX (mode) && !HONOR_NANS (mode))
|
||||
if (trueop1 == CONST0_RTX (mode)
|
||||
&& !HONOR_NANS (mode)
|
||||
&& !(flag_wrapv && INTEGRAL_MODE_P (mode)))
|
||||
{
|
||||
tem = GET_CODE (trueop0) == FLOAT_EXTEND ? XEXP (trueop0, 0)
|
||||
: trueop0;
|
||||
|
@ -1,6 +1,12 @@
|
||||
2005-07-27 James A. Morrison <phython@gcc.gnu.org>
|
||||
|
||||
PR rtl-optimization/22493
|
||||
PR rtl-optimization/23047
|
||||
* gcc.c-torture/execute/pr23047.c: New test.
|
||||
* gcc.c-torture/execute/pr23047.x: New.
|
||||
|
||||
2005-07-27 James A. Morrison <phython@gcc.gnu.org>
|
||||
|
||||
PR tree-optimization/22493
|
||||
* gcc.c-torture/execute/pr22493-1.c: New test.
|
||||
* gcc.c-torture/execute/pr22493-1.x: New.
|
||||
* gcc.c-torture/execute/vrp-1.c: New test.
|
||||
|
16
gcc/testsuite/gcc.c-torture/execute/pr23047.c
Normal file
16
gcc/testsuite/gcc.c-torture/execute/pr23047.c
Normal file
@ -0,0 +1,16 @@
|
||||
#include <limits.h>
|
||||
extern void abort ();
|
||||
extern void exit (int);
|
||||
void f(int i)
|
||||
{
|
||||
i = i > 0 ? i : -i;
|
||||
if (i<0)
|
||||
return;
|
||||
abort ();
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
f(INT_MIN);
|
||||
exit (0);
|
||||
}
|
2
gcc/testsuite/gcc.c-torture/execute/pr23047.x
Normal file
2
gcc/testsuite/gcc.c-torture/execute/pr23047.x
Normal file
@ -0,0 +1,2 @@
|
||||
set additional_flags "-fwrapv"
|
||||
return 0
|
Loading…
Reference in New Issue
Block a user