Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Affects versions 6 and 7 :
$ cat z1.f90
program p
integer, allocatable :: i
integer :: j
!$acc kernels loop
do j = 1, 2
!$acc loop
do i = 1, 2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68544
Gerhard Steinmetz changed:
What|Removed |Added
CC||gerhard.steinmetz.fortran@t
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68544
--- Comment #4 from Gerhard Steinmetz
---
Invalid code with a function :
$ cat z2.f90
program p
type t
end type
print *, f(t)
end
$ gfortran-7-20161120 z2.f90
z2.f90:2:0:
type t
internal compiler error: Segmentation fault
0xc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68544
--- Comment #5 from Gerhard Steinmetz
---
Affects several intrinsic functions/subroutines ...
$ cat z7.f90
program p
type t
end type
print *, atomic_define(t)
print *, atomic_ref(t)
print *, coshape(t)
print *, cpu_time(t)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68544
--- Comment #6 from Gerhard Steinmetz
---
These snippets are silently accepted (t is not an array nor a scalar).
$ cat z3.f90
program p
type t
end type
print *, shape(t)
end
$ gfortran-7-20161120 -Wall -fcheck=all z3.f90
$ a.out
$
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Created attachment 35483
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35483&action=edit
more code varia
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
An ICE occurs with a misplaced sequence in a function.
$ cat disrupt_2_sequence.f90
real function f(x)
sequence
end
$ gfortran -c disrupt_2_sequence.f90
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66040
--- Comment #1 from Gerhard Steinmetz
---
There are more cases for ICEs on misplaced statements in a function. For
example :
---
real function f()
block data
end
---
real function f()
else
end
---
real function f()
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
---
code snippet 1 :
program p
print *, storage_size([null()])
end
f951: internal compiler error: Invalid expression in gfc_element_size
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Some code snippets :
---
entry e; end
---
subroutine p
end
entry e
end
---
program p
type t
contains
entry e
end type
end
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This incorrect code snippet disrupts :
program p
contains
integer :: null=null()
end
f951: internal compiler error: Segmentation fault
Tested with
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This code fragment with interchanged lines
module p
contains
protected x
end
produces (with gfortran 5.1.1 on SUSE Linux 13.2, 64 bit)
f951
: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This code fragment with a lonely label in a type ...
program p
type t
1 !
end type
end
or this variation ...
program p
type t
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This code fragment with an incomplete generic statement ...
program p
type t
contains
generic
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This code snippet with an incomplete interface operator block ...
program p
interface operator ( .gt. )
end
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This code snippet with a missing parameter value for n ...
program p
character(*), parameter :: z(2) = [character(n
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This simplified code snippet with a zero sized array parameter z ...
program p
integer, parameter :: z(0) = 0
print
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66128
--- Comment #1 from Gerhard Steinmetz
---
Some more examples with other error messages.
This one ...
program p
integer, parameter :: z(0) = 0
print *, count(z > 0)
end
yields :
internal compiler error: in gfc_conv_intrinsic_c
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This initialisation of an array (NOT zero sized, NOT a parameter)
program p
real :: z(2)
z = 1 + [real :: 1, 2]
end
yields (with
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66193
--- Comment #1 from Gerhard Steinmetz
---
For integer instead of real ...
program p
integer :: z(2)
z = 1.2 + [integer :: 3.5, 4.5]
print *, z
end
it compiles with gfortran snippet.f90
but running ./a.out prints an unexp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66193
--- Comment #3 from Gerhard Steinmetz
---
Hmm, no observable difference with option -fno-frontend-optimize, sorry.
Of course I probed some combinations for several options.
One example for a more extensive "debug" run :
gfortran \
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66193
--- Comment #10 from Gerhard Steinmetz
---
Perhaps it's better to make one factor larger.
Maybe the following will help.
$ cat zz1.f90
program p
real :: z(2)
z = 10 + [real :: 1, 2]
print *, z
end
# you may check your pa
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This code snippet ...
program p
integer, target :: a(3)
integer, pointer :: z => a(3)
z = 0
print *, z
end
yields (with gfortran 5.1.1
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This test case with an empty type selector (type is) ...
program p
type t; end type
class(t), allocatable :: x
call s
contains
subroutine
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This small program compiles without any message (gfortran 5.1.1, 4.9.0, 4.8.3)
program p
character :: z =
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
First of all, it's great to support integer(16).
But printing some numbers from range 2^63 to 2^64-1 with this snippet :
program p
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66311
--- Comment #1 from Gerhard Steinmetz
---
Of course, some computations are wrong, too.
For example :
program p
integer(8), parameter :: z = huge(1_8)
print *, 2_16 * z
print *, 2 * int(z, 16)
print *, 2_16 * int(z, 1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66310
--- Comment #3 from Gerhard Steinmetz
---
I do agree, that some extra temporary data is necessary and there
should be a practical (high) limit for something like that.
Let the helper buffers be five or ten times the amount of the
effectively wr
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67524
--- Comment #1 from Gerhard Steinmetz
---
Here, all variables are declared explicitly,
but using "implicit character" ...
$ cat z1_imchfe.f90
module m
implicit character(8) (a-z)
contains
function f(x)
integer :: x
integer ::
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67524
--- Comment #2 from Gerhard Steinmetz
---
There is no problem when
implicit character(8) (a-z)
is changed to one of
implicit none
implicit integer (a-z)
implicit logical (a-z)
implicit real (a-z)
implicit complex (a-z)
...
: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This test case with an improper selector ...
real function f(x)
select type (x)
end select
end
or this variation ...
real function f(x
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67525
--- Comment #1 from Gerhard Steinmetz
---
Whereas :
$ cat y1.f90
subroutine f(x)
select type (x)
end select
end
$ gfortran -c y1.f90
y1.f90:2:18:
select type (x)
1
Error: Selector shall be polymorphic in SELECT TYP
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
A missing end parenthesis :
program p
character :: c1 = 'abc'(:
character :: c2 = 'abc'(3:
charac
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67526
--- Comment #1 from Gerhard Steinmetz
---
Whereas :
$ cat y1.f90
program p
character(3) :: z = 'abc'
character :: c1 = z(3:
end
$ gfortran y1.f90
y1.f90:3:24:
character :: c1 = z(3:
1
Error: Syntax error in a
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This test case with a longer array in initializer of y :
$ cat z1.f90
program p
type t
integer :: n
character(8) :: c(1)
end type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67542
--- Comment #1 from Gerhard Steinmetz
---
The ICE disappears if some prints are added :
$ cat z2.f90
program p
type t
integer :: n
character(8) :: c(1)
end type
type(t) :: x = t(1, ['a'])
type(t) :: y = t(1, ['a', 'b'])
: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This construct with an improper association with null ...
subroutine s
associate (x => null())
end associate
end subroutine
or this variat
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Some cases with oldstyle arithmetic if in combination with null
instead of a scalar-numeric-expr :
$ cat z1.f90
program p
integer, allocatable :: z
if ( null(z
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67614
--- Comment #1 from Gerhard Steinmetz
---
$ cat z4.f90
program p
integer, pointer :: z => null()
if ( z ) 1, 2, 3
1 stop 1
2 stop 2
3 stop 3
end
$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize z4.f90
$ a.out
Program receive
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
An arithmetic if with an array instead of a numeric scalar :
program p
integer :: z(1) = [1]
if ( z ) 1, 2, 3
1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67615
--- Comment #1 from Gerhard Steinmetz
---
With an array constructor :
$ cat z6.f90
program p
if ( [1] ) 1, 2, 3
if ( [1, -1] ) 1, 2, 3
if ( [real :: 1, -1] ) 1, 2, 3
1 stop 1
2 stop 2
3 stop 3
end
$ gfortran -g -O0 -Wall -fcheck=
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
With an embedding block construct :
$ cat z1.f90
program p
type t
end type
block
type(t) :: x
data x /t()/
end block
end
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67616
--- Comment #1 from Gerhard Steinmetz
---
Compiles without block :
program p
type t
end type
type(t) :: x
data x /t()/
end
Compiles with block and intrinsic type :
program p
block
integer :: x
data x /1/
end blo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67614
--- Comment #4 from Gerhard Steinmetz
---
In general, a future extension to check pointer status
looks promising (at compile time and runtime).
With a tiny and simple source the problem is clear and
obvious, but for large and complex codes ofte
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67614
--- Comment #5 from Gerhard Steinmetz
---
For comparison, a logical if (assumes scalar-logical-expr
instead of scalar-numeric-expr in arithmetic if) "avoids"
an ICE. Analogous examples :
$ cat y1.f90
program p
logical, allocatable :: z
i
: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
With a wrong data type for len instead of a scalar-int-expr :
$ cat za2.f90
program p
character(1.) :: c1 = ' '
character(
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67802
--- Comment #1 from Gerhard Steinmetz
---
Whereas, without initialization relevant errors are detected :
$ cat za1.f90
program p
character(1.) :: c1
character(1d1) :: c2
character((0.,1.)) :: c3
character(.true.) :: c4
end
$ cat
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67803
--- Comment #1 from Gerhard Steinmetz
---
Whereas :
$ cat z2.f90
program p
character(2) :: x(1)
x = '0' // [character :: '1']
print *, x
end
$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize z2.f90
$ a.out
01
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
With wrong data in a character array constructor :
$ cat z1.f90
program p
character(2) :: x(1)
x = '0' // [character :: 1]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67804
--- Comment #1 from Gerhard Steinmetz
---
Correct with a scalar string :
$ cat z2.f90
program p
type t
character :: c
end type
type(t) :: x
data x /t('1')/
print *, x
end
$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-o
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
With wrong type of data in initializer t() :
$ cat z1.f90
program p
type t
character :: c
end type
type(t
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This code :
$ cat z1.f90
program p
print *, [character('') :: 'x', 'y']
end
and this varia
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67805
--- Comment #1 from Gerhard Steinmetz
---
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67805
--- Comment #2 from Gerhard Steinmetz
---
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.
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This code :
$ cat z1.f90
program p
type t
character(null()) :: c
end type
type(t) :: x = t('a')
end
yields :
$ gfortran -g
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67806
--- Comment #1 from Gerhard Steinmetz
---
Silently accepted without declaring x :
$ cat z4b.f90
program p
integer, pointer :: n
type t
character(null(n)) :: c
end type
end
$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimi
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67779
Gerhard Steinmetz changed:
What|Removed |Added
CC||gerhard.steinmetz.fortran@t
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
For the following cases an error message should be given.
Rejection makes it comparable to other ways of initialization.
(add
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67817
--- Comment #1 from Gerhard Steinmetz
---
More examples analogous to z1.f90 :
$ cat z4.f90
program p
type t
complex :: a
end type
type(t) :: x6, x8
data x6 /t(.true.)/
data x8 /t('1')/
end
$ cat z5.f90
program p
type
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
With an effectively empty (i=m,n and m>n) array constructor :
$ cat z1.f90
program p
integer i
print *, [(f(i), i=2,1)]
contains
function
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This definition of f is incomplete :
$ cat z2a.f90
program p
integer i
print *, [(f(i), i=1,3)]
contains
function f(n
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67884
--- Comment #1 from Gerhard Steinmetz
---
Whereas, detected with explicit result variable :
$ cat z5a.f90
program p
integer i
print *, [(f(i), i=1,3)]
contains
function f(n) result(z)
integer :: n
character(:) :: z
ch
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Using a parameter array in a block with an inner block :
$ cat z1.f90
program p
block
real, parameter :: a(2) = 1.0
real :: x(2)
x = a
block
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67885
--- Comment #1 from Gerhard Steinmetz
---
Deleting this inner block gives another error :
$ cat z5.f90
program p
block
real, parameter :: a(2) = 1.0
real :: x(2)
x = a
print *, x
end block
end
$ gfortran -g -O0 -
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67885
--- Comment #4 from Gerhard Steinmetz
---
Deleting the dimension from parameter a (making it scalar)
lets examples z1.f90 and z5.f90 compile and run fine.
$ cat y1.f90
program p
block
real, parameter :: a = 1.0
real :: x(2)
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Knowing that assumed rank is preliminary f2015, but :
$ cat z2.f90
program p
implicit none
character(1) :: z(3)
call s
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67938
--- Comment #1 from Gerhard Steinmetz
---
$ cat z1.f90
program p
implicit none
character(1) :: z(3)
call s(z)
contains
subroutine s(x)
character(1) :: x(..)
print *, lbound(x)
print *, ubound(x)
end subroutine
en
: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Depending on compiler options the following codes
show different reactions (sometimes with hanging process).
Depending on environment settings too (e.g. $LANG
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67939
--- Comment #1 from Gerhard Steinmetz
---
$ echo $LANG
de_DE.UTF-8
$ echo $LC_ALL
$ cat z3.f90
program p
character(8) :: x
data x(3:1) /'abc'/
end
$ gfortran -g -O0 z3.f90
z3.f90:3:17:
data x(3:1) /'abc'/
1
Warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67938
--- Comment #2 from Gerhard Steinmetz
---
As meanwhile noticed, example z1.f90 from comment #1 overlaps with PR66833.
Examples z2.f90 (comment #0) and z1s.f90 are describing additional effects.
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Declaring and initializing a character with negative len (< -1)
requests memory of about 2^64 (= 18446744073709551
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Accessing a correctly declared character with negative substring-
range (len < -1) e.g. inside of an array construc
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
With a rank mismatch of "arr" :
$ cat z1.f90
program p
integer :: i
type t
integer :: n
end type
P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Based on f2008 (5.3.8.6), an implied-shape array is declared with
an implied-shape-spec-list. This works excellent for rank 1 and 2,
but is rejected
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
There is yet another issue. Now marked as error,
but a specification-expr is allowed in every "lower-bound:*".
$ cat z1x.f90
program p
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68053
--- Comment #1 from Gerhard Steinmetz
---
Accepted and correct, if scalar parameter n is used instead :
$ cat z1s.f90
program p
integer, parameter :: n = -1
integer, parameter :: x(1) = 7
integer, parameter :: z(n:*) = x
print *, z
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Without an explicit program statement :
$ cat z1.f90
!program p
real, protected :: x
end
$ gfortran -g -O0
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Without an explicit program statement :
$ cat z1.f90
!program p
real*9 :: c
write (c, '(i3)') 1
end
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68055
--- Comment #1 from Gerhard Steinmetz
---
Simplified. Still different behaviour :
$ cat z3.f90
!program p
integer*3 c
print *, c
end
$ gfortran -g -O0 -Wall -fcheck=all z3.f90
z3.f90:2:0:
integer*3 c
1
internal compiler error: Segm
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68055
--- Comment #5 from Gerhard Steinmetz
---
Sorry for answering late, but most of the time I am "offline"
from several streams.
Up to now I'm using mostly precompiled/configured packages from
SUSE, currently gcc version 5.2.1 (+r228597). For s
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68151
--- Comment #1 from Gerhard Steinmetz
---
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
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Declaring both function result and entry result as array :
$ cat z1.f90
function f(n)
integer, intent(in) :: n
real :: f(n)
real :: e(n)
entry
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68152
--- Comment #1 from Gerhard Steinmetz
---
Detected with one single defect :
$ cat z2.f90
function f(n)
integer, intent(in) :: n
real :: f(n)
real :: e
entry e(n)
end
$ gfortran -g -O0 -Wall -fcheck=all z2.f90
z2.f90:1:0:
function f
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This code with negative dimension(s) in shape sh :
$ cat z1.f90
program p
integer, parameter :: sh(2) = [2, -2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68153
--- Comment #1 from Gerhard Steinmetz
---
Detected, but pointing to the line before :
$ cat z3.f90
program p
integer, parameter :: sh(2) = [2, 2]
integer, parameter :: a(2,2) = reshape([1, 2, 3, 4], -sh)
print *, a
end
$ gfortran -g -
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Some variants of initializing a character parameter array
(explicit-shape, implied-shape) are not working :
$ cat z1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68154
--- Comment #1 from Gerhard Steinmetz
---
These variants are working well :
$ cat z0.f90
program p
character(*), parameter :: c0(2) = 'a'
character(*), parameter :: c1(*) = ['a', 'b']
character(*), parameter :: c2(*) = [character(2) :
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68155
--- Comment #1 from Gerhard Steinmetz
---
Works with len_lhs == len_rhs :
$ cat z2t.f90
program p
type t
character(2) :: z(1) = 'a' // ['y']
end type
type(t) :: z
print *, z
end
$ gfortran -g -O0 -Wall -fcheck=all z2t.f90
$ a
normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Embedded in a type :
$ cat z1t.f90
program p
type t
character(2) :: z(1) = '' // ['y
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68155
--- Comment #2 from Gerhard Steinmetz
---
Fails (again len_lhs <> len_rhs) :
$ cat z3t.f90
program p
type t
character(2) :: z(1) = 'ab' // ['y']
end type
type(t) :: z
print *, z
end
$ gfortran -g -O0 -Wall -fcheck=all z3t.f90
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
Referencing a parameter array with dimension null :
$ cat z1.f90
program p
integer, parameter :: c(null()) = [1, 2]
integer, parameter :: a = c(1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68224
--- Comment #1 from Gerhard Steinmetz
---
Detected when assignment is separated from declaration :
$ cat z6.f90
program p
integer, parameter :: c(null()) = [1, 2]
integer :: a, b
a = c(1)
b = c(2)
end
$ gfortran -g -O0 -Wall -fchec
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68225
--- Comment #1 from Gerhard Steinmetz
---
Adding one type extension :
$ cat z0.f90
program p
type t
integer, allocatable :: a
end type
type, extends(t) :: t2
integer, allocatable :: b
end type
type(t2) :: x
x = t2(
: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This case aborts with option -Wrealloc-lhs-all :
$ cat y0.f90
program p
type t
integer
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68225
--- Comment #2 from Gerhard Steinmetz
---
Here, one or both components are initialized :
$ cat z1.f90
program p
type t
integer, allocatable :: a
end type
type, extends(t) :: t2
integer, allocatable :: b
end type
type(
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This wrong code :
$ cat z1.f90
program p
type t
integer :: n
end type
type(t), allocatable :: a(:)
a = f
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68226
--- Comment #1 from Gerhard Steinmetz
---
As a note, a correct code compiles and works :
$ cat z1ok.f90
program p
type t
integer :: n
end type
type(t), pointer :: a(:)
a => f()
print *, a
contains
function f() result(r)
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fort...@t-online.de
Target Milestone: ---
This code with variable n :
$ cat y2.f90
program p
type t
end type
type t2
type(t), pointer :: a
end type
301 - 400 of 588 matches
Mail list logo