aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr50380.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr50380.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr50380.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr50380.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr50380.c
new file mode 100644
index 000000000..3f03cbbc3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr50380.c
@@ -0,0 +1,22 @@
+__attribute__ ((__noreturn__)) extern void fail (void);
+
+char x;
+
+/* This used to get stuck in an infinite loop in find_comparison_args
+ when compiling this function for MIPS at -O2. */
+
+void foo (const unsigned char y)
+{
+ ((void) (__builtin_expect((!! y == y), 1) ? 0 : (fail (), 0)));
+ x = ! y;
+}
+
+/* This used to similarly get stuck when compiling for PowerPC at -O2. */
+
+int foo2 (int arg)
+{
+ if (arg != !arg)
+ fail ();
+ if (arg)
+ fail ();
+}