aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorAndrew Pinski <quic_apinski@quicinc.com>2024-01-20 11:39:11 -0800
committerAndrew Pinski <quic_apinski@quicinc.com>2024-01-20 11:39:11 -0800
commit17473a93cff5340acfc293299a2f9a5857a50909 (patch)
tree6fc5133b16554e1586463bc1c4089436f080e173 /gcc/testsuite/gcc.c-torture
parent6930e1f1055c39bea170c25f694f7301989e5d1d (diff)
downloadgcc-17473a93cff5340acfc293299a2f9a5857a50909.zip
gcc-17473a93cff5340acfc293299a2f9a5857a50909.tar.gz
gcc-17473a93cff5340acfc293299a2f9a5857a50909.tar.bz2
ipa: Add testcase for already fixed case [PR110705]
This testcase was fixed with r13-1695-gb0f02eeb906b63 which added an Ada testcase for the issue but adding a C testcase is a good idea and that is what this does. Committed after making sure it passes on x86_64-linux-gnu. PR ipa/110705 gcc/testsuite/ChangeLog: * gcc.c-torture/compile/pr110705-1.c: New test. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr110705-1.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr110705-1.c b/gcc/testsuite/gcc.c-torture/compile/pr110705-1.c
new file mode 100644
index 0000000..6c0029c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr110705-1.c
@@ -0,0 +1,27 @@
+/* PR ipa/110705 */
+
+/* We used to ICE in gimplify_modify_expr due to
+ the gimplifier not handling VCE between an struct
+ and an integer type. */
+
+struct a {
+ long b;
+};
+union d {
+ struct a b;
+ int e;
+}v;
+long c;
+int f;
+static void g(union d h, long i) {
+ while (1)
+ switch (c)
+ case 4:
+ if (h.e)
+ c = 4;
+}
+void j(union d *h) {
+ if (f)
+ g(*h, h->b.b);
+}
+void k() { union d *h = &v; j(h); }