* [PATCH] Fix -fcompare-debug failure in fwprop (PR rtl-optimization/54294)
@ 2012-08-17 20:04 Jakub Jelinek
2012-08-18 18:32 ` Paolo Bonzini
2012-08-20 18:47 ` Richard Sandiford
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Jelinek @ 2012-08-17 20:04 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: gcc-patches
Hi!
As discussed in the PR, this patch, originally posted for PR42728,
makes sure the shortcut in all_uses_available_at is used on the same insns
in between -g and -g0, it is the second time a -fcompare-debug failure
resulted from NEXT_INSN being something different with -g, so IMHO it is
desirable to commit this.
Bootstrapped/regtested on x86_64-linux and i686-linux, and in the PR
Uros wrote he bootstrapped/regtested it on alphaev8-linux. Ok for trunk?
Then the PR discussed what to do with the remaining issues, any feedback on
that would be appreciated.
2012-08-17 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/54294
* fwprop.c (all_uses_available_at): Ignore debug insns in between
def_insn and target_insn when checking whether the shortcut is
possible.
--- gcc/fwprop.c.jj 2012-08-15 10:55:21.000000000 +0200
+++ gcc/fwprop.c 2012-08-17 11:15:55.624101951 +0200
@@ -799,13 +799,17 @@ all_uses_available_at (rtx def_insn, rtx
df_ref *use_rec;
struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
rtx def_set = single_set (def_insn);
+ rtx next;
gcc_assert (def_set);
/* If target_insn comes right after def_insn, which is very common
- for addresses, we can use a quicker test. */
- if (NEXT_INSN (def_insn) == target_insn
- && REG_P (SET_DEST (def_set)))
+ for addresses, we can use a quicker test. Ignore debug insns
+ other than target insns for this. */
+ next = NEXT_INSN (def_insn);
+ while (next && next != target_insn && DEBUG_INSN_P (next))
+ next = NEXT_INSN (next);
+ if (next == target_insn && REG_P (SET_DEST (def_set)))
{
rtx def_reg = SET_DEST (def_set);
Jakub
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix -fcompare-debug failure in fwprop (PR rtl-optimization/54294)
2012-08-17 20:04 [PATCH] Fix -fcompare-debug failure in fwprop (PR rtl-optimization/54294) Jakub Jelinek
@ 2012-08-18 18:32 ` Paolo Bonzini
2012-08-20 18:47 ` Richard Sandiford
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2012-08-18 18:32 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: gcc-patches
Il 17/08/2012 22:00, Jakub Jelinek ha scritto:
> Hi!
>
> As discussed in the PR, this patch, originally posted for PR42728,
> makes sure the shortcut in all_uses_available_at is used on the same insns
> in between -g and -g0, it is the second time a -fcompare-debug failure
> resulted from NEXT_INSN being something different with -g, so IMHO it is
> desirable to commit this.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, and in the PR
> Uros wrote he bootstrapped/regtested it on alphaev8-linux. Ok for trunk?
Can't approve, but it looks like the right approach since debug insns
aren't "real" defs.
Paolo
> Then the PR discussed what to do with the remaining issues, any feedback on
> that would be appreciated.
>
> 2012-08-17 Jakub Jelinek <jakub@redhat.com>
>
> PR rtl-optimization/54294
> * fwprop.c (all_uses_available_at): Ignore debug insns in between
> def_insn and target_insn when checking whether the shortcut is
> possible.
>
> --- gcc/fwprop.c.jj 2012-08-15 10:55:21.000000000 +0200
> +++ gcc/fwprop.c 2012-08-17 11:15:55.624101951 +0200
> @@ -799,13 +799,17 @@ all_uses_available_at (rtx def_insn, rtx
> df_ref *use_rec;
> struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
> rtx def_set = single_set (def_insn);
> + rtx next;
>
> gcc_assert (def_set);
>
> /* If target_insn comes right after def_insn, which is very common
> - for addresses, we can use a quicker test. */
> - if (NEXT_INSN (def_insn) == target_insn
> - && REG_P (SET_DEST (def_set)))
> + for addresses, we can use a quicker test. Ignore debug insns
> + other than target insns for this. */
> + next = NEXT_INSN (def_insn);
> + while (next && next != target_insn && DEBUG_INSN_P (next))
> + next = NEXT_INSN (next);
> + if (next == target_insn && REG_P (SET_DEST (def_set)))
> {
> rtx def_reg = SET_DEST (def_set);
>
>
> Jakub
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix -fcompare-debug failure in fwprop (PR rtl-optimization/54294)
2012-08-17 20:04 [PATCH] Fix -fcompare-debug failure in fwprop (PR rtl-optimization/54294) Jakub Jelinek
2012-08-18 18:32 ` Paolo Bonzini
@ 2012-08-20 18:47 ` Richard Sandiford
1 sibling, 0 replies; 3+ messages in thread
From: Richard Sandiford @ 2012-08-20 18:47 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Paolo Bonzini, gcc-patches
Jakub Jelinek <jakub@redhat.com> writes:
> 2012-08-17 Jakub Jelinek <jakub@redhat.com>
>
> PR rtl-optimization/54294
> * fwprop.c (all_uses_available_at): Ignore debug insns in between
> def_insn and target_insn when checking whether the shortcut is
> possible.
OK, thanks.
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-20 18:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-17 20:04 [PATCH] Fix -fcompare-debug failure in fwprop (PR rtl-optimization/54294) Jakub Jelinek
2012-08-18 18:32 ` Paolo Bonzini
2012-08-20 18:47 ` Richard Sandiford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).