aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-09-22 18:02:08 +0000
committerKazu Hirata <kazu@cs.umass.edu>2004-09-22 18:02:08 +0000
commit6a253ca4f4d6f502ffdc9cb0b5d62f53b866c426 (patch)
tree9b217f4e713dd67beaf547cca130461eff1ca273 /gcc/testsuite/gcc.c-torture
parent96560cd34167846f0c4ecb678ac85aed0fcc9f14 (diff)
PR tree-optimization/17512
* convert.c (convert_to_integer): Don't handle TRUTH_*_EXPR as special cases. * testsuite/gcc.c-torture/compile/20040916-1.c. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@87870 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20040916-1.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040916-1.c b/gcc/testsuite/gcc.c-torture/compile/20040916-1.c
new file mode 100644
index 00000000000..1a6a9f47fe8
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20040916-1.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/17512
+
+ We used to try to fold "(char) (X ^ Y)", where '^' is
+ TRUTH_XOR_EXPR into ((char) X ^ (char) Y), creating TRUTH_XOR_EXPR
+ with its operands being of type char, which is invalid. */
+
+char
+foo (int p)
+{
+ int q = p;
+ return (p != 0) == (p == q);
+}