diff mbox series

aarch64: PR target/95526: Fix gimplification of varargs

Message ID 20200604153218.34awo57dspk3nnj5@arm.com
State New
Headers show
Series aarch64: PR target/95526: Fix gimplification of varargs | expand

Commit Message

Alex Coplan June 4, 2020, 3:32 p.m. UTC
This patch fixes a latent bug exposed by
eb72dc663e9070b281be83a80f6f838a3a878822 in the aarch64 backend that was
causing wrong codegen and several testsuite failures. See the discussion
on the bug for details.

Bootstrapped and regtested on aarch64-linux-gnu. Cleaned up several failing
tests and no new fails introduced:

+PASS: gcc.dg/compat/scalar-by-value-3 c_compat_x_tst.o-c_compat_y_tst.o execute
+PASS: gcc.dg/compat/scalar-by-value-4 c_compat_x_tst.o-c_compat_y_tst.o execute
+PASS: gcc.dg/compat/scalar-by-value-5 c_compat_x_tst.o-c_compat_y_tst.o execute
+PASS: gcc.dg/compat/scalar-by-value-6 c_compat_x_tst.o-c_compat_y_tst.o execute
+PASS: gcc.dg/compat/scalar-return-3 c_compat_x_tst.o-c_compat_y_tst.o execute
+PASS: gcc.dg/compat/scalar-return-4 c_compat_x_tst.o-c_compat_y_tst.o execute
+PASS: gcc.dg/complex-1.c execution test
+PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution,  -O0
+PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution,  -O1
+PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution,  -O2
+PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution,  -O3 -g
+PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution,  -Og -g
+PASS: gcc.target/aarch64/aapcs64/va_arg-7.c execution,  -Os

Pre-approved on bugzilla: committing to master.

Thanks,
Alex

---

2020-06-04  Richard Biener  <rguenther@suse.de>

gcc/ChangeLog:

        * config/aarch64/aarch64.c (aarch64_gimplify_va_arg_expr):
          Ensure that tmp_ha is marked TREE_ADDRESSABLE.

---
diff mbox series

Patch

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 6352d4f..97da607 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -16370,6 +16370,7 @@  aarch64_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
 	}
 
       /* *(field_ptr_t)&ha = *((field_ptr_t)vr_saved_area  */
+      TREE_ADDRESSABLE (tmp_ha) = 1;
       tmp_ha = build1 (ADDR_EXPR, field_ptr_t, tmp_ha);
       addr = t;
       t = fold_convert (field_ptr_t, addr);