public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/104228] [9/10/11/12 Regression] ICE in df_install_ref, at df-scan.cc:2294
Date: Wed, 26 Jan 2022 07:49:31 +0000	[thread overview]
Message-ID: <bug-104228-4-DkEs3gvClj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104228-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Target Milestone|---                         |9.5
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-01-26

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
(gdb) p debug_rtx (insn)
(insn 5 2 6 2 (parallel [
            (set (reg:DI 94)
                (plus:DI (reg:DI 244)
                    (const_int -112 [0xffffffffffffff90])))
            (clobber (reg:CC 17 flags))
        ]) "t.f90":1:9 230 {*adddi_1}
     (nil))

and we reference reg 244 but reg_info for this reg is NULL.  The insn is the
first in the BB and reg:DI 244 doesn't seem to be initialized.

The instruction is expanded from

;; _10 = &FRAME.16.FRAME_BASE.PARENT;

(insn 5 4 6 (parallel [
            (set (reg:DI 94)
                (plus:DI (reg:DI 244)
                    (const_int -112 [0xffffffffffffff90])))
            (clobber (reg:CC 17 flags))
        ]) "t.f90":1:9 -1
     (nil)) 

(insn 6 5 0 (parallel [
            (set (reg/f:DI 88 [ _10 ])
                (plus:DI (reg:DI 94)
                    (const_int 64 [0x40])))
            (clobber (reg:CC 17 flags))
        ]) "t.f90":1:9 -1
     (nil))

and the underlying issue is a shared FRAME.16 local used in two functions
I think:

__attribute__((fn spec (". ")))
voidD.27 sD.4214 ()
{
..
  struct FRAME.p FRAME.16D.4307;


...
__attribute__((fn spec (". ")))
voidD.27 pD.4212 ()
{
  struct FRAME.p FRAME.16D.4307;
...
  struct array01_character(kind=1) yD.4238 [value-expr:
FRAME.16D.4307.yD.4308];

where the frame is unused in 's' but likely expanded there and then
the expansion is used in the wrong function.

Without asan the references are likely optimized away.


Note in .original from the FE we see the shared variable is 'y':

void s ()
{
  {
    static integer(kind=8)D.9 .yD.4216;
    struct array01_character(kind=1) yD.4238;
...

void p ()
{
  static voidD.27 sD.4214 (void);
  struct array01_character(kind=1) yD.4238;
...

where that 'y' is unused in 'p'.

  reply	other threads:[~2022-01-26  7:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 18:04 [Bug fortran/104228] New: " gscfq@t-online.de
2022-01-26  7:49 ` rguenth at gcc dot gnu.org [this message]
2022-01-26  8:25 ` [Bug fortran/104228] [9/10/11/12 Regression] ICE in df_install_ref, at df-scan.cc:2294 since r8-3589-g707905d0773e5a8e marxin at gcc dot gnu.org
2022-01-28 15:42 ` jakub at gcc dot gnu.org
2022-01-28 15:52 ` jakub at gcc dot gnu.org
2022-01-28 16:19 ` jakub at gcc dot gnu.org
2022-01-28 21:19 ` mikael at gcc dot gnu.org
2022-02-13 16:01 ` cvs-commit at gcc dot gnu.org
2022-03-09 13:22 ` [Bug fortran/104228] [9/10/11 " rguenth at gcc dot gnu.org
2022-03-19 20:17 ` cvs-commit at gcc dot gnu.org
2022-04-10 18:48 ` cvs-commit at gcc dot gnu.org
2022-04-10 18:48 ` cvs-commit at gcc dot gnu.org
2022-04-24 16:54 ` cvs-commit at gcc dot gnu.org
2022-05-09 11:22 ` cvs-commit at gcc dot gnu.org
2022-05-09 11:27 ` mikael 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-104228-4-DkEs3gvClj@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).