mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-12 10:17:07 +08:00
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:
parent
b6f571b7d3
commit
06581725b9
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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.
|
||||
|
15
gcc/testsuite/gcc.dg/fold-abs-4.c
Normal file
15
gcc/testsuite/gcc.dg/fold-abs-4.c
Normal 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" } } */
|
Loading…
Reference in New Issue
Block a user