https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95526

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
                 CC|                            |rearnsha at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
           Keywords|                            |patch
           Priority|P3                          |P1
           Assignee|rguenth at gcc dot gnu.org         |unassigned at gcc dot 
gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Indeed.  Diff from gcc 10 on the stdarg output is:

-  REALPART_EXPR <ha.3> = _21;
-  _23 = ap.__vr_top;
-  _24 = (sizetype) _13;
-  _25 = _24 + 16;
-  _26 = _23 + _25;
-  _27 = MEM[(float *)_26];
-  MEM[(float *)&ha.3 + 4B] = _27;
-  iftmp.5_29 = &ha.3;
+  _23 = IMAGPART_EXPR <ha.3_22(D)>;
+  ha.3_24 = COMPLEX_EXPR <_21, _23>;
+  _25 = ap.__vr_top;
+  _26 = (sizetype) _13;
+  _27 = _26 + 16;
+  _28 = _25 + _27;
+  _29 = MEM[(float *)_28];
+  MEM[(float *)&ha.6 + 4B] = _29;
+  ha.6 = ha.3_24;
+  iftmp.5_32 = &ha.6;

note how the trunk version overwrites ha.6 with ha.3_24 which contains only
the REALPART while the imagpart write is lost.

And the following fixes the latent bug - we failed to mark 'ha.6'
TREE_ADDRESSABLE (address-taken):

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 6352d4ff78a..97da6076239 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);


I'm not set up for aarch64 bootstrap / retest.  Richard, can you take
the honors here?  Thanks.

Reply via email to