public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/68151] New: ICE on using select case with function of wrong type
@ 2015-10-29 18:19 gerhard.steinmetz.fortran@t-online.de
  2015-10-29 18:19 ` [Bug fortran/68151] " gerhard.steinmetz.fortran@t-online.de
  0 siblings, 1 reply; 2+ messages in thread
From: gerhard.steinmetz.fortran@t-online.de @ 2015-10-29 18:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 68151
           Summary: ICE on using select case with function of wrong type
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fortran@t-online.de
  Target Milestone: ---

A select case with a function value of wrong type :

$ cat z1.f90
program p
   integer :: k = 1
   select case (k)
   case (:huge(1._8))
   end select
end

$ gfortran -g -O0 -Wall -fcheck=all z1.f90
f951: internal compiler error: gfc_trans_select(): Bad type for case expr.

---

Whereas, detected with real(4) result :

$ cat z2.f90
program p
   integer :: k = 1
   select case (k)
   case (:huge(1._4))
   end select
end

$ gfortran z2.f90
z2.f90:4:10:

    case (:huge(1._4))
          1
Error: Expression in CASE statement at (1) must be of type INTEGER


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/68151] ICE on using select case with function of wrong type
  2015-10-29 18:19 [Bug fortran/68151] New: ICE on using select case with function of wrong type gerhard.steinmetz.fortran@t-online.de
@ 2015-10-29 18:19 ` gerhard.steinmetz.fortran@t-online.de
  0 siblings, 0 replies; 2+ messages in thread
From: gerhard.steinmetz.fortran@t-online.de @ 2015-10-29 18:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
Or depending on used compiler options :

$ cat z3.f90
program p
   real :: z
   integer :: k = 1
   select case (k)
   case (:huge(z))
   end select
end

$ gfortran -fdefault-real-8 z3.f90
f951: internal compiler error: gfc_trans_select(): Bad type for case expr.

---

Analogous with complex :

$ cat z4.f90
program p
   integer :: k = 1
   select case (k)
   case (cmplx(1):)
   end select
end

$ gfortran -fdefault-real-8 z4.f90
f951: internal compiler error: gfc_trans_select(): Bad type for case expr.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-29 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-29 18:19 [Bug fortran/68151] New: ICE on using select case with function of wrong type gerhard.steinmetz.fortran@t-online.de
2015-10-29 18:19 ` [Bug fortran/68151] " gerhard.steinmetz.fortran@t-online.de

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).