This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/24589] New: [4.1 Regression] wrong code with zero sized structs on CONSTRUCTOR
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Oct 2005 05:25:15 -0000
- Subject: [Bug middle-end/24589] New: [4.1 Regression] wrong code with zero sized structs on CONSTRUCTOR
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Testcase:
void abort (void);
int ii;
typedef struct {} raw_spinlock_t;
typedef struct {
raw_spinlock_t raw_lock;
} spinlock_t;
raw_spinlock_t one_raw_spinlock (void)
{
raw_spinlock_t raw_lock;
ii++;
return raw_lock;
}
int main(void)
{
spinlock_t lock = (spinlock_t) { .raw_lock = one_raw_spinlock() };
if (ii != 1)
abort ();
return 0;
}
-------
Forwarded from:
http://gcc.gnu.org/ml/gcc/2005-09/msg00260.html
Patch which needs testing posted:
http://gcc.gnu.org/ml/gcc/2005-09/msg00286.html
--
Summary: [4.1 Regression] wrong code with zero sized structs on
CONSTRUCTOR
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24589