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/44882] [4.6 Regression] Bogus types in references with mismatched commons
Date: Fri, 09 Jul 2010 12:21:00 -0000	[thread overview]
Message-ID: <20100709122126.32027.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44882-682@http.gcc.gnu.org/bugzilla/>



------- Comment #9 from rguenther at suse dot de  2010-07-09 12:21 -------
Subject: Re:  [4.6 Regression] Bogus types in references
 with mismatched commons

On Fri, 9 Jul 2010, burnus at gcc dot gnu dot org wrote:

> ------- Comment #8 from burnus at gcc dot gnu dot org  2010-07-09 12:16 -------
> (In reply to comment #5)
> > I'm going to leave the bug open after that because I think the Fortran
> > frontend should do better than overriding the type of the common in TRUDGE
> > from the unused variant in TRUSRC.
> 
> Can you be a bit more specific what the solution of the problem should be?

Good question.  I'd say never change types like that, just leave the
original type in place.  The code is not a valid fortran program anyway
and this avoids invalid trees in the middle-end.

So for the testcase make TRUPAR DR and V real=4, if you'd change it to

      SUBROUTINE TRUSRC(LEAVE)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      COMMON /TRUPAR/ DX(10),V(10,10)
      END
      SUBROUTINE TRUDGE(KDIR)
      COMMON /TRUPAR/ DR(10),V(10,10)
      DO 110 I=1,NDIR
  110 DR(I)=V(I,JDIR)
      END

make it real=8.

> > Sooner or later you'll trip into another ICE with these mismatched types in
> > the IL.  Why can't this be a hard error?
> 
> "Named common blocks of the same name shall be of the same size in all scoping
> units of a program in which they appear, but blank common blocks may be of
> different sizes." (5.7.2.5, Fortran 2008 (FDIS).)
> 
> Thus, for blank commons, the standard requires to support it - while for named
> commones (such as TRUPAR in comment 1), it does not allow it. However, that did
> not stop people from doing so - and the number of (legacy) code which does so
> is legion.

And when compilers do not reject such code it will never be fixed ;)
Does GFortran have something like -fpermissive?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44882


  parent reply	other threads:[~2010-07-09 12:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-08 22:47 [Bug middle-end/44882] New: [4.6 Regression] Failed to build 416.gamess in SPEC CPU 2006 hjl dot tools at gmail dot com
2010-07-09  0:28 ` [Bug middle-end/44882] " hjl dot tools at gmail dot com
2010-07-09  8:15 ` dominiq at lps dot ens dot fr
2010-07-09  8:23 ` rguenth at gcc dot gnu dot org
2010-07-09  8:34 ` rguenth at gcc dot gnu dot org
2010-07-09  8:39 ` [Bug fortran/44882] " rguenth at gcc dot gnu dot org
2010-07-09 10:05 ` rguenth at gcc dot gnu dot org
2010-07-09 10:10 ` [Bug fortran/44882] [4.6 Regression] Bogus types in references with mismatched commons rguenth at gcc dot gnu dot org
2010-07-09 12:16 ` burnus at gcc dot gnu dot org
2010-07-09 12:21 ` rguenther at suse dot de [this message]
2010-07-09 13:22 ` burnus at gcc dot gnu dot org
2010-07-09 13:51 ` hjl dot tools at gmail dot com
2010-07-09 14:35 ` dominiq at lps dot ens dot fr
2010-09-02 10:52 ` [Bug fortran/44882] " 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=20100709122126.32027.qmail@sourceware.org \
    --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).