summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr38934.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr38934.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr38934.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr38934.c b/gcc/testsuite/gcc.dg/pr38934.c
new file mode 100644
index 000000000..c05742c5b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr38934.c
@@ -0,0 +1,19 @@
+/* PR middle-end/38934 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu99 -w" } */
+
+/* This variable needed only to work around earlier optimizations than VRP. */
+unsigned char g;
+
+extern void abort ();
+
+void
+f (long long int p)
+{
+ g = 255;
+ if (p >= -9223372036854775808LL - (signed char) g)
+ p = 1;
+
+ if (p)
+ abort ();
+}