diff options
author | Tom Tromey <tromey@redhat.com> | 2008-01-04 00:14:31 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2008-01-04 00:14:31 +0000 |
commit | 6fc3c3c03343e5a33df89f8be44f5e523ad99cd6 (patch) | |
tree | b9e4f4cbbeed5ac124cea9852ab5a4afa0caa93e /gcc/c-common.c | |
parent | 1af0d737922e03bbd97c183756b29c99dc5e7cc2 (diff) | |
download | gcc-6fc3c3c03343e5a33df89f8be44f5e523ad99cd6.zip gcc-6fc3c3c03343e5a33df89f8be44f5e523ad99cd6.tar.gz gcc-6fc3c3c03343e5a33df89f8be44f5e523ad99cd6.tar.bz2 |
re PR c/34457 (ICE with VLA and -combine)
gcc/
PR c/34457:
* c-common.c (c_type_hash): Handle VLAs.
gcc/testsuite
PR c/34457:
* gcc.dg/pr34457-2.c: New file.
* gcc.dg/pr34457-1.c: New file.
From-SVN: r131311
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 36afd6b..4e5d24c 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1,6 +1,6 @@ /* Subroutines shared by all languages that are variants of C. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GCC. @@ -3171,7 +3171,11 @@ c_type_hash (const void *p) } for (; t2; t2 = TREE_CHAIN (t2)) i++; - size = TREE_INT_CST_LOW (TYPE_SIZE (t)); + /* We might have a VLA here. */ + if (TREE_CODE (TYPE_SIZE (t)) != INTEGER_CST) + size = 0; + else + size = TREE_INT_CST_LOW (TYPE_SIZE (t)); return ((size << 24) | (i << shift)); } |