From: Bernd Edlinger <bernd.edlinger@hotmail.de>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
Martin Jambor <mjambor@suse.cz>,
Richard Biener <richard.guenther@gmail.com>
Subject: RE: [PATCH, PR 57748] Check for out of bounds access, Part 2
Date: Sun, 13 Oct 2013 12:30:00 -0000 [thread overview]
Message-ID: <DUB122-W2548785991FB4F41FF3D34E4190@phx.gbl> (raw)
In-Reply-To: <460555150.HNN3czQ0m7@polaris>
[-- Attachment #1: Type: text/plain, Size: 620 bytes --]
Hi Eric,
>> Would you agree that this "error: flexible array member"
>> should also be emitted for a zero-sized array member,
>> maybe as "error: zero-sized array member not at end of struct"?
>
> I would have answered yes when zero-sized arrays where introduced, but it's
> far less clear a couple of decades later IMO.
But if zero-sized arrays everywhere in a structure is valid C,
then the attached test case is a valid test case.
And it will break your patch for PR58570 at -O1 and above,
because you can no longer assume that different array members
are not an alias.
Regards
Bernd.
[-- Attachment #2: pr58570-1.c --]
[-- Type: text/plain, Size: 268 bytes --]
int printf (const char *, ...);
struct S
{
char a[0];
short b[1];
};
int e = 1, i;
static struct S d;
int
main ()
{
if (e)
{
d.b[i]=!d.b[i]; //0->1
d.a[i]=!d.a[i]; //1->0
d.b[i]=!d.b[i]; //0->1
}
printf ("%d\n", d.b[0]);
return 0;
}
next prev parent reply other threads:[~2013-10-13 11:01 UTC|newest]
Thread overview: 105+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 7:03 [PATCH, PR 57748] Check for out of bounds access Bernd Edlinger
2013-09-06 7:31 ` Richard Biener
[not found] ` <DUB122-W323D4AAAEA1AFA890BF243E43C0@phx.gbl>
[not found] ` <CAFiYyc13wC0jmZ4xELAiL5L5Sbh0yauZWViP2hTdR+H4s0iPSw@mail.gmail.com>
[not found] ` <DUB122-W4D571A91831593BA22438E43C0@phx.gbl>
2013-09-06 9:19 ` Richard Biener
2013-09-06 9:30 ` Bernd Edlinger
2013-09-10 21:33 ` Martin Jambor
2013-09-11 14:42 ` Bernd Edlinger
2013-09-11 14:47 ` Richard Biener
2013-09-12 21:07 ` Bernd Edlinger
2013-09-13 9:37 ` Eric Botcazou
2013-09-13 9:48 ` Bernd Edlinger
2013-09-15 19:08 ` Bernd Edlinger
2013-09-17 0:05 ` Martin Jambor
2013-09-17 10:32 ` Bernd Edlinger
2013-10-22 14:08 ` Bernd Edlinger
2013-10-23 16:02 ` Richard Biener
2013-10-24 0:09 ` Bernd Edlinger
2013-10-24 8:44 ` Eric Botcazou
2013-10-24 10:06 ` Richard Biener
2013-10-24 10:22 ` Bernd Edlinger
2013-10-25 10:40 ` Eric Botcazou
2013-11-06 15:08 ` [PATCH, PR 57748] Check for out of bounds access, Part 3 Bernd Edlinger
2013-12-03 13:27 ` [PE-POST] Adjust Bit-region in expand_assignment Bernd Edlinger
2013-12-04 5:55 ` Jeff Law
2013-12-04 7:50 ` Bernd Edlinger
2013-12-06 4:13 ` Jeff Law
2013-12-06 8:03 ` Bernd Edlinger
2013-12-06 9:49 ` Richard Biener
2013-09-17 11:07 ` [PATCH, PR 57748] Check for out of bounds access Richard Biener
2013-09-17 11:41 ` Richard Biener
2013-09-17 12:48 ` Bernd Edlinger
2013-09-24 11:40 ` Richard Biener
2013-09-24 11:56 ` Bernd Edlinger
2013-09-24 6:34 ` [PATCH, PR 57748] Check for out of bounds access, Part 2 Bernd Edlinger
2013-09-24 10:31 ` Richard Biener
2013-09-24 14:46 ` Eric Botcazou
2013-09-24 18:51 ` Martin Jambor
2013-09-25 9:51 ` Richard Biener
2013-09-25 14:56 ` Martin Jambor
2013-09-26 9:34 ` Bernd Edlinger
2013-09-26 11:18 ` Eric Botcazou
2013-09-26 12:42 ` Bernd Edlinger
2013-09-27 8:45 ` Eric Botcazou
2013-10-03 0:37 ` Bernd Edlinger
2013-10-08 8:02 ` Eric Botcazou
2013-10-08 9:22 ` Bernd Edlinger
2013-10-08 21:04 ` Eric Botcazou
2013-10-08 23:03 ` Bernd Edlinger
2013-10-11 17:27 ` Eric Botcazou
2013-10-13 8:22 ` Bernd Edlinger
2013-10-13 12:29 ` Eric Botcazou
2013-10-13 12:30 ` Bernd Edlinger [this message]
2013-10-13 14:06 ` Eric Botcazou
2013-10-22 11:02 ` Bernd Edlinger
2013-10-23 16:14 ` Richard Biener
2013-10-23 17:25 ` Martin Jambor
2013-10-23 18:05 ` Eric Botcazou
2013-10-24 8:20 ` Bernd Edlinger
2013-10-24 9:16 ` Eric Botcazou
2013-10-24 10:00 ` Bernd Edlinger
2013-10-24 10:16 ` Eric Botcazou
2013-10-24 10:50 ` Richard Biener
2013-10-24 13:09 ` Bernd Edlinger
2013-10-24 13:16 ` Richard Biener
2013-10-24 13:38 ` Bernd Edlinger
2013-10-25 7:05 ` Bernd Edlinger
2013-10-25 9:29 ` Richard Biener
2013-10-25 10:40 ` Bernd Edlinger
2013-10-25 11:10 ` Richard Biener
2013-10-25 14:01 ` Martin Jambor
2013-10-27 20:21 ` [PATCH] Remove "keep_aligning" from get_inner_reference Bernd Edlinger
2013-11-26 12:37 ` Richard Biener
2013-11-27 11:28 ` Eric Botcazou
2013-11-27 12:24 ` Bernd Edlinger
2013-11-27 12:33 ` Eric Botcazou
2013-11-27 13:30 ` Richard Biener
2013-11-27 15:10 ` Bernd Edlinger
2013-11-27 16:25 ` Eric Botcazou
2013-11-27 16:33 ` Richard Biener
2013-11-27 16:43 ` Eric Botcazou
2014-04-22 7:55 ` Bernd Edlinger
2014-04-22 8:11 ` Eric Botcazou
2014-04-22 8:33 ` Bernd Edlinger
2014-04-22 9:36 ` Eric Botcazou
2014-05-02 6:18 ` Jeff Law
2014-05-05 8:00 ` Richard Biener
2014-05-05 20:25 ` Mike Stump
2014-05-14 7:30 ` Eric Botcazou
2014-05-14 9:06 ` Bernd Edlinger
2013-11-07 13:23 ` [PATCH, PR 57748] Check for out of bounds access, Part 2 Bernd Edlinger
2013-11-07 13:23 ` Bernd Edlinger
2013-11-19 15:05 ` Bernd Edlinger
2013-11-27 16:22 ` [PING] " Bernd Edlinger
2013-11-27 17:09 ` Richard Biener
2013-11-27 22:30 ` Jeff Law
2013-11-28 12:36 ` Bernd Edlinger
2013-12-03 6:00 ` Jeff Law
2013-10-24 13:20 ` Jakub Jelinek
2013-10-24 13:42 ` Richard Biener
2013-10-24 11:14 ` Richard Biener
2013-10-24 13:13 ` Richard Biener
2013-10-23 17:45 ` Eric Botcazou
2013-09-25 13:22 ` Bernd Edlinger
2013-09-06 9:29 ` [PATCH, PR 57748] Check for out of bounds access Eric Botcazou
2013-09-06 9:30 ` Jakub Jelinek
2013-09-06 10:30 ` Bernd Edlinger
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=DUB122-W2548785991FB4F41FF3D34E4190@phx.gbl \
--to=bernd.edlinger@hotmail.de \
--cc=ebotcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=mjambor@suse.cz \
--cc=richard.guenther@gmail.com \
/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).