From 4f76e46b189899f58e018dec68d7f5e68a6e55a2 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Mon, 23 Oct 2006 07:15:45 +0000 Subject: re PR middle-end/21032 (With -frounding-math, incorrectly reorders unary minus) 2006-10-23 Richard Guenther PR middle-end/21032 * convert.c (convert_to_real): Fold (float)-x to -(float)x only if not flag_rounding_math. * gcc.dg/pr21032.c: New testcase. From-SVN: r117968 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr21032.c | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr21032.c (limited to 'gcc/testsuite') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 860107e..06d1abc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-10-23 Richard Guenther + + PR middle-end/21032 + * gcc.dg/pr21032.c: New testcase. + 2006-10-22 Jeff Law Richard Guenther diff --git a/gcc/testsuite/gcc.dg/pr21032.c b/gcc/testsuite/gcc.dg/pr21032.c new file mode 100644 index 0000000..839a180 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr21032.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-optimized -frounding-math" } */ + +void bar(float x); +void foo(double x) +{ + bar(-x); +} + +/* { dg-final { scan-tree-dump-not "-\\(float\\)" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ -- cgit v1.1