public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Thomas Koenig <tkoenig@netcologne.de>,"fortran@gcc.gnu.org"
	<fortran@gcc.gnu.org>,Jakub Jelinek <jakub@redhat.com>
Subject: Re: Fortran LTO and array descriptors.
Date: Sun, 04 Feb 2018 12:36:00 -0000	[thread overview]
Message-ID: <2803794C-C219-4959-B3F4-A5C6764D1CC4@suse.de> (raw)
In-Reply-To: <5f4d68c5-9237-3bde-b175-389cca9150fc@netcologne.de>

On February 3, 2018 6:09:41 PM GMT+01:00, Thomas Koenig <tkoenig@netcologne.de> wrote:
>I have been looking at PR 68649 and 68717. They are the
>same bug, really (and there are quite a few more).
>
>Jakub has written a good analysis of the problem at
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68649#c12 .
>
>To sum it up, we create different types for each rank of
>array, and then call the library. When we call the
>same function with different ranks, lto complains, with
>good reason.
>
>The last comment, by Richard, ends with the rather
>pessimistic "Thus even the proposed fix won't end up working."
>
>This problem prevents users from a lot of LTO use cases. It also
>prevents us from using LTO with the library (although I
>strongly suspect that there are also other stumbling blocks).
>
>So, what to do?  On the libfortran side, I tried out the patch
>
>Index: libgfortran.h
>===================================================================
>--- libgfortran.h       (Revision 257347)
>+++ libgfortran.h       (Arbeitskopie)
>@@ -345,7 +345,7 @@ struct {\
>    size_t offset;\
>    dtype_type dtype;\
>    index_type span;\
>-  descriptor_dimension dim[r];\
>+  descriptor_dimension dim[];\
>  }
>
>which works well, but that only solves the lesser half of the problem.

Note that using this type on the library side is a good thing in any case. Maybe your problem with this is that you change the macroized version that is eventually used in sizeof expressions rather than only for function argument declarations? 

Richard. 

>Would it be possible and useful, when passing a pointer to an
>array descriptor, to cast this to a type with a flexible array
>member?
>
>Formally, this should still be OK for stage 4, because several
>of the bugs associated with this problems are regressions.
>
>Comments?  Good/bad idea?  Anybody volunteer to do it (I don't have
>the trans-* fu for it)?
>
>Regards
>
>	Thomas

  parent reply	other threads:[~2018-02-04 12:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-03 17:09 Thomas Koenig
2018-02-03 17:17 ` Thomas Koenig
2018-02-04 11:42   ` Richard Biener
2018-02-04 11:48     ` Richard Biener
2018-02-04 20:15     ` Thomas Koenig
2018-02-05  6:42       ` Richard Biener
2018-02-04 12:36 ` Richard Biener [this message]
2018-02-05  7:54 ` Jakub Jelinek
2018-02-05 10:17   ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2803794C-C219-4959-B3F4-A5C6764D1CC4@suse.de \
    --to=rguenther@suse.de \
    --cc=fortran@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=tkoenig@netcologne.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).