public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Harald Anlauf <anlauf@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-1541] Revert "Fortran - ICE in gfc_check_do_variable, at fortran/parse.c:4446"
Date: Wed, 16 Jun 2021 20:01:12 +0000 (GMT)	[thread overview]
Message-ID: <20210616200112.F2C543857C7B@sourceware.org> (raw)

https://gcc.gnu.org/g:d117f992d81b783aa7cbff4c9fde9b96b70a93ed

commit r12-1541-gd117f992d81b783aa7cbff4c9fde9b96b70a93ed
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Wed Jun 16 22:00:52 2021 +0200

    Revert "Fortran - ICE in gfc_check_do_variable, at fortran/parse.c:4446"
    
    This reverts commit 72e3d92178b44a3722519ec68e72e307443bda70.

Diff:
---
 gcc/fortran/expr.c                    | 15 ---------------
 gcc/fortran/match.c                   |  2 +-
 gcc/fortran/parse.c                   |  3 ---
 gcc/testsuite/gfortran.dg/pr95502.f90 |  8 --------
 4 files changed, 1 insertion(+), 27 deletions(-)

diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 6e663b4b828..956003ec605 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -1683,21 +1683,10 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
 	  return false;
 	}
 
-#if 1
       cons = gfc_constructor_lookup (base, limit);
       gcc_assert (cons);
       gfc_constructor_append_expr (&expr->value.constructor,
 				   gfc_copy_expr (cons->expr), NULL);
-#else
-      cons = gfc_constructor_lookup (base, limit);
-      if (cons)
-	gfc_constructor_append_expr (&expr->value.constructor,
-				     gfc_copy_expr (cons->expr), NULL);
-      else
-	{
-	  t = false;
-	}
-#endif
     }
 
   mpz_clear (ptr);
@@ -3487,7 +3476,6 @@ gfc_specification_expr (gfc_expr *e)
     {
       gfc_error ("Expression at %L must be of INTEGER type, found %s",
 		 &e->where, gfc_basic_typename (e->ts.type));
-      gfc_clear_ts (&e->ts);
       return false;
     }
 
@@ -3827,9 +3815,6 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue,
   int proc_pointer;
   bool same_rank;
 
-  if (!lvalue->symtree)
-    return false;
-
   lhs_attr = gfc_expr_attr (lvalue);
   if (lvalue->ts.type == BT_UNKNOWN && !lhs_attr.proc_pointer)
     {
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index d148de3e3b5..29462013038 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -1409,7 +1409,7 @@ gfc_match_pointer_assignment (void)
   gfc_matching_procptr_assignment = 0;
 
   m = gfc_match (" %v =>", &lvalue);
-  if (m != MATCH_YES || !lvalue->symtree)
+  if (m != MATCH_YES)
     {
       m = MATCH_NO;
       goto cleanup;
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 6d7845e8517..0522b391393 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -4588,9 +4588,6 @@ gfc_check_do_variable (gfc_symtree *st)
 {
   gfc_state_data *s;
 
-  if (!st)
-    return 0;
-
   for (s=gfc_state_stack; s; s = s->previous)
     if (s->do_variable == st)
       {
diff --git a/gcc/testsuite/gfortran.dg/pr95502.f90 b/gcc/testsuite/gfortran.dg/pr95502.f90
deleted file mode 100644
index d40fd9a5508..00000000000
--- a/gcc/testsuite/gfortran.dg/pr95502.f90
+++ /dev/null
@@ -1,8 +0,0 @@
-! { dg-do compile }
-! PR fortran/95502 - ICE in gfc_check_do_variable, at fortran/parse.c:4446
-
-program p
-  integer, pointer :: z
-  nullify (z%kind)  ! { dg-error "in variable definition context" }
-  z%kind => NULL()  ! { dg-error "constant expression" }
-end


                 reply	other threads:[~2021-06-16 20:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210616200112.F2C543857C7B@sourceware.org \
    --to=anlauf@gcc.gnu.org \
    --cc=gcc-cvs@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).