This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/50700] New: [4.6/4.7 Regression] __builtin_object_size computed wrong
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Oct 2011 09:56:01 +0000
- Subject: [Bug middle-end/50700] New: [4.6/4.7 Regression] __builtin_object_size computed wrong
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50700
Bug #: 50700
Summary: [4.6/4.7 Regression] __builtin_object_size computed
wrong
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: rguenth@gcc.gnu.org
extern void abort (void);
struct S {
int len;
char s[0];
};
int main()
{
char buf[sizeof (struct S) + 32];
if (__builtin_object_size (((struct S *)&buf[0])->s, 1) != 32)
abort ();
return 0;
}