public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/45077] ICE with -fwhole-file in fold_convert_loc, at fold-const.c:2021
Date: Tue, 27 Jul 2010 09:50:00 -0000	[thread overview]
Message-ID: <20100727094957.23308.qmail@sourceware.org> (raw)
In-Reply-To: <bug-45077-13404@http.gcc.gnu.org/bugzilla/>



------- Comment #1 from burnus at gcc dot gnu dot org  2010-07-27 09:49 -------
Reduced test case:
!------------------------------------------------------------------
module iso_red
  type, public :: varying_string
     character(LEN=1), dimension(:), allocatable :: chars
  end type varying_string
end module iso_red

module ifiles
  use iso_red, string_t => varying_string
contains
  function line_get_string_advance (line) result (string)
    type(string_t) :: string
    character :: line
  end function line_get_string_advance
end module ifiles

module syntax_rules
  use iso_red, string_t => varying_string
  use ifiles, only: line_get_string_advance
contains
  subroutine syntax_init_from_ifile ()
    type(string_t) :: string
       string = line_get_string_advance ("")
  end subroutine syntax_init_from_ifile
end module syntax_rules
end
!------------------------------------------------------------------

The ICE occurs for:
  gfc_trans_assignment (trans-expr.c:5561)
    gfc_trans_assignment_1 (trans-expr.c:5419)
      gfc_trans_scalar_assign (trans-expr.c:4909)
       fold_convert_loc (fold-const.c:2021)

The fancy_abort occurs because TREE_CODE (type) is gcc_unreachable, type is the
second argument. The call is:
      gfc_add_modify (&block, lse->expr,
                           fold_convert (TREE_TYPE (lse->expr), rse->expr));
Namely "TREE_TYPE (lse->expr)" as "location_t" is added as first via #define.

Hereby LHS is variable "string" and RHS is function "line_get_string_advance".
Both have the same type: expr1->ts.u.derived->name == "varying_string" and
point to the _same_ expr2->ts.u.derived->backend_decl.

However, the data type looks different at TREE_TYPE, i.e.
    lse->expr.common.type != rse->expr.common.type

My working theory is that one generates a different back-end decl for
type(varying_string) and type(string_t).

However, ts.u.derived->backend_decl is the same - and as
ts.type.derived->components{,->ts.u.cl}->backend_decl is the same, I am not
sure whether this theory is correct.


-- 


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


  reply	other threads:[~2010-07-27  9:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 13:11 [Bug fortran/45077] New: " burnus at gcc dot gnu dot org
2010-07-27  9:50 ` burnus at gcc dot gnu dot org [this message]
2010-07-28  7:44 ` [Bug fortran/45077] " burnus at gcc dot gnu dot org
2010-07-28  8:45 ` burnus at gcc dot gnu dot org
2010-07-28  8:47 ` burnus at gcc dot gnu dot org
2010-07-29 17:00 ` burnus at gcc dot gnu dot org
     [not found] <bug-45077-4@http.gcc.gnu.org/bugzilla/>
2011-02-20 13:45 ` pault at gcc dot gnu.org
2011-02-20 14:18 ` burnus at gcc dot gnu.org
2011-02-20 15:16 ` dominiq at lps dot ens.fr
2011-02-20 16:28 ` pault at gcc dot gnu.org
2011-02-20 16:50 ` 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=20100727094957.23308.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).