This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Emit DECL_EXPR so that type of what pstr.N points to is gimplified (PR fortran/78757)
- From: Andre Vehreschild <vehre at gmx dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: fortran at gcc dot gnu dot org, Richard Biener <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 16 Dec 2016 17:09:32 +0100
- Subject: Re: [PATCH] Emit DECL_EXPR so that type of what pstr.N points to is gimplified (PR fortran/78757)
- Authentication-results: sourceware.org; auth=none
- References: <20161214215529.GC2038@tucnak> <20161216164912.7bef3ebe@vepi2> <20161216155445.GS21933@tucnak>
Hi Jakub,
I don't have enough knowledge on this part of gcc. So please don't take my
comment as an "ok for trunk". I don't have that privilege.
Furthermore did Dominique just now raise the question in IRC whether the
testcase is valid: foo is declared to return a pointer to a char(len=70) but
points to a char(len=30). My Fortran is not good enough know what the result
should be. I was more concerned about unifying the way typedefs are done by
gfortran.
Sorry, for the noise.
- Andre
On Fri, 16 Dec 2016 16:54:45 +0100
Jakub Jelinek <jakub@redhat.com> wrote:
> On Fri, Dec 16, 2016 at 04:49:12PM +0100, Andre Vehreschild wrote:
> > the patch looks ok to me. I am wondering whether we should setup a routine
> > or a macro for doing such a DECL_EXPR like Fortran needs it. In your case
> > the TYPE_DECL is marked artificial and ignored in other cases not. Would
> > that be need also at the six other locations gfortran uses a type decl?
>
> I think it depends. If the TYPE_DECL is added as TYPE_NAME of the type,
> then the DECL_ARTIFICIAL and DECL_IGNORED_P on it should depend on what kind
> of type it is, if it is a user type, it shouldn't be artificial.
> While in this case it isn't added as TYPE_NAME of the type, it is just a
> mean to tell the gimplifier to gimplify the type, so it shouldn't make it
> in that case into debug info etc.
>
> Maybe it would be better not to use a pointer to VLA type here at all,
> just pointer to void, and then after the call convert it to the right lhs
> type. I haven't analyzed all the possible cases though to find out if it
> could work.
>
> Jakub
--
Andre Vehreschild * Email: vehre ad gmx dot de