public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "stefansf at linux dot ibm.com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/100960] var-tracking: parameter location in subregister not tracked Date: Thu, 11 Aug 2022 09:22:43 +0000 [thread overview] Message-ID: <bug-100960-4-BwiZFo6Q4I@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-100960-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100960 --- Comment #4 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> --- I really like the idea of enhancing cselib since there is a chance that other passes might profit from it, too. The following patch fixes the initial reported problem: diff --git a/gcc/cselib.cc b/gcc/cselib.cc index 6a5609786fa..64b6996a299 100644 --- a/gcc/cselib.cc +++ b/gcc/cselib.cc @@ -1569,6 +1569,25 @@ new_cselib_val (unsigned int hash, machine_mode mode, rtx x) e->locs = 0; e->next_containing_mem = 0; + scalar_int_mode int_mode; + if (REG_P (x) && is_int_mode (mode, &int_mode) && REG_VALUES (REGNO (x)) != NULL + && (!cselib_current_insn || !DEBUG_INSN_P (cselib_current_insn))) + { + rtx copy = shallow_copy_rtx (x); + scalar_int_mode narrow_mode; + FOR_EACH_MODE_UNTIL(narrow_mode, int_mode) + { + PUT_MODE_RAW (copy, narrow_mode); + cselib_val *v = cselib_lookup (copy, narrow_mode, 0, VOIDmode); + if (v) + { + rtx sub = lowpart_subreg (narrow_mode, e->val_rtx, int_mode); + if (sub) + new_elt_loc_list (v, sub); + } + } + } + if (dump_file && (dump_flags & TDF_CSELIB)) { fprintf (dump_file, "cselib value %u:%u ", e->uid, hash); So I get the subvalue relation between 5:5 and 14:14 (was initially 15:15 but changed meanwhile due to new GCC version) (value/u:SI 5:5 @0x4f906e0/0x4f80730) locs: from insn 17 (subreg:SI (value/u:DI 14:14 @0x4f907b8/0x4f808e0) 4) from insn 1 (value/u:SI 6:263 @0x4f906f8/0x4f80760) from insn 1 (entry_value:SI (reg:SI 2 %r2 [ xD.2274 ])) no addrs
next prev parent reply other threads:[~2022-08-11 9:22 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-08 8:33 [Bug debug/100960] New: " stefansf at linux dot ibm.com 2021-06-08 8:53 ` [Bug debug/100960] " rguenth at gcc dot gnu.org 2021-06-08 9:14 ` jakub at gcc dot gnu.org 2021-06-08 9:48 ` jakub at gcc dot gnu.org 2022-08-11 9:22 ` stefansf at linux dot ibm.com [this message] 2022-08-11 9:25 ` stefansf at linux dot ibm.com 2022-08-11 9:27 ` stefansf at linux dot ibm.com
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-100960-4-BwiZFo6Q4I@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: linkBe 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).