public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/54992] New: [OOP] Wrong offset in the array offset calculation when using nonclass%class(index)%nonclass
Date: Fri, 19 Oct 2012 20:34:00 -0000	[thread overview]
Message-ID: <bug-54992-4@http.gcc.gnu.org/bugzilla/> (raw)


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

             Bug #: 54992
           Summary: [OOP] Wrong offset in the array offset calculation
                    when using nonclass%class(index)%nonclass
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: janus@gcc.gnu.org, pault@gcc.gnu.org


As reported by Andrew Benson in the thread starting at
http://gcc.gnu.org/ml/fortran/2012-10/msg00087.html

The problem is that gfortran generates the wrong code for:

    targetNode%cBh(2)%hostNode => targetNode

where "cBh" is a polymorphic array. The offset is calculated as

  ((base_type *)targetNode->_data->cBh->_data)[ index ].host


Instead of the proper:

  targetNode->_data->cBh->_data.data
               + (index * targetNode->_data->cBh->_vptr_size)


Test case:  http://gcc.gnu.org/ml/fortran/2012-10/msg00100.html

Analysis:   http://gcc.gnu.org/ml/fortran/2012-10/msg00101.html


             reply	other threads:[~2012-10-19 20:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 20:34 burnus at gcc dot gnu.org [this message]
2012-10-19 21:23 ` [Bug fortran/54992] [4.8 Regression] " janus at gcc dot gnu.org
2012-10-19 21:37 ` dominiq at lps dot ens.fr
2012-10-25 11:36 ` janus at gcc dot gnu.org
2012-11-07 10:03 ` jakub at gcc dot gnu.org
2012-12-26 17:56 ` pault at gcc dot gnu.org
2013-01-07  9:05 ` pault at gcc dot gnu.org
2013-01-07 19:11 ` pault at gcc dot gnu.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-54992-4@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).