c/2924: [3.0 regression] Nested function returning variable size struct
nicola@brainstorm.co.uk
nicola@brainstorm.co.uk
Thu May 24 04:56:00 GMT 2001
>Number: 2924
>Category: c
>Synopsis: [3.0 regression] Nested function returning variable size struct
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu May 24 04:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: nicola@brainstorm.co.uk
>Release: 3.0
>Organization:
>Environment:
>Description:
The following C code - which compiles and runs fine on GCC 2,
produces an internal error on GCC 3.0. Please would you include
the code in the testsuite as well.
/*
* Test nested functions returning a variable size struct
*/
int
main (int argc, char **argv)
{
int size = 10;
{
typedef struct {
char val[size];
} block;
block b0;
block b1;
int i;
block retframe_block(void *rframe)
{
return *(block*)rframe;
}
for (i = 0; i < size; i++)
{
b0.val[i] = i;
}
b1 = retframe_block(&b0);
for (i = 0; i < size; i++)
{
if (b1.val[i] != i)
{
abort ();
}
}
}
return 0;
}
>How-To-Repeat:
Compile the included code.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list