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

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
The problem is that late SRA replaces scalar loads from constant pool
by replacements but fails to add their initializations to the
beginning of the function.

The reason for the omission is that
initialize_constant_pool_replacements only adds those for variables in
should_scalarize_away_bitmap but that bitmap was intended only as a
hint for total scalarization and a variable does not end up there if
only scalars are read from it.

Removing that condition fixes the bug.  In fact, even the
cannot_scalarize_away_bitmap seems wrong to me for the very same reason.

Reply via email to