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

--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> ---
What happens is that ipa_param_body_adjustments::modify_call_stmt
is confused by the IPA-CP produced scalar constant where it expects a
structure containing just one field of the corresponding type.

It is easy to avoid the situation altogether with just the following
but it means that the caller (in the example func_6) will not entirely
lose the parameter even though we know its contents at compile time
and could re-construct it for the purposes of the call (of func_12).
But the behavior is not worse than GCC 12 and before, so the patch is
probably the right thing to do in stage 4.


diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc
index 7a2b4dc8608..822fd6262d6 100644
--- a/gcc/ipa-sra.cc
+++ b/gcc/ipa-sra.cc
@@ -3989,7 +3989,7 @@ push_param_adjustments_for_index (isra_func_summary *ifs,
unsigned base_index,
        {
          ipa_argagg_value_list avl (ipcp_ts);
          tree value = avl.get_value (base_index, pa->unit_offset);
-         if (value)
+         if (value && !AGGREGATE_TYPE_P (pa->type))
            {
              if (dump_file)
                fprintf (dump_file, "    - omitting component at byte "

Reply via email to