public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Paul Richard Thomas <paul.richard.thomas@gmail.com>,
	"fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Cc: <gerhard.steinmetz.fortran@t-online.de>
Subject: Re: [Patch, fortran] PR99125 - [9/10/11 Regression] ICE: gimplification failed (gimplify.c:15068)
Date: Wed, 24 Feb 2021 17:28:17 +0100	[thread overview]
Message-ID: <3e9e63b0-e9d0-a529-dbdf-96665e206d6b@codesourcery.com> (raw)
In-Reply-To: <CAGkQGiKnEw=JDONsj2booUX2psjP9i6C0fhNa_AFZwMEmF7xHQ@mail.gmail.com>

Hi Paul,

On 24.02.21 15:05, Paul Richard Thomas via Fortran wrote:
> This problem was caused by the compiler attempting to use 0 as an lvalue
> and to assign 0 to it.

I did recall the problem – and indeed: PR95868.

The trans-array.c patch does effectively the same as mine there, some
other use of 'tmp' but otherwise ...

The trans-expr patch, I didn't have; unfortunately, it does not solve
the other issues of my PR, either. (Thus, if you are interested in
continuing the len=: work ...)

[Once that PR is fixed, trans-openmp.c has to updated for it as well.]

> Understandably, this upset the gimplifer quite a bit
> :-) The fix is to use the ss_info string length for deferred length
> character components, where the hidden string length component has been
> used. The use of a constant as an lvalue is prevented by checking that the
> expression string length is a variable.
>
> Regtests on FC33/x86_64 - OK for all three branches?

LGTM.

Thanks for the patch!

Tobias

> Fortran: Fix for class defined operators [PR99125].
>
> 2021-02-23  Paul Thomas  <pault@gcc.gnu.org>
>
> gcc/fortran
> PR fortran/99125
> * trans-array.c (gfc_conv_expr_descriptor): For deferred length
> length components use the ss_info string length instead of
> gfc_get_expr_charlen. Make sure that the deferred string length
> is a variable before assigning to it. Otherwise use the expr.
> * trans-expr.c (gfc_conv_string_length): Make sure that the
> deferred string length is a variable before assigning to it.
>
> gcc/testsuite/
> PR fortran/99125
> * gfortran.dg/alloc_deferred_comp_1.f90: New test.
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf

      reply	other threads:[~2021-02-24 16:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24 14:05 Paul Richard Thomas
2021-02-24 16:28 ` Tobias Burnus [this message]

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=3e9e63b0-e9d0-a529-dbdf-96665e206d6b@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gerhard.steinmetz.fortran@t-online.de \
    --cc=paul.richard.thomas@gmail.com \
    /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).