public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/16567] New: Nested function and variable-sized structure ICE
@ 2004-07-15 14:55 jsm28 at gcc dot gnu dot org
  2004-07-15 15:10 ` [Bug middle-end/16567] " bangerth at dealii dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2004-07-15 14:55 UTC (permalink / raw)
  To: gcc-bugs

The following GNU C testcase ICEs with every compiler version tested
from 2.6.3 to recent mainline.  With mainline 3.5.0 20040710 on
i686-pc-linux-gnu, the error is:

t.c: In function `nested':
t.c:12: internal compiler error: in make_decl_rtl, at varasm.c:758
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

With 3.4.1, the error is:

t.c: In function `nested':
t.c:12: internal compiler error: in expand_expr_real, at expr.c:6638
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

The proper fix may well involve getting rid of variable-sized structures
in GNU C, but I don't know whether the problem can be triggered with
equivalent testcases in other languages (all ICEs are in various middle-end
files).

#include <stddef.h>

extern int printf (const char *, ...);
extern void *memset (void *, int, size_t);

int bar (int (*)(), int, void *);

int
main(int argc, char **argv)
{
  struct s { int a; char b[argc]; };
  int nested (struct s x) { return x.a + sizeof(x); }
  struct s t;
  memset (&t, 0, sizeof(t));
  t.a = 123;
  printf("%d\n", bar (nested, argc, &t));
  return 0;
}

-- 
           Summary: Nested function and variable-sized structure ICE
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-10-15 13:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-15 14:55 [Bug middle-end/16567] New: Nested function and variable-sized structure ICE jsm28 at gcc dot gnu dot org
2004-07-15 15:10 ` [Bug middle-end/16567] " bangerth at dealii dot org
2004-07-15 15:17 ` bangerth at dealii dot org
2004-07-15 15:25 ` jsm at polyomino dot org dot uk
2004-10-14  1:55 ` pinskia at gcc dot gnu dot org
2004-10-15 13:49 ` pinskia at gcc dot gnu dot org
2004-10-15 13:49 ` cvs-commit at gcc dot gnu dot org
2004-10-15 13:51 ` pinskia at gcc dot gnu dot org

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