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 target/103808] [12 Regression] '-fcompare-debug' failure (length) w/ -O2 -ftrapv since r12-5944-ga7acb6dca941db2b
Date: Tue, 28 Dec 2021 18:37:17 +0000	[thread overview]
Message-ID: <bug-103808-4-0xqsVM9Ubs@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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It starts during var-tracking and not ix86_reorg.
The problem is we have:
(debug_insn 110 103 104 4 (var_location:TI D#2 (reg:TI 6 bp [orig:111 x ]
[111])) -1
     (nil))
and
(debug_insn 25 24 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))
I guess it is originally from a paradoxical subreg or what, but RA can't
because of debug insns decide differently and not allocate pseudo 111 into bp
register.
When var-tracking.c attempts to simplify the (subreg:DI (reg:TI 6 bp [orig:111
x ] [111]) 8)
simplify-rtx.c calls gen_rtx_REG_offset which calls gen_rtx_REG and that
returns stack_pointer_rtx and later the function changes REG_ATTRS on that
shared rtx.
That is just wrong.
So, IMHO either gen_rtx_REG_offset should be changed to call gen_raw_REG
instead of gen_rtx_REG, or alternatively it shouldn't call update_reg_offset if
gen_rtx_REG returned one of the shared rtxes
({{frame,hard_frame,arg,return_address,stack}_pointer,pic_offset_table}_rtx).

  parent reply	other threads:[~2021-12-28 18:37 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 [this message]
2021-12-30 13:36 ` [Bug debug/103808] " cvs-commit at gcc dot gnu.org
2021-12-30 13:40 ` 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-0xqsVM9Ubs@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).