public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/2924: [3.0 regression] Nested function returning variable size struct
@ 2001-05-24  4:56 nicola
  0 siblings, 0 replies; only message in thread
From: nicola @ 2001-05-24  4:56 UTC (permalink / raw)
  To: gcc-gnats

>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:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-24  4:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-24  4:56 c/2924: [3.0 regression] Nested function returning variable size struct nicola

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).