public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/41227] COMMON block, BIND(C) and LTO interoperability issues
Date: Mon, 14 Jul 2014 11:46:00 -0000	[thread overview]
Message-ID: <bug-41227-4-1BL39T57i2@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-41227-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41227

--- Comment #19 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 14 Jul 2014, burnus at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41227
> 
> --- Comment #17 from Tobias Burnus <burnus at gcc dot gnu.org> ---
> (In reply to Francois-Xavier Coudert from comment #12)
> > I disagree with Tobias' reading: it seems to me that the single-variable
> > common block should be interoperable with both the single-common C struct
> > and C variable.
> 
> Well, Bill Long of Cray seems to agree with my interpretation, cf.
> http://mailman.j3-fortran.org/pipermail/j3/2010-February/003358.html

But that answer suggests we get it wrong (currenty interoperating
with the C struct { int i; } works and with the plain decl it
doesn't).  The answer specifically doesn't say that only (1)
is valid.

> > The Intel compiler makes both cases work:
> 
> Well, it also works with gfortran - the question is only whether it works by
> chance or by purpose. If it works by chance and is invalid LTO is not required
> to support it.

Currently it works "by chance" because without LTO the compiler doesn't
see both sides.  With LTO it notices there is an inconsistency that
with a clever testcase will result in wrong code (make a fortran
subroutine that assigns sth to the variable, call it from the
C main after its assignment of 42, read the var again in main
and see it optimized to '42' in case the fortran function call is
inlined)


  parent reply	other threads:[~2014-07-14 11:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-41227-4@http.gcc.gnu.org/bugzilla/>
2012-01-05 13:38 ` rguenth at gcc dot gnu.org
2014-06-08 16:53 ` fxcoudert at gcc dot gnu.org
2014-06-10 13:06 ` rguenth at gcc dot gnu.org
2014-07-14 10:21 ` fxcoudert at gcc dot gnu.org
2014-07-14 10:36 ` rguenther at suse dot de
2014-07-14 10:45 ` fxcoudert at gcc dot gnu.org
2014-07-14 11:09 ` rguenth at gcc dot gnu.org
2014-07-14 11:20 ` fxcoudert at gcc dot gnu.org
2014-07-14 11:36 ` burnus at gcc dot gnu.org
2014-07-14 11:46 ` rguenther at suse dot de [this message]
2014-07-14 12:05 ` tobi at gcc dot gnu.org
2014-07-14 13:33 ` burnus at gcc dot gnu.org
2015-05-27 23:55 ` hubicka at gcc dot gnu.org
2009-09-02 14:26 [Bug fortran/41227] New: " burnus at gcc dot gnu dot org
2009-09-14 21:05 ` [Bug fortran/41227] " burnus at gcc dot gnu dot org
2009-09-28 19:59 ` tobi at gcc dot gnu dot org
2010-01-29 17:46 ` burnus at gcc dot gnu dot org
2010-02-02 10:29 ` burnus at gcc dot gnu dot org
2010-02-11 16:29 ` burnus at gcc dot gnu dot org
2010-02-23  9:08 ` burnus at gcc dot gnu dot org
2010-02-23  9:33 ` rguenther at suse dot de
2010-06-03 13:49 ` rguenth at gcc dot gnu dot org

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=bug-41227-4-1BL39T57i2@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).