summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr46878-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr46878-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr46878-1.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr46878-1.c b/gcc/testsuite/gcc.dg/pr46878-1.c
new file mode 100644
index 000000000..f5b42de11
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46878-1.c
@@ -0,0 +1,30 @@
+/* PR rtl-optimization/46878 */
+/* Make sure this doesn't ICE. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct baz
+{
+ int *newp;
+};
+
+int
+get_ice (int *op, struct baz *ret)
+{
+ int *tmpp;
+ int c;
+ c = (__foo () != 1);
+ if (__bar ())
+ {
+ return (1);
+ }
+ if (c)
+ tmpp = op;
+ if (tmpp)
+ {
+ }
+ else if (c)
+ {
+ ret->newp = tmpp;
+ }
+}