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 middle-end/101624] [9/10 Regression] ICE: tree check: expected tree that contains 'decl with RTL' structure, have 'const_decl' in maybe_optimize_ubsan_ptr_ifn, at sanopt.c:495
Date: Wed, 11 May 2022 06:22:01 +0000	[thread overview]
Message-ID: <bug-101624-4-S5KO1VKYe9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101624-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:cbf39efadbc9f07b639856f1ee367e3756f8df99

commit r9-10096-gcbf39efadbc9f07b639856f1ee367e3756f8df99
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jul 28 18:43:15 2021 +0200

    ubsan: Fix ICEs with DECL_REGISTER tests [PR101624]

    The following testcase ICEs, because the base is a CONST_DECL for
    the Fortran parameter, and ubsan/sanopt uses DECL_REGISTER macro on it.
     /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'.  */
     #define DECL_REGISTER(NODE) (DECL_WRTL_CHECK
(NODE)->decl_common.decl_flag_0)
    while CONST_DECL doesn't satisfy DECL_WRTL_CHECK.

    The following patch checks explicitly for VAR_DECL/PARM_DECL/RESULT_DECL
    only before using DECL_REGISTER, assumes other decls aren't DECL_REGISTER.
    Not really sure about RESULT_DECL but it at least satisfies
DECL_WRTL_CHECK...

    2021-07-28  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/101624
            * ubsan.c (maybe_instrument_pointer_overflow,
            instrument_object_size): Only test DECL_REGISTER on VAR_DECLs,
            PARM_DECLs or RESULT_DECLs.
            * sanopt.c (maybe_optimize_ubsan_ptr_ifn): Likewise.

            * gfortran.dg/ubsan/ubsan.exp: New file.
            * gfortran.dg/ubsan/pr101624.f90: New test.

    (cherry picked from commit 49e28c02a95a4bee981e69a80950309869580151)

  parent reply	other threads:[~2022-05-11  6:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 16:42 [Bug fortran/101624] New: [9/10/11/12 " gscfq@t-online.de
2021-07-27 11:01 ` [Bug fortran/101624] " rguenth at gcc dot gnu.org
2021-07-27 17:01 ` jakub at gcc dot gnu.org
2021-07-27 18:19 ` [Bug middle-end/101624] " jakub at gcc dot gnu.org
2021-07-28 16:43 ` cvs-commit at gcc dot gnu.org
2021-07-28 16:46 ` [Bug middle-end/101624] [9/10/11 " jakub at gcc dot gnu.org
2021-08-12 22:54 ` cvs-commit at gcc dot gnu.org
2021-08-12 22:56 ` [Bug middle-end/101624] [9/10 " jakub at gcc dot gnu.org
2022-05-10  8:20 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:22 ` cvs-commit at gcc dot gnu.org [this message]
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-101624-4-S5KO1VKYe9@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).