This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C PATCH for c/68668 (grokdeclarator and wrong type of PARM_DECL)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]