This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/39900] New: ICE on nested function returning pointer to VLA


int a;
void
f (void)
{
  int (*g (void))[a] { return 0; }
}

gets an ICE:

t.c: In function 'f':
t.c:5: internal compiler error: in put_pending_sizes, at stor-layout.c:108
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Unlike bug 21374, this is returning a pointer to a VLA rather than
a variable-size type itself.

If a typedef is used for the VLA, it does not ICE.

int a;
void
f (void)
{
  typedef int T[a];
  T *g (void) { return 0; }
}


-- 
           Summary: ICE on nested function returning pointer to VLA
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39900


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]