public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/99863] [10/11 Regression] wrong code with -O -fno-tree-forwprop -mno-sse2 since r10-7268-g529ea7d9596b26ba
Date: Thu, 01 Apr 2021 12:45:47 +0000	[thread overview]
Message-ID: <bug-99863-4-V1cS9otJV9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99863-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99863

--- Comment #11 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 1 Apr 2021, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99863
> 
> Jakub Jelinek <jakub at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |jakub at gcc dot gnu.org
> 
> --- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> I think the REG_DEAD note isn't the problem here.
> At least, when I dump bb 2 in rest_of_handle_dse right before df_analyze call,
> there is
> (insn 6 3 7 2 (set (reg:CCZ 17 flags)
>         (compare:CCZ (reg/v:DI 203 [ y ])
>             (const_int 0 [0]))) "pr99863.c":14:12 8 {*cmpdi_ccno_1}
>      (nil))
> (insn 7 6 8 2 (set (reg:QI 205)
>         (eq:QI (reg:CCZ 17 flags)
>             (const_int 0 [0]))) "pr99863.c":14:12 802 {*setcc_qi}
>      (expr_list:REG_DEAD (reg:CCZ 17 flags)
>         (nil)))
> ...
> (insn 40 38 41 2 (set (reg:QI 220)
>         (ne:QI (reg:CCZ 17 flags)
>             (const_int 0 [0]))) "pr99863.c":15:11 802 {*setcc_qi}
>      (expr_list:REG_DEAD (reg:CCZ 17 flags)
>         (nil)))
> but if I dump it right after df_analyze call, I see:
> (insn 6 3 7 2 (set (reg:CCZ 17 flags)
>         (compare:CCZ (reg/v:DI 203 [ y ])
>             (const_int 0 [0]))) "pr99863.c":14:12 8 {*cmpdi_ccno_1}
>      (expr_list:REG_DEAD (reg/v:DI 203 [ y ])
>         (nil)))
> (insn 7 6 8 2 (set (reg:QI 205)
>         (eq:QI (reg:CCZ 17 flags)
>             (const_int 0 [0]))) "pr99863.c":14:12 802 {*setcc_qi}
>      (nil))
> ...
> (insn 40 38 41 2 (set (reg:QI 220)
>         (ne:QI (reg:CCZ 17 flags)
>             (const_int 0 [0]))) "pr99863.c":15:11 802 {*setcc_qi}
>      (expr_list:REG_DEAD (reg:CCZ 17 flags)
>         (nil)))
> 
> i.e. the problematic REG_DEAD note is gone and I think at this point DF knows
> that CC is live there.
> But replace_read has code to check for live hard regs, see
> note_stores (this_insn, look_for_hardregs, regs_set);
> in there etc.

But find_shift_sequence doesn't seem to check whether the emitted
insns contain any extra hardreg clobbers that make the replacement
invalid.

  parent reply	other threads:[~2021-04-01 12:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  8:44 [Bug target/99863] New: [10/11 Regression] wrong code with -O -fno-tree-forwprop -mno-sse2 zsojka at seznam dot cz
2021-04-01  9:01 ` [Bug target/99863] " rguenth at gcc dot gnu.org
2021-04-01  9:14 ` rguenth at gcc dot gnu.org
2021-04-01  9:58 ` rguenth at gcc dot gnu.org
2021-04-01 10:02 ` [Bug target/99863] [10/11 Regression] wrong code with -O -fno-tree-forwprop -mno-sse2 since r10-7268-g529ea7d9596b26ba marxin at gcc dot gnu.org
2021-04-01 10:24 ` rguenth at gcc dot gnu.org
2021-04-01 10:45 ` [Bug rtl-optimization/99863] " rguenth at gcc dot gnu.org
2021-04-01 10:47 ` cvs-commit at gcc dot gnu.org
2021-04-01 11:16 ` ebotcazou at gcc dot gnu.org
2021-04-01 11:28 ` ebotcazou at gcc dot gnu.org
2021-04-01 12:26 ` jakub at gcc dot gnu.org
2021-04-01 12:45 ` rguenther at suse dot de [this message]
2021-04-01 13:01 ` jakub at gcc dot gnu.org
2021-04-01 13:23 ` jakub at gcc dot gnu.org
2021-04-01 13:27 ` jakub at gcc dot gnu.org
2021-04-01 13:32 ` rguenther at suse dot de
2021-04-01 13:35 ` jakub at gcc dot gnu.org
2021-04-01 13:54 ` jakub at gcc dot gnu.org
2021-04-03  8:07 ` cvs-commit at gcc dot gnu.org
2021-04-03  8:16 ` [Bug rtl-optimization/99863] [10 " jakub at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2021-04-20  9:45 ` cvs-commit at gcc dot gnu.org
2021-04-20  9:50 ` jakub at gcc dot gnu.org
2021-04-20 23:34 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:52 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-99863-4-V1cS9otJV9@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).