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 sanitizer/112741] ICE: in gimplify_var_or_parm_decl, at gimplify.cc:3261
Date: Tue, 28 Nov 2023 11:46:32 +0000	[thread overview]
Message-ID: <bug-112741-4-Yru70GuYfH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112741-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-11-28
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  The gimplifier asserts here:

3267      /* ??? If this is a local variable, and it has not been seen in any
3268         outer BIND_EXPR, then it's probably the result of a duplicate
3269         declaration, for which we've already issued an error.  It would
3270         be really nice if the front end wouldn't leak these at all.
3271         Currently the only known culprit is C++ destructors, as seen
3272         in g++.old-deja/g++.jason/binding.C.
3273         Another possible culpit are size expressions for variably modified
3274         types which are lost in the FE or not gimplified correctly.  */
3275      if (VAR_P (decl)
3276          && !DECL_SEEN_IN_BIND_EXPR_P (decl)
3277          && !TREE_STATIC (decl) && !DECL_EXTERNAL (decl)
3278          && decl_function_context (decl) == current_function_decl)
3279        {
3280          gcc_assert (seen_error ());
3281          return GS_ERROR;
3282        }

as we gimplify '((unsigned long) &c[0][j_2(D)][0] - (unsigned long) &c) + 4'
during instrument_object_size.  The GIMPLE frontend, when bypassing
gimplification, doesn't set DECL_SEEN_IN_BIND_EXPR_P given there are no
such things in GIMPLE.  But it probably should set the flag anyway.

Testing a patch.

  parent reply	other threads:[~2023-11-28 11:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28  7:39 [Bug sanitizer/112741] New: " iamanonymous.cs at gmail dot com
2023-11-28  7:46 ` [Bug sanitizer/112741] " sjames at gcc dot gnu.org
2023-11-28 11:46 ` rguenth at gcc dot gnu.org [this message]
2023-11-28 15:58 ` cvs-commit at gcc dot gnu.org
2023-11-28 15:59 ` rguenth 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-112741-4-Yru70GuYfH@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).