This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [-ftree-cselim desoptimizes SH code
On Mon, Sep 28, 2009 at 11:28 AM, Christian BRUEL
<christian.bruel@st.com> wrote:
> yes, but it's not only the call. this optimization makes a lot of bets about
> what will DSE to be profitable. For instance any may alias memory operation
> in the path such as
>
> foo(int *a, int r)
> {
> ? ?*a = 0;
> ? ?*pt = 2;
> ? ?if (r)
> ? ? ?*a = r;
> }
>
> is enough to void the benefits of this optimisation, with or without ifc.
Sure, that's an area where the pass could be improved (well, with
the obvious impact on compile-time). And if it does that it probably
can as well eliminate the redundant load as well. Which makes me
think that this variant of store-sinking may fit into the PRE framework
(it's really a sort of partially dead code elimination).
Richard.