aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/pr85156.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/pr85156.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/pr85156.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/pr85156.c b/SingleSource/Regression/C/gcc-c-torture/execute/pr85156.c
new file mode 100644
index 00000000..a2968370
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/pr85156.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/85156 */
+
+int x, y;
+
+__attribute__((noipa)) int
+foo (int z)
+{
+ if (__builtin_expect (x ? y != 0 : 0, z++))
+ return 7;
+ return z;
+}
+
+int
+main ()
+{
+ x = 1;
+ asm volatile ("" : "+m" (x), "+m" (y));
+ if (foo (10) != 11)
+ __builtin_abort ();
+ return 0;
+}