fold-const.c (tree_expr_nonnegative_p): Always return true for non-integral types.

2005-07-30  James A. Morrison  <phython@gcc.gnu.org>

        * fold-const.c (tree_expr_nonnegative_p): Always return true for
        non-integral types.

From-SVN: r102587
This commit is contained in:
James A. Morrison 2005-07-30 14:39:12 +00:00
parent b6f571b7d3
commit 06581725b9
4 changed files with 26 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2005-07-30 James A. Morrison <phython@gcc.gnu.org>
* fold-const.c (tree_expr_nonnegative_p): Always return true for
non-integral types.
2005-07-29 Wolfgang Bangerth <bangerth@dealii.org>
PR target/22582

View File

@ -10719,7 +10719,7 @@ tree_expr_nonnegative_p (tree t)
case ABS_EXPR:
/* We can't return 1 if flag_wrapv is set because
ABS_EXPR<INT_MIN> = INT_MIN. */
if (!flag_wrapv)
if (!(flag_wrapv && INTEGRAL_TYPE_P (TREE_TYPE (t))))
return 1;
break;

View File

@ -1,4 +1,8 @@
2005-07-30 Paul Thomas <pault@gcc.gnu.org>
2005-07-30 James A. Morrison <phython@gcc.gnu.org>
* gcc.dg/fold-abs-4.c: new test.
2005-07-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/22570 an related issues.
* gfortran.dg/x_slash_1.f: New test.

View File

@ -0,0 +1,15 @@
/* { dg-do compile } */
/* { dg-options "-fdump-tree-gimple -fwrapv" } */
extern float fabsf (float);
extern float cabsf (_Complex float);
int f (float a) {
return fabsf(a) < 0.0;
}
int g (_Complex float a) {
return cabsf (a) < 0.0;
}
/* { dg-final { scan-tree-dump-times "ABS" 0 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */