aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2022-02-24 22:03:38 -0300
committerAlexandre Oliva <oliva@gnu.org>2022-02-24 22:16:56 -0300
commit33c7df5854ecb31e2d645ab672ad3987b591ebfd (patch)
treef2d70e5c918c568e09410a30bcd80483635c1304 /gcc
parenta026b67f8f70d6cf35daf42a4b0909f78c9d7f40 (diff)
downloadgcc-33c7df5854ecb31e2d645ab672ad3987b591ebfd.zip
gcc-33c7df5854ecb31e2d645ab672ad3987b591ebfd.tar.gz
gcc-33c7df5854ecb31e2d645ab672ad3987b591ebfd.tar.bz2
Add testcase from PR103845
This problem was already fixed as part of PR104263: the abnormal edge that remained from before inlining didn't make sense after inlining. So this patch adds only the testcase. for gcc/testsuite/ChangeLog PR tree-optimization/103845 PR tree-optimization/104263 * gcc.dg/pr103845.c: New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/pr103845.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr103845.c b/gcc/testsuite/gcc.dg/pr103845.c
new file mode 100644
index 0000000..45ab518
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr103845.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fharden-compares -fno-ipa-pure-const" } */
+
+int
+baz (void);
+
+__attribute__ ((returns_twice)) void
+bar (void)
+{
+}
+
+int
+quux (int y, int z)
+{
+ return (y || z >= 0) ? y : z;
+}
+
+int
+foo (int x)
+{
+ int a = 0, b = x == a;
+
+ bar ();
+
+ if (!!baz () < quux (b, a))
+ ++x;
+
+ return x;
+}