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: [PATCH] Emit DECL_EXPR so that type of what pstr.N points to is gimplified (PR fortran/78757)


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 


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