public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/56081] Seg fault ICE on select with bad case
Date: Wed, 23 Jan 2013 01:27:00 -0000	[thread overview]
Message-ID: <bug-56081-4-FGu9DmemZP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56081-4@http.gcc.gnu.org/bugzilla/>


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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org
      Known to fail|                            |4.7.0, 4.8.0

--- Comment #1 from kargl at gcc dot gnu.org 2013-01-23 01:27:11 UTC ---
Reduced testcase.

subroutine pickle(s, a)
   implicit none
   logical, intent(out) :: s
   integer, intent(inout) :: a(4)
   a = 3
   select case(a)
   case (0)
      s = .true.
   case (1)
      s = .false.
   end select
end subroutine pickle

Possible patch (cut-n-paste to tabs are corrupted). 

Index: match.c
===================================================================
--- match.c     (revision 195396)
+++ match.c     (working copy)
@@ -5128,6 +5128,17 @@ gfc_match_select (void)
   if (m != MATCH_YES)
     return m;

+  /* R812 case-expr is scalar-int-expr
+               or scalar-char-expr
+               or scalar-logical-expr.  */
+
+  if (expr->rank != 0)
+    {
+      gfc_error ("case-expr of SELECT construct at %C should be a "
+                "scalar-int-expr, scalar-char-expr, or scalar-logical-expr");
+      return MATCH_ERROR;
+    }
+
   new_st.op = EXEC_SELECT;
   new_st.expr1 = expr;


  reply	other threads:[~2013-01-23  1:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 22:15 [Bug fortran/56081] New: " richard at lozestech dot com
2013-01-23  1:27 ` kargl at gcc dot gnu.org [this message]
2013-01-23  4:28 ` [Bug fortran/56081] " sgk at troutmask dot apl.washington.edu
2013-01-23  8:30 ` [Bug fortran/56081] [4.7/4.8 Regression] " janus at gcc dot gnu.org
2013-01-23  9:10 ` janus at gcc dot gnu.org
2013-01-23  9:13 ` janus at gcc dot gnu.org
2013-01-23  9:21 ` janus at gcc dot gnu.org
2013-01-23  9:52 ` janus at gcc dot gnu.org
2013-01-23 10:00 ` janus at gcc dot gnu.org
2013-01-23 13:09 ` janus at gcc dot gnu.org
2013-01-23 16:47 ` rguenth at gcc dot gnu.org
2013-01-23 21:39 ` janus at gcc dot gnu.org
2013-01-24 23:58 ` janus at gcc dot gnu.org
2013-01-25  0:00 ` janus 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-56081-4-FGu9DmemZP@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).