summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr34648.c39
2 files changed, 44 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3a460685243..eb8a26cf610 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-17 Andrew MacLeod <amacleod@redhat.com>
+
+ PR tree-optimization/34648
+ * gcc.c-torture/compile/pr34648.c: New testcase.
+
2008-01-17 Sebastian Pop <sebastian.pop@amd.com>
PR testsuite/34821
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr34648.c b/gcc/testsuite/gcc.c-torture/compile/pr34648.c
new file mode 100644
index 00000000000..1f7472fe76d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr34648.c
@@ -0,0 +1,39 @@
+/* PR tree-optimization/34648 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fexceptions" } */
+
+extern const unsigned short int **bar (void) __attribute__ ((const));
+const char *a;
+int b;
+char c;
+
+char
+foo (int *x)
+{
+ char r;
+
+ c = '\0';
+ if (!b)
+ {
+ while (((*bar ())[a[*x]] & 0x2000) != 0)
+ (*x)++;
+ if (a[++(*x)] == '-')
+ {
+ (*x)++;
+ if (a[*x] && !((*bar ())[a[*x]] & 0x2000))
+ return '?';
+ }
+ if (!a[*x] || ((*bar ())[a[*x]] & 0x2000))
+ {
+ while (((*bar ())[a[*x]] & 0x2000))
+ ++(*x);
+ return '\0';
+ }
+ }
+
+ r = a[*x];
+ b = a[*x] && !((*bar ())[a[*x]] & 0x2000);
+ return r;
+}
+