This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Why can't CSE recognize const_int's in HIGH LO_SUM pair?
- To: law at redhat dot com
- Subject: Re: Why can't CSE recognize const_int's in HIGH LO_SUM pair?
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Mon, 24 Sep 2001 13:02:20 -0400 (EDT)
- Cc: rth at redhat dot com, bernds at redhat dot com, gcc at gcc dot gnu dot org
> (set (reg a) (const_int )) /* High part */
> (set (reg b) (plus (reg a) (const_int)) /* Low part */
>
> Has the advantage of being able to share the high part across multiple
> constant loads, much like we do for symbolic references with offsets.
>
> The only downside I see offhand is CSE knows high/lo_sum is somewhat special,
> but I would expect it to be able to grok the above sequence just as well to
> determine the constant value for (reg b).
A crack at partially implementing the above approach is here:
<http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00906.html>. Most of
the infrastructure to implement it was already in place.
It fixes the fail of 20000731-1.c at -O1. The one clear advantage to
this approach that I can see is that constants expressed in the above
form are recognized during jump expansion.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)