This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [committed] C front end fix for PR 21105
- From: James E Wilson <wilson at specifix dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 17 Aug 2005 17:21:48 -0700
- Subject: Re: [committed] C front end fix for PR 21105
- References: <10508170421.AA00226@vlsi1.ultra.nyu.edu>
Richard Kenner wrote:
> It should be the case that TYPE_SIZE is an INTEGER_CST iff TYPE_SIZE_UNIT
> is, but it still looks odd to be testing different fields here.
Good point. My last patch was sloppy. I checked in this patch to fix it.
This was tested with an x86_64-linux C only bootstrap and make check.
There were no regressions.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com
2005-08-17 James E Wilson <wilson@specifix.com>
* c-decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE in
array size check.
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.681
diff -p -p -r1.681 c-decl.c
*** c-decl.c 16 Aug 2005 18:23:48 -0000 1.681
--- c-decl.c 18 Aug 2005 00:17:28 -0000
*************** grokdeclarator (const struct c_declarato
*** 4383,4389 ****
if (TREE_CODE (type) == ARRAY_TYPE
&& COMPLETE_TYPE_P (type)
! && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
&& TREE_OVERFLOW (TYPE_SIZE_UNIT (type)))
{
error ("size of array %qs is too large", name);
--- 4383,4389 ----
if (TREE_CODE (type) == ARRAY_TYPE
&& COMPLETE_TYPE_P (type)
! && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST
&& TREE_OVERFLOW (TYPE_SIZE_UNIT (type)))
{
error ("size of array %qs is too large", name);