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

--- Comment #15 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---

> Looks like val is being replaced with FRAME.0.val which is incorrect. Yes I
> think there is a DECL_EXPR_DECL on val DECL. though it is NOT correct at
> this point. I think the problem is more related to use of
> force_gimple_operand_gsi here. Which is not needed for a simple DECL.
> extract_component can create the gimple assignment itself.


It's simplied by gimplify_var_or_parm_decl, since gcc takes var is alias of
FRAME.0.val

  /* If the decl is an alias for another expression, substitute it now.  */
  if (DECL_HAS_VALUE_EXPR_P (decl))
    {
      *expr_p = unshare_expr (DECL_VALUE_EXPR (decl));
      return GS_OK;
    }


But somehow nfun here makes FRAME.0.val expanded with different offset of
stack, the mismatch here caused the issue.

        movsd   QWORD PTR [rbp-48], xmm1
        movsd   QWORD PTR [rbp-40], xmm0
        lea     rax, [rbp+16]
        movsd   xmm1, QWORD PTR [rbp-32]
        movsd   xmm0, QWORD PTR [rbp-24]

Reply via email to