This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53424] dynamic array expressions get wrong sizeof() if pointers to const are involved and the pointers are changed (const is misapplied to the whole expression)
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 20 May 2012 08:17:57 +0000
- Subject: [Bug c/53424] dynamic array expressions get wrong sizeof() if pointers to const are involved and the pointers are changed (const is misapplied to the whole expression)
- Auto-submitted: auto-generated
- References: <bug-53424-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53424
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-05-20
Ever Confirmed|0 |1
Severity|major |normal
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-20 08:17:57 UTC ---
There is no SAVE_EXPR wrapped around the *x for some reason which is causing
the issue.
Add the following to make a runtime test:
void usebuf(char *) __attribute__((noinline,noclone));
void usebuf(char *a)
{
asm ("");
}
int main(void)
{
if (works () != broken ())
__builtin_abort ();
nocrash ();
crashes ();
if (negativesizeof() != works ())
__builtin_abort ();
}