This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C PATCH for c/68668 (grokdeclarator and wrong type of PARM_DECL)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 3 Dec 2015 21:40:29 +0000
- Subject: Re: C PATCH for c/68668 (grokdeclarator and wrong type of PARM_DECL)
- Authentication-results: sourceware.org; auth=none
- References: <20151203175646 dot GI3175 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1512031809290 dot 16579 at digraph dot polyomino dot org dot uk> <20151203212656 dot GJ3175 at redhat dot com>
On Thu, 3 Dec 2015, Marek Polacek wrote:
> > I think you also need to decrement orig_qual_indirect, which counts the
> > number of levels of array type derivation from orig_qual_type.
>
> Thus:
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
>
> 2015-12-03 Marek Polacek <polacek@redhat.com>
>
> PR c/68668
> * c-decl.c (grokdeclarator): When creating a PARM_DECL of ARRAY_TYPE,
> use TREE_TYPE of orig_qual_type. Decrement ORIG_QUAL_INDIRECT.
On further consideration:
Removing one level of array type derivation from type means it is one
fewer levels indirect from the original version of orig_qual_type. So I
think you should actually decrement orig_qual_indirect without changing
orig_qual_type. But, if orig_qual_indirect is indirect, in that case you
may get better results from changing orig_qual_type without decrementing
orig_qual_indirect.
--
Joseph S. Myers
joseph@codesourcery.com