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

--- Comment #9 from Alan Modra <amodra at gmail dot com> ---
As far as fixing the real underlying problem goes, I'm not so familiar with the
darwin support that I can state with certainty that you need to fix movdi_low
and friends.

It might help to explain why powerpc64-linux -mcmodel=medium code doesn't hit
the intrinsic_unpack problem even though the resultant code looks very similar
to darwin code.  We don't see a similar propagation of offset into memory load
because legitimate_addres_p() says that isn't valid.  It isn't valid because
legitimate_constant_pool_address_p (also handles toc-relative medium model
addresses) checks alignment.  So fwprop and combine don't create the problem
memory loads in the first place.  However, if we did see such a memory load,
reload would fix it for us due to the predicate and constraints in
movdi_internal64.  Note that having legitimate_address_p() prevent these
addresses does mean we lose some optimization opportunites, but on the other
hand, if we allowed everything early we'd end up with lots of reloads and
probably worse code.

You may be able to do something similar in legitimate_address_p for darwin.

Reply via email to