public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103837] [9/10/11/12 Regression] '-fcompare-debug' failure (length) w/ -Og -fmove-loop-invariants -fnon-call-exceptions -fno-tree-dce
Date: Mon, 27 Dec 2021 12:19:26 +0000	[thread overview]
Message-ID: <bug-103837-4-YIRbFTgaj9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103837-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The loop body is:
(code_label 10026 4 10019 3 4 (nil) [0 uses])
(note 10019 10026 5 3 [bb 3] NOTE_INSN_BASIC_BLOCK)
(debug_insn 5 10019 6 3 (var_location:DF a (reg/v:DF 84 [ a ])) -1
     (nil))
(debug_insn 6 5 7 3 (debug_marker) "pr103837.c":8:3 -1
     (nil))
(debug_insn 7 6 17 3 (debug_marker) "pr103837.c":10:7 -1
     (nil))
(debug_insn 17 7 16 3 (var_location:SI D#6 (fix:SI (reg/v:DF 84 [ a ]))) -1
     (nil))
(debug_insn 16 17 15 3 (var_location:SI D#5 (debug_expr:SI D#6)) -1
     (nil))
(debug_insn 15 16 14 3 (var_location:CCZ D#4 (compare:CCZ (debug_expr:SI D#5)
        (const_int 0 [0]))) -1
     (nil))
(debug_insn 14 15 13 3 (var_location:QI D#3 (ne:QI (debug_expr:CCZ D#4)
        (const_int 0 [0]))) -1
     (nil))
(debug_insn 13 14 12 3 (var_location:QI D#2 (debug_expr:QI D#3)) -1
     (nil))
(debug_insn 12 13 8 3 (var_location:SI D#1 (zero_extend:SI (debug_expr:QI
D#2))) -1
     (nil))
(debug_insn 8 12 9 3 (var_location:SI b (debug_expr:SI D#1)) "pr103837.c":10:9
-1
     (nil))
(debug_insn 9 8 10025 3 (debug_marker) "pr103837.c":11:7 -1
     (nil))
(insn 10025 9 10 3 (set (reg/v:DF 84 [ a ])
        (float:DF (reg/v:SI 88 [ x ]))) "pr103837.c":11:9 207 {*floatsidf2}
     (nil))
(debug_insn 10 10025 11 3 (var_location:DF a (reg/v:DF 84 [ a ]))
"pr103837.c":11:9 -1
     (nil))
(debug_insn 11 10 0 3 (debug_marker) "pr103837.c":8:3 -1
     (nil))

and because of the uninitialized a there is a DEBUG_INSN use of pseudo 84 e.g.
in insns 5 and 17 before it is actually initialized in insn 10025.
Ignoring DEBUG_INSNs in can_move_invariant_reg in the for (use =
DF_REG_USE_CHAIN (dest_regno); use; use = DF_REF_NEXT_REG (use)) loop is
trivial, the big question is what shall we do with those debug insns.
For this particular case where it is uninitialized, I bet either resetting or
keeping them as is would be fine.
But my understanding of can_move_invariant_reg is that we could have:
  pseudo = whatever1;
  loop_header
    debug_insn use pseudo;
    pseudo = whatever2;
    use pseudo;
  loop_end
and in that case moving the invariant without resetting the debug insns would
be wrong:
  pseudo = whatever1;
  pseudo = whatever2;
  loop_header
    debug_insn use pseudo;
    use pseudo;
  loop_end

  parent reply	other threads:[~2021-12-27 12:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-26 16:45 [Bug debug/103837] New: [12 " asolokha at gmx dot com
2021-12-26 21:10 ` [Bug debug/103837] " pinskia at gcc dot gnu.org
2021-12-27 11:28 ` [Bug tree-optimization/103837] [9/10/11/12 " jakub at gcc dot gnu.org
2021-12-27 11:35 ` pinskia at gcc dot gnu.org
2021-12-27 11:40 ` jakub at gcc dot gnu.org
2021-12-27 12:19 ` jakub at gcc dot gnu.org [this message]
2021-12-27 12:50 ` [Bug rtl-optimization/103837] " jakub at gcc dot gnu.org
2021-12-28 16:40 ` cvs-commit at gcc dot gnu.org
2021-12-28 16:43 ` [Bug rtl-optimization/103837] [9/10/11 " jakub at gcc dot gnu.org
2022-01-04 13:37 ` rguenth at gcc dot gnu.org
2022-01-24  9:20 ` cvs-commit at gcc dot gnu.org
2022-01-24  9:30 ` [Bug rtl-optimization/103837] [9/10 " jakub at gcc dot gnu.org
2022-05-10  8:22 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:23 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:36 ` jakub 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-103837-4-YIRbFTgaj9@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).