public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/103808] [12 Regression] '-fcompare-debug' failure (length) w/ -O2 -ftrapv since r12-5944-ga7acb6dca941db2b Date: Thu, 30 Dec 2021 13:36:14 +0000 [thread overview] Message-ID: <bug-103808-4-WimA7wmyD0@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103808-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103808 --- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:52441f18db7e051c16f2e6e12f415b93cb5450c4 commit r12-6153-g52441f18db7e051c16f2e6e12f415b93cb5450c4 Author: Jakub Jelinek <jakub@redhat.com> Date: Thu Dec 30 14:35:06 2021 +0100 emit-rtl: Fix a -fcompare-debug issue due to var-tracking [PR103808] We get a -fcompare-debug FAIL on the following testcase. The problem is that during cprop we get when a TImode pseudo holding x is being constructed: (debug_insn 111 59 103 7 (var_location:TI D#2 (clobber (const_int 0 [0]))) -1 (nil)) (insn 103 111 110 7 (clobber (reg/v:TI 89 [ x ])) "pr103808.c":8:9 -1 (nil)) (debug_insn 110 103 104 7 (var_location:TI D#2 (subreg:TI (reg:DI 111 [ x ]) 0)) -1 (nil)) (insn 104 110 109 7 (set (subreg:DI (reg/v:TI 89 [ x ]) 0) (reg:DI 111 [ x ])) "pr103808.c":8:9 80 {*movdi_internal} (expr_list:REG_DEAD (reg:DI 111 [ x ]) (nil))) Now, during RA that paradoxical subreg in a debug insn obviously can't affect where pseudo 111 is allocated and RA puts it into the bp register, so we have: (debug_insn 110 111 109 4 (var_location:TI D#2 (reg:TI 6 bp [orig:111 x ] [111])) -1 (nil)) Now, during var-tracking when we for: (debug_insn 25 23 26 3 (var_location:TI x (concatn/v:TI [ (reg:DI 6 bp [orig:111 x ] [111]) (subreg:DI (debug_expr:TI D#2) 8) ])) "pr103808.c":8:9 -1 (nil)) try to simplify the highpart subreg of bp, gen_rtx_REG_offset is called in: if (HARD_REGISTER_NUM_P (final_regno)) { rtx x = gen_rtx_REG_offset (op, outermode, final_regno, subreg_memory_offset (outermode, innermode, byte)); and that unfortunately sets REG_ATTRS on stack_pointer_rtx, because gen_rtx_REG_offset uses gen_rtx_REG which for Pmode STACK_POINTER_REGNUM returns stack_pointer_rtx rather than newly created register. The clobbering of REG_ATTRS on the shared stack_pointer_rtx then shows up in the dumps as (reg/f:DI 7 sp [ x+8 ]) instead of (reg/f:DI 7 sp) that shows up without var-tracking. Clobbering of REG_ATTRS on the shared *_pointer_rtx looks just wrong. So, IMHO either simplify_gen_subreg -> gen_rtx_REG_offset should call gen_raw_REG to make sure we get a new non-shared REG we can set REG_ATTRS on, or we should make sure that we don't overwrite the REG_ATTRS on the shared REGs (but then simplify_gen_subreg shouldn't try to overwrite ORIGINAL_REGNO on those either). For non-DEBUG_INSNs, I'd hope this never happens, the RA shouldn't allocate multi-word regs overlapping with stack pointer, hard frame pointer etc. 2021-12-30 Jakub Jelinek <jakub@redhat.com> PR debug/103808 * emit-rtl.c (gen_rtx_REG_offset): Use gen_raw_REG instead of gen_rtx_REG. * gcc.dg/pr103808.c: New test.
next prev parent reply other threads:[~2021-12-30 13:36 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-12-22 17:08 [Bug debug/103808] New: [12 Regression] '-fcompare-debug' failure (length) w/ -O2 -ftrapv asolokha at gmx dot com 2021-12-22 21:18 ` [Bug middle-end/103808] " pinskia at gcc dot gnu.org 2021-12-22 23:34 ` [Bug target/103808] " pinskia at gcc dot gnu.org 2021-12-22 23:36 ` pinskia at gcc dot gnu.org 2021-12-22 23:57 ` pinskia at gcc dot gnu.org 2021-12-23 8:32 ` [Bug target/103808] [12 Regression] '-fcompare-debug' failure (length) w/ -O2 -ftrapv since r12-5944-ga7acb6dca941db2b marxin at gcc dot gnu.org 2021-12-28 18:37 ` jakub at gcc dot gnu.org 2021-12-30 13:36 ` cvs-commit at gcc dot gnu.org [this message] 2021-12-30 13:40 ` [Bug debug/103808] " 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-103808-4-WimA7wmyD0@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).