summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-10 12:40:10 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-10 12:40:10 +0000
commita4de562442491f4870d490fafeafd4d305ba4a3c (patch)
treea8e19967fdd99d0fc53016195487b80ac8f20ece /gcc/testsuite/gcc.c-torture
parent00ea394c37c227f4e347df07e6feec200285367f (diff)
downloadgcc-a4de562442491f4870d490fafeafd4d305ba4a3c.tar.gz
PR c/11449
* fold-const.c (sign_bit_p): Return EXP if VAL is the sign bit of HOST_WIDE_INT. (fold_single_bit_test): If sign_bit_p() fails, assume that the bit being tested is not a sign bit. PR c/11449 * gcc.c-torture/compile/20030707-1.c: New. * config/h8300/h8300.md (a peephole2): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69184 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030707-1.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030707-1.c b/gcc/testsuite/gcc.c-torture/compile/20030707-1.c
new file mode 100644
index 00000000000..8ce964512bf
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030707-1.c
@@ -0,0 +1,13 @@
+/* PR c/11449. */
+
+/* sign_bit_p() in fold-const.c failed to notice that (int) 0x80000000
+ was the sign bit of m. As a result, fold_single_bit_test()
+ returned ((unsigned int) m >> 31), and that was eventually passed
+ to invert_truthvalue(), which did not know how to handle
+ RROTATE_EXPR, causing an ICE. */
+
+int
+foo (int m)
+{
+ return !(m & ((int) 0x80000000));
+}