c/2939: compiler crashes on nested functions returning variable size structures

candida@tiptree.demon.co.uk candida@tiptree.demon.co.uk
Fri May 25 04:26:00 GMT 2001


>Number:         2939
>Category:       c
>Synopsis:       compiler crashes on nested functions returning variable size structures
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 25 04:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     candida@tiptree.demon.co.uk
>Release:        current CVS
>Organization:
>Environment:
GNU/Linux intel
>Description:
compiler crashes on nested functions returning variable
size structures.  See the following test.

int
main (int argc, char **argv)
{
  int	size = 10;

  {
    typedef struct {
      char	val[size];
    } block;
    block	b0;
    block	b1;
    int		i;
    inline 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)
	return 1;
  }
  return 0;
}
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list