public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/102458] ICE tree check: expected array_type, have pointer_type in gfc_conv_array_initializer, at fortran/trans-array.c:6136
Date: Thu, 23 Sep 2021 19:28:17 +0000	[thread overview]
Message-ID: <bug-102458-4-peaNy0Xjn2@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102458-4@http.gcc.gnu.org/bugzilla/>

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |anlauf at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #9 from anlauf at gcc dot gnu.org ---
(In reply to Steve Kargl from comment #8)
> I think TRANSFER needs to be handled differently.
> 
> From the same section of the Fortran standard, TRANSFER is
> rejected if the following does not apply.
> 
>    (8) a reference to the intrinsic function TRANSFER where each
>    argument is a constant expression and each ultimate pointer
>    component of the SOURCE argument is disassociated,

yeah, I did that for the final patch.  Will submit soon.

> So, one should be able to do something like
> 
>    integer,parameter :: n = 4
>    integer,parameter :: x(transfer(n, n)) = 1
>    print *, x
>    end
> 
> which gfortran will give 
> 
> % gfortran10 -o z a.f90
> % ./z
>            1           1           1           1

This is less of an issue.  We also currently fail on the following:

subroutine s4
  integer, parameter :: n = 4
  integer, parameter :: x(transfer(n, n)) = 1 ! legal
  integer            :: y(transfer(n, n)) = 2 ! legal
  integer, parameter :: k = size (x) ! ok
  integer, parameter :: m = size (y) ! fails, tracked separately
  print *, k, x, y
  if (k /= size (y)) stop 1
end

For some reason we do not simplify SIZE(y), and this reason lies elsewhere.
And it is not touch by my patch.

> If you remove TRANSFER from the patch, it looks good to me.
> We can revisit TRANSFER when Gerhard breaks gfortran, again! ;-)

I'll bet he does, but don't hold your breath?

  parent reply	other threads:[~2021-09-23 19:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 17:42 [Bug fortran/102458] New: " gscfq@t-online.de
2021-09-22 17:42 ` [Bug fortran/102458] " gscfq@t-online.de
2021-09-22 19:07 ` anlauf at gcc dot gnu.org
2021-09-22 19:55 ` kargl at gcc dot gnu.org
2021-09-22 20:01 ` anlauf at gcc dot gnu.org
2021-09-22 20:03 ` kargl at gcc dot gnu.org
2021-09-22 20:43 ` anlauf at gcc dot gnu.org
2021-09-22 21:17 ` anlauf at gcc dot gnu.org
2021-09-22 23:18 ` sgk at troutmask dot apl.washington.edu
2021-09-23 19:28 ` anlauf at gcc dot gnu.org [this message]
2021-09-23 19:52 ` anlauf at gcc dot gnu.org
2021-09-24 17:11 ` cvs-commit at gcc dot gnu.org
2021-09-27 21:14 ` anlauf at gcc dot gnu.org
2021-09-29 19:22 ` anlauf at gcc dot gnu.org
2021-09-30 18:29 ` cvs-commit at gcc dot gnu.org
2021-10-03 19:34 ` cvs-commit at gcc dot gnu.org
2021-10-03 19:34 ` cvs-commit at gcc dot gnu.org
2021-10-05 19:51 ` cvs-commit at gcc dot gnu.org
2021-10-05 19:51 ` cvs-commit at gcc dot gnu.org
2021-10-05 19:53 ` anlauf 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-102458-4-peaNy0Xjn2@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).