This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Disentangle builtin folding from expanding
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, gcc-patches at gcc dot gnu dot org, Paolo Bonzini <bonzini at gnu dot org>
- Date: Thu, 24 Jun 2010 20:39:18 -0700
- Subject: Re: RFA: Disentangle builtin folding from expanding
- References: <Pine.LNX.4.64.0909231656080.15566@wotan.suse.de> <Pine.LNX.4.64.0909232017210.15566@wotan.suse.de> <4ABA6E14.3070509@gnu.org> <Pine.LNX.4.64.0909280125440.15566@wotan.suse.de> <84fc9c000909280226v38c5a60eu15b689dae1bdb644@mail.gmail.com> <Pine.LNX.4.64.0909281454310.15566@wotan.suse.de>
On Mon, Sep 28, 2009 at 5:59 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Mon, 28 Sep 2009, Richard Guenther wrote:
>
>> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? || is_gimple_call (new_stmt))
>> > + ? ? ? ? ? ? ? ? ? ? ? ? ? cgraph_update_edges_for_call_stmt (old_stmt, old_decl, new_stmt);
>> > +
>> > + ? ? ? ? ? ? ? ? ? ? ? ? if (maybe_clean_or_replace_eh_stmt (old_stmt, new_stmt))
>> > + ? ? ? ? ? ? ? ? ? ? ? ? ? gimple_purge_dead_eh_edges (BASIC_BLOCK (first));
>>
>> If that ever happens to replace EH on not the last stmt inserted then
>> we would need to split the block here. ?Thus, this only needs to be done
>> on gsi_stmt (gsi).
>
> Oh right. ?Changed with a largish comment.
>
>> > + ? ? ? ? ? ? else if (fold_stmt (&gsi))
>> > ? ? ? ? ? ? ? ?{
>> > ? ? ? ? ? ? ? ? ?/* Re-read the statement from GSI as fold_stmt() may
>> > ? ? ? ? ? ? ? ? ? ? have changed it. ?*/
>>
>> A much nicer interface to fold_stmt would be
>>
>> bool fold_stmt (gimple stmt, gimple_seq *seq)
>>
>> where if *SEQ is not NULL after the call *SEQ replaces the old stmt,
>> otherwise it is updated in-place.
>
> Yeah, something like that. ?Or a grand fold_and_update_stmt, so that
> callers (the few that are there) don't need to iterate themself.
>
>> But that's for the long awaited cleanup of fold_stmt*
>
> Indeed ;)
>
>> Ok with these changes.
>
> Thanks, committed with the requested changes as r152236.
>
This caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44592
--
H.J.