public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/67805] New: ICE on array constructor with wrong character specification
@ 2015-10-01 17:55 gerhard.steinmetz.fortran@t-online.de
  2015-10-01 17:56 ` [Bug fortran/67805] " gerhard.steinmetz.fortran@t-online.de
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gerhard.steinmetz.fortran@t-online.de @ 2015-10-01 17:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67805
           Summary: ICE on array constructor with wrong character
                    specification
           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: ---

This code :

$ cat z1.f90
program p
   print *, [character('') :: 'x', 'y']
end


and this variation :

$ cat z2.f90
program p
   print *, [character(['']) :: 'x', 'y']
end


yields :
$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize z1.f90
internal compiler error: in gfc_conv_expr_val, at fortran/trans-expr.c:7263


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

* [Bug fortran/67805] ICE on array constructor with wrong character specification
  2015-10-01 17:55 [Bug fortran/67805] New: ICE on array constructor with wrong character specification gerhard.steinmetz.fortran@t-online.de
@ 2015-10-01 17:56 ` gerhard.steinmetz.fortran@t-online.de
  2015-10-01 17:58 ` gerhard.steinmetz.fortran@t-online.de
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: gerhard.steinmetz.fortran@t-online.de @ 2015-10-01 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
For these variants :


$ cat z4.f90
program p
   print *, [character([.true.]) :: 'x', 'y']
   print *, [character([.false.]) :: 'x', 'y']
   print *, [character([1.]) :: 'x', 'y']
   print *, [character([1d1]) :: 'x', 'y']
   print *, [character([(0.,1.)]) :: 'x', 'y']
   print *, [character([null()]) :: 'x', 'y']
end


$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize z4.f90
internal compiler error: in gfc_conv_array_constructor_expr, at
fortran/trans-expr.c:6326


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

* [Bug fortran/67805] ICE on array constructor with wrong character specification
  2015-10-01 17:55 [Bug fortran/67805] New: ICE on array constructor with wrong character specification gerhard.steinmetz.fortran@t-online.de
  2015-10-01 17:56 ` [Bug fortran/67805] " gerhard.steinmetz.fortran@t-online.de
@ 2015-10-01 17:58 ` gerhard.steinmetz.fortran@t-online.de
  2015-10-10  8:12 ` dominiq at lps dot ens.fr
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: gerhard.steinmetz.fortran@t-online.de @ 2015-10-01 17:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
And these variants are silently accepted :


$ cat z5.f90
program p
   print *, '1: ', [character(.true.) :: 'x', 'y']
   print *, '2: ', [character(.false.) :: 'x', 'y']
   print *, '3: ', [character(1.) :: 'x', 'y']
   print *, '4: ', [character(1d1) :: 'x', 'y']
   print *, '5: ', [character((0.,1.)) :: 'x', 'y']
   print *, '6: ', [character(null()) :: 'x', 'y']
end


$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize z5.f90
$ a.out
 1: xy
 2:
 3: xy
 4: xyy
 5:
 6:


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

* [Bug fortran/67805] ICE on array constructor with wrong character specification
  2015-10-01 17:55 [Bug fortran/67805] New: ICE on array constructor with wrong character specification gerhard.steinmetz.fortran@t-online.de
  2015-10-01 17:56 ` [Bug fortran/67805] " gerhard.steinmetz.fortran@t-online.de
  2015-10-01 17:58 ` gerhard.steinmetz.fortran@t-online.de
@ 2015-10-10  8:12 ` dominiq at lps dot ens.fr
  2015-10-22 19:09 ` kargl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-10  8:12 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-10-10
     Ever confirmed|0                           |1
      Known to fail|                            |4.8.5, 4.9.3, 5.2.0, 6.0

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed from 4.8 up to trunk (6.0).


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

* [Bug fortran/67805] ICE on array constructor with wrong character specification
  2015-10-01 17:55 [Bug fortran/67805] New: ICE on array constructor with wrong character specification gerhard.steinmetz.fortran@t-online.de
                   ` (2 preceding siblings ...)
  2015-10-10  8:12 ` dominiq at lps dot ens.fr
@ 2015-10-22 19:09 ` kargl at gcc dot gnu.org
  2015-10-24 16:21 ` kargl at gcc dot gnu.org
  2015-10-29 19:43 ` kargl at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-10-22 19:09 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |kargl at gcc dot gnu.org

--- Comment #4 from kargl at gcc dot gnu.org ---
I have patch cooking.  It works for everything except the use of NULL()

!   s =  [character(null()) :: 'x', 'y']  ! This should cause an error.
!   print *, '6: ', [character(null()) :: 'x', 'y'] ! This should cause an
error.

and an array

   integer, parameter :: m(3) = [1, 2, 3]
   character(len=1) s(2)
   s = [character(m(1)) :: 'x', 'y']      ! OK.
   s = [character(m) :: 'x', 'y']         ! This should cause an error.
   s = [character(m(2:3)) :: 'x', 'y']    ! This should cause an error.


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

* [Bug fortran/67805] ICE on array constructor with wrong character specification
  2015-10-01 17:55 [Bug fortran/67805] New: ICE on array constructor with wrong character specification gerhard.steinmetz.fortran@t-online.de
                   ` (3 preceding siblings ...)
  2015-10-22 19:09 ` kargl at gcc dot gnu.org
@ 2015-10-24 16:21 ` kargl at gcc dot gnu.org
  2015-10-29 19:43 ` kargl at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-10-24 16:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Sat Oct 24 16:20:26 2015
New Revision: 229287

URL: https://gcc.gnu.org/viewcvs?rev=229287&root=gcc&view=rev
Log:
2015-10-24  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/67805
        * array.c (gfc_match_array_constructor): Check for error from type
        spec matching.
        * decl.c (char_len_param_value): Check for valid of charlen parameter.
        Reap dead code dating to 2008.
        match.c (gfc_match_type_spec): Special case the keyword use in REAL.

2015-10-24  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/67805
        * gfortran.dg/pr67805.f90: New testcase.
        * gfortran.dg/array_constructor_26.f03: Update testcase.
        * gfortran.dg/array_constructor_27.f03: Ditto.
        * gfortran.dg/char_type_len_2.f90: Ditto.
        * gfortran.dg/pr67802.f90: Ditto.
        * gfortran.dg/used_before_typed_3.f90: Ditto.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr67805.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/array.c
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/match.c
    trunk/gcc/testsuite/gfortran.dg/array_constructor_26.f03
    trunk/gcc/testsuite/gfortran.dg/array_constructor_27.f03
    trunk/gcc/testsuite/gfortran.dg/char_type_len_2.f90
    trunk/gcc/testsuite/gfortran.dg/large_real_kind_3.F90
    trunk/gcc/testsuite/gfortran.dg/pr67802.f90
    trunk/gcc/testsuite/gfortran.dg/used_before_typed_3.f90


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

* [Bug fortran/67805] ICE on array constructor with wrong character specification
  2015-10-01 17:55 [Bug fortran/67805] New: ICE on array constructor with wrong character specification gerhard.steinmetz.fortran@t-online.de
                   ` (4 preceding siblings ...)
  2015-10-24 16:21 ` kargl at gcc dot gnu.org
@ 2015-10-29 19:43 ` kargl at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-10-29 19:43 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.3

--- Comment #7 from kargl at gcc dot gnu.org ---
Fixed on trunk and 5-branch.  Thanks for the bug report.


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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-01 17:55 [Bug fortran/67805] New: ICE on array constructor with wrong character specification gerhard.steinmetz.fortran@t-online.de
2015-10-01 17:56 ` [Bug fortran/67805] " gerhard.steinmetz.fortran@t-online.de
2015-10-01 17:58 ` gerhard.steinmetz.fortran@t-online.de
2015-10-10  8:12 ` dominiq at lps dot ens.fr
2015-10-22 19:09 ` kargl at gcc dot gnu.org
2015-10-24 16:21 ` kargl at gcc dot gnu.org
2015-10-29 19:43 ` kargl at gcc dot gnu.org

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