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 tree-optimization/104970] [12 Regression] ICE in execute_todo, at passes.cc:2133 since r12-6480-gea19c8f33a3a8d2b
Date: Mon, 21 Mar 2022 11:59:27 +0000	[thread overview]
Message-ID: <bug-104970-4-3fhskhUQWi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104970-4@http.gcc.gnu.org/bugzilla/>

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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Not a SSA_NAME, but no longer existing temporary.
If a type has non-constant extents or bit or byte size, the vars (or SSA_NAMEs)
used in those sizes are valid just during gimplification, they can't be
recovered later on when they could have been DCEd or changed in some other way.
For automatic VLAs the only thing that can be done is look up the corresponding
__builtin_alloca_with_align and use its size argument as the size of the whole
object, for VLA parameters it just doesn't exist.
The gimple dump here has:
__attribute__((access ("^1[$ ],$0", )))
void mleye (int l, double[0:D.1990] * E)
{
  int l.0;
  sizetype D.1990;
  bitsizetype D.1991;
  sizetype D.1992;

  l.0 = l;
  _1 = (long int) l.0;
  _2 = _1 + -1;
  _3 = (sizetype) _2;
  D.1990 = _3;
  _4 = (sizetype) l.0;
  _5 = (bitsizetype) _4;
  _6 = _5 * 64;
  D.1991 = _6;
  _7 = (sizetype) l.0;
  _8 = _7 * 8;
  D.1992 = _8;
  memset2 (E, 0, 8);
}
so D.1990 is the TYPE_MAX_VALUE (TYPE_DOMAIN (type)) i.e. l - 1,
D.1991 is TYPE_SIZE (type) (l * 64, i.e. bit size) and D.1992 is TYPE_SIZE_UNIT
(type) (l * 8, i.e. byte size).
The ssa pass turns all those into SSA_NAMEs though (and nothing updates the
TYPE* values) and dse1 removes all those unused stmts.
The objsz1 emergency dump shows though:
  _4 = (sizetype) l_1(D);
  _6 = D.1992 * _4;
  _5 = _6;
  __builtin___memset_chk (E_3(D), 0, 8, _5);
so it strangely wants to multiply D.1992 (which can't be used but as sizeof
(*E)) with l argument, so that is l * l * sizeof (double) if D.1992 could be
used.

  parent reply	other threads:[~2022-03-21 11:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 15:24 [Bug tree-optimization/104970] New: " marxin at gcc dot gnu.org
2022-03-17 15:24 ` [Bug tree-optimization/104970] " marxin at gcc dot gnu.org
2022-03-17 17:50 ` siddhesh at gcc dot gnu.org
2022-03-21 11:59 ` jakub at gcc dot gnu.org [this message]
2022-03-21 12:19 ` [Bug tree-optimization/104970] [12 Regression] " jakub at gcc dot gnu.org
2022-03-21 17:19 ` msebor at gcc dot gnu.org
2022-03-21 17:22 ` msebor at gcc dot gnu.org
2022-03-21 18:18 ` jakub at gcc dot gnu.org
2022-03-22  0:25 ` msebor at gcc dot gnu.org
2022-03-23  5:56 ` siddhesh at gcc dot gnu.org
2022-03-23  7:28 ` jakub at gcc dot gnu.org
2022-03-23 15:34 ` msebor at gcc dot gnu.org
2022-03-24  9:40 ` cvs-commit at gcc dot gnu.org
2022-03-24  9:42 ` siddhesh at gcc dot gnu.org
2023-03-28 21:53 ` muecker at gwdg dot de
2023-03-29 11:15 ` siddhesh at gcc dot gnu.org
2023-03-30 17:17 ` muecker at gwdg dot de

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-104970-4-3fhskhUQWi@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).