From 010c4d9c147b2bf50580f322fbe94fbde1206971 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Wed, 5 Jan 2005 17:27:26 +0000 Subject: re PR middle-end/19100 (Wrong code for ?-operator with casted ?-operator predicat) PR middle-end/19100 * c-common.c: Include real.h. (c_common_truthvalue_conversion): Avoid destructively modifying expr. Correctly handle TREE_CONSTANT_OVERFLOW for INTEGER_CST. Correctly handle TREE_CONSTANT_OVERFLOW and NaNs for REAL_CST. * Makefile.in (c-common.o): Update dependencies. * gcc.dg/conv-3.c: New test case. From-SVN: r92957 --- gcc/testsuite/gcc.dg/conv-3.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/conv-3.c (limited to 'gcc/testsuite/gcc.dg/conv-3.c') diff --git a/gcc/testsuite/gcc.dg/conv-3.c b/gcc/testsuite/gcc.dg/conv-3.c new file mode 100644 index 0000000..3b4f430 --- /dev/null +++ b/gcc/testsuite/gcc.dg/conv-3.c @@ -0,0 +1,18 @@ +/* PR middle-end/19100 */ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +void abort (void); + +int test (int v) +{ + return ((signed char) (v ? 0x100 : 0)) ? 17 : 18; +} + +int main() +{ + if (test (2) != 18) + abort (); + return 0; +} + -- cgit v1.1