public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/55172] [4.7/4.8 Regression] [OOP] ICE on invalid: gfc_variable_attr(): Bad array reference
Date: Wed, 02 Jan 2013 12:35:00 -0000	[thread overview]
Message-ID: <bug-55172-4-FODJCvxYY6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55172-4@http.gcc.gnu.org/bugzilla/>


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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot       |pault at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> 2013-01-02 12:34:35 UTC ---
(In reply to comment #2)
> I suspect the 4.8-problem of having only the ICE without a prior error message
> might be due to this commit:
> 
> http://gcc.gnu.org/viewcvs?view=revision&revision=187192
> 
> I think the function 'copy_ts_from_selector_to_associate' comes too early
> (namely during parsing). It tries to resolve the target expr, which should
> rather wait until resolution stage!?!

This is partially correct.  Unfortunately, the selector expression comes from
the parser with the ar->type == AR_UNKNOWN and it was this that
gfc_resolve_expr was putting right.  As long as all the variables were declared
or had implicit types, all was well.

Th is fixed by removing the call to gfc_resolve_expr and adding explicit code,
copied from resolve_array_ref, to set the correct type.  It is also
necessary/advisable to add a call to resolve the selector expression in
resolve_select_type.

I will submit a patch later today.

Cheers

Paul

PS If the index 'i' is declared, wrong code results as in pr54990.


  parent reply	other threads:[~2013-01-02 12:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01 22:42 [Bug fortran/55172] New: " abensonca at gmail dot com
2012-11-02 11:07 ` [Bug fortran/55172] [4.7/4.8 Regression] [OOP] " janus at gcc dot gnu.org
2012-11-02 12:10 ` janus at gcc dot gnu.org
2012-11-25 15:55 ` rguenth at gcc dot gnu.org
2012-11-29  8:41 ` jakub at gcc dot gnu.org
2013-01-02 12:35 ` pault at gcc dot gnu.org [this message]
2013-01-04 20:51 ` pault at gcc dot gnu.org
2013-01-05  7:52 ` [Bug fortran/55172] [4.7 only] [OOP] gfc_variable_attr(): Bad array reference in SELECT TYPE pault at gcc dot gnu.org
2013-04-11  7:59 ` [Bug fortran/55172] [4.7 Regression] " rguenth at gcc dot gnu.org
2014-01-19 12:20 ` 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-55172-4-FODJCvxYY6@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).