public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "qinzhao at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/102285] New flag -ftrivial-auto-var-init=zero causes crash in pr82421.c
Date: Mon, 04 Oct 2021 21:44:26 +0000 [thread overview]
Message-ID: <bug-102285-4-iNfAiKlwHg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102285-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102285
--- Comment #28 from qinzhao at gcc dot gnu.org ---
(In reply to Richard Biener from comment #21)
> Reduced testcase:
>
> int
> qy (void)
> {
> int tw = 4;
> int fb[tw];
> return fb[2];
> }
For this reduced testing case, if compiled with
/home/opc/Install/latest/bin/gcc -c -O -ftrivial-auto-var-init=zero
-fdump-tree-all t.c
******t.c.032t.cpp1:
int qy (int l9)
{
unsigned char fb.3[16];
int tw;
int[0:D.1984] * fb.1;
sizetype D.1984;
void * saved_stack.2_16;
int _27;
<bb 2> :
saved_stack.2_16 = __builtin_stack_save ();
fb.1_25 = &fb.3;
(*fb.1_25) = .DEFERRED_INIT (16, 2, 1);
_27 = (*fb.1_25)[2];
..
}
******t.c.033t.forwprop1:
int qy (int l9)
{
unsigned char fb.3[16];
int tw;
int[0:D.1984] * fb.1;
sizetype D.1984;
void * saved_stack.2_16;
int _27;
<bb 2> :
saved_stack.2_16 = __builtin_stack_save ();
MEM[(int[0:D.1984] *)&fb.3] = .DEFERRED_INIT (16, 2, 1);
_27 = MEM[(int[0:D.1984] *)&fb.3][2];
..
}
the problem with the above IR for .DEFERRED_INIT expansion is:
for MEM[(int[0:D.1984] *)&fb.3] = .DEFERRED_INIT (16, 2, 1);
after the "ccp" and "forwprop", the original VLA *fb.1 is replaced with the the
new fixed array &fb.3, however, the VAR_TYPE still is the old VLA type
int[0:D.1984]. if we can replace the var_type to the new "unsigned char [16]"
for both the LHS and the call to .DEFERRED_INIT. then expansion through
assign_expand should work.
We might need to special handling the LHS to get the new type for "fb.3"
instead of the old "var_type" for "assign_expand".
next prev parent reply other threads:[~2021-10-04 21:44 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 21:50 [Bug c/102285] New: New flag -ftrivial-auto-var-init=zero causes many crashes in the testsuite dcb314 at hotmail dot com
2021-09-10 22:11 ` [Bug middle-end/102285] " qinzhao at gcc dot gnu.org
2021-09-10 22:28 ` qinzhao at gcc dot gnu.org
2021-09-10 22:34 ` pinskia at gcc dot gnu.org
2021-09-10 23:10 ` qing.zhao at oracle dot com
2021-09-12 3:33 ` qinzhao at gcc dot gnu.org
2021-09-12 8:06 ` dcb314 at hotmail dot com
2021-09-13 10:25 ` rguenth at gcc dot gnu.org
2021-09-13 17:30 ` qinzhao at gcc dot gnu.org
2021-09-29 22:44 ` [Bug middle-end/102285] New flag -ftrivial-auto-var-init=zero causes crash in pr82421.c qinzhao at gcc dot gnu.org
2021-09-30 19:30 ` qinzhao at gcc dot gnu.org
2021-09-30 20:22 ` qinzhao at gcc dot gnu.org
2021-09-30 20:53 ` dcb314 at hotmail dot com
2021-09-30 22:09 ` qinzhao at gcc dot gnu.org
2021-10-01 6:51 ` rguenth at gcc dot gnu.org
2021-10-01 9:45 ` egallager at gcc dot gnu.org
2021-10-01 16:16 ` qinzhao at gcc dot gnu.org
2021-10-01 16:43 ` qing.zhao at oracle dot com
2021-10-01 20:09 ` qinzhao at gcc dot gnu.org
2021-10-01 20:23 ` qinzhao at gcc dot gnu.org
2021-10-04 6:27 ` rguenther at suse dot de
2021-10-04 6:29 ` rguenther at suse dot de
2021-10-04 9:10 ` rguenth at gcc dot gnu.org
2021-10-04 9:30 ` rguenth at gcc dot gnu.org
2021-10-04 11:53 ` rguenth at gcc dot gnu.org
2021-10-04 14:54 ` rguenth at gcc dot gnu.org
2021-10-04 17:16 ` qinzhao at gcc dot gnu.org
2021-10-04 20:34 ` qinzhao at gcc dot gnu.org
2021-10-04 20:59 ` qinzhao at gcc dot gnu.org
2021-10-04 21:44 ` qinzhao at gcc dot gnu.org [this message]
2021-10-05 8:36 ` cvs-commit at gcc dot gnu.org
2021-10-05 8:47 ` 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-102285-4-iNfAiKlwHg@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).