This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 40/50] rtlanal.c:for_each_inc_dec
- From: Jeff Law <law at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, rdsandiford at googlemail dot com
- Date: Wed, 06 Aug 2014 12:33:50 -0600
- Subject: Re: [PATCH 40/50] rtlanal.c:for_each_inc_dec
- Authentication-results: sourceware.org; auth=none
- References: <87y4v5d77q dot fsf at googlemail dot com> <8761i97ieu dot fsf at googlemail dot com>
On 08/03/14 08:32, Richard Sandiford wrote:
The old for_each_inc_dec callback had a for_each_rtx-like return value,
with >0 being returned directly, 0 meaning "continue" and <0 meaning
"skip subrtxes". But there's no reason to distinguish the latter two
cases since auto-inc/dec expressions aren't allowed to contain other
auto-inc/dec expressions. And if for_each_rtx is going away, there's
no longer any consistency argument for using the same interface.
* rtl.h (for_each_inc_dec_fn): Remove special case for -1.
* cselib.c (cselib_record_autoinc_cb): Update accordingly.
* dse.c (emit_inc_dec_insn_before, check_for_inc_dec_1)
* rtlanal.c (for_each_inc_dec_ops): Delete.
(for_each_inc_dec_find_inc_dec): Take the MEM as argument,
rather than a pointer to the memory address. Replace
for_each_inc_dec_ops argument with separate function and data
arguments. Abort on non-autoinc addresses.
(for_each_inc_dec): Use FOR_EACH_SUBRTX_VAR to visit every
So this patch has me a little bit concerned.
So wouldn't this miss an autoincrement operation embedded in a note,
such as a REG_EQUAL note? My memory is very fuzzy here, but I can't
recall any policy which prohibits an autoincrement addressing mode from
appearing in a REG_EQUAL note. Worse yet, I have vague memories of
embedded side effects actually showing up in REG_EQUAL notes.
@@ -2523,7 +2523,7 @@ cselib_record_sets (rtx insn)
data.sets = sets;
data.n_sets = n_sets_before_autoinc = n_sets;
- for_each_inc_dec (&insn, cselib_record_autoinc_cb, &data);
+ for_each_inc_dec (&PATTERN (insn), cselib_record_autoinc_cb, &data);
n_sets = data.n_sets;
Similarly for other places where you're passing down the pattern rather
than the insn itself.
Thoughts/comments? Does this trigger any disturbing memories for anyone