[Bug c/34457] New: ICE with VLA and --combine

tromey at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Dec 14 02:54:00 GMT 2007


I have two source files:

qq.c, derived from one of the nested test in c-torture

int
f(int argc, char **argv)
{
  struct s { int a; char b[argc]; };
  struct s t;
  memset (&t, 0, sizeof(t));
  t.a = 123;
  return t.a + 5;
}


qr.c, which really can be anything

int x;

svn trunk ICEs with "gcc -c -O2 --combine qq.c qr.c":

opsy. gcc -c -O2 --combine qq.c qr.cqq.c: In function ‘f’:
qq.c:6: warning: incompatible implicit declaration of built-in function
‘memset’
qq.c:5: internal compiler error: tree check: expected integer_cst, have
var_decl in c_type_hash, at c-common.c:3174


c_common_get_alias_set returns early if num_in_fnames==1.
But with --combine, this is not so.
Then, c_type_hash crashes because it does not know what to do with
VLAs.  It tries to take TREE_INT_CST_LOW of a VAR_DECL.


-- 
           Summary: ICE with VLA and --combine
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tromey at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list