public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Richard Thomas <paul.richard.thomas@gmail.com>
To: "Dominique d'Humières" <dominiq@lps.ens.fr>
Cc: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	Steve Kargl <sgk@troutmask.apl.washington.edu>,
		gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR 68283 [5/6 Regression] ice: gfc_variable_attr(): Bad array reference
Date: Sun, 24 Jan 2016 12:39:00 -0000	[thread overview]
Message-ID: <CAGkQGiL0Ujmc=Eb7ivVFK0tD2Nv4AV_aqt7udBg=r6EaE2OSXg@mail.gmail.com> (raw)
In-Reply-To: <97D05D73-C68B-4E3E-ABE6-DEC94F43436C@lps.ens.fr>

Hi Dominique,

I thought this one had been dealt with a long time since...

OK for trunk and 5-branch.

Thanks for dealing with it!

A

Paul

On 24 January 2016 at 12:22, Dominique d'Humières <dominiq@lps.ens.fr> wrote:
> Dear all,
>
> Is the following patch OK for trunk and the gcc5 branch? see the thread starting at https://gcc.gnu.org/ml/fortran/2015-11/msg00057.html and https://gcc.gnu.org/ml/fortran/2015-11/msg00072.html.
>
> Dominique
>
> Index: gcc/fortran/ChangeLog
> ===================================================================
> --- gcc/fortran/ChangeLog       (revision 232774)
> +++ gcc/fortran/ChangeLog       (working copy)
> @@ -1,3 +1,9 @@
> +2016-01-24  Dominique d'Humieres <dominiq@lps.ens.fr>
> +
> +       PR fortran/68283
> +       * primary.c (gfc_variable_attr): revert revision r221955,
> +       call gfc_internal_error only if there is no error.
> +
>  2016-01-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
>
>         PR fortran/66094
> Index: gcc/fortran/primary.c
> ===================================================================
> --- gcc/fortran/primary.c       (revision 232774)
> +++ gcc/fortran/primary.c       (working copy)
> @@ -2194,7 +2194,7 @@
>  symbol_attribute
>  gfc_variable_attr (gfc_expr *expr, gfc_typespec *ts)
>  {
> -  int dimension, codimension, pointer, allocatable, target, n;
> +  int dimension, codimension, pointer, allocatable, target;
>    symbol_attribute attr;
>    gfc_ref *ref;
>    gfc_symbol *sym;
> @@ -2253,22 +2253,9 @@
>           case AR_UNKNOWN:
>             /* If any of start, end or stride is not integer, there will
>                already have been an error issued.  */
> -           for (n = 0; n < ref->u.ar.as->rank; n++)
> -             {
> -               int errors;
> -               gfc_get_errors (NULL, &errors);
> -               if (((ref->u.ar.start[n]
> -                     && ref->u.ar.start[n]->ts.type == BT_UNKNOWN)
> -                    ||
> -                    (ref->u.ar.end[n]
> -                     && ref->u.ar.end[n]->ts.type == BT_UNKNOWN)
> -                    ||
> -                    (ref->u.ar.stride[n]
> -                     && ref->u.ar.stride[n]->ts.type == BT_UNKNOWN))
> -                   && errors > 0)
> -                 break;
> -             }
> -           if (n == ref->u.ar.as->rank)
> +           int errors;
> +           gfc_get_errors (NULL, &errors);
> +           if (errors == 0)
>               gfc_internal_error ("gfc_variable_attr(): Bad array reference");
>           }
>
> Index: gcc/testsuite/ChangeLog
> ===================================================================
> --- gcc/testsuite/ChangeLog     (revision 232774)
> +++ gcc/testsuite/ChangeLog     (working copy)
> @@ -1,3 +1,8 @@
> +2016-01-24  Dominique d'Humieres  <dominiq@lps.ens.fr>
> +
> +       PR fortran/68283
> +       gfortran.dg/pr68283.f90: New test.
> +
>  2016-01-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
>
>         PR fortran/66094
> Index: gcc/testsuite/gfortran.dg/pr68283.f90
> ===================================================================
> --- gcc/testsuite/gfortran.dg/pr68283.f90       (nonexistent)
> +++ gcc/testsuite/gfortran.dg/pr68283.f90       (working copy)
> @@ -0,0 +1,15 @@
> +! { dg-do compile }
> +MODULE neb_utils
> +  IMPLICIT NONE
> +  INTEGER, PARAMETER :: dp=8
> +  TYPE neb_var_type
> +     REAL(KIND=dp), DIMENSION(:, :),  POINTER  :: xyz, int, wrk
> +  END TYPE neb_var_type
> +CONTAINS
> +  SUBROUTINE get_neb_force()
> +    INTEGER                                  :: i
> +    TYPE(neb_var_type), POINTER              :: forces
> +    REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: dtmp1, wrk
> +    dtmp1 = forces%wrk(:,i)-dot_product_band ! { dg-error "Symbol 'dot_product_band' at .1. has no IMPLICIT type" }
> +  END SUBROUTINE get_neb_force
> +END MODULE neb_utils
>



-- 
The difference between genius and stupidity is; genius has its limits.

Albert Einstein

      reply	other threads:[~2016-01-24 12:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-24 11:22 Dominique d'Humières
2016-01-24 12:39 ` Paul Richard Thomas [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='CAGkQGiL0Ujmc=Eb7ivVFK0tD2Nv4AV_aqt7udBg=r6EaE2OSXg@mail.gmail.com' \
    --to=paul.richard.thomas@gmail.com \
    --cc=dominiq@lps.ens.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sgk@troutmask.apl.washington.edu \
    /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).