* [Bug fortran/60795] [4.7/4.8/4.9 Regression] Wrong length when allocating character array
2014-04-09 15:00 [Bug fortran/60795] New: Wrong length when allocating character array kergonath at me dot com
@ 2014-04-09 17:08 ` dominiq at lps dot ens.fr
2014-04-09 18:38 ` kargl at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-04-09 17:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60795
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Known to work| |4.6.0
Keywords| |wrong-code
Last reconfirmed| |2014-04-09
CC| |jb at gcc dot gnu.org
Ever confirmed|0 |1
Summary|Wrong length when |[4.7/4.8/4.9 Regression]
|allocating character array |Wrong length when
| |allocating character array
Known to fail| |4.7.4, 4.8.3, 4.9.0
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed, up to revision r173749 I get
10
1
from r173750 to r174379 I get
10
2
and from r174433 up to r209236 I get
10
0
What is surprising is that r173750, r174030, and r174415 are related to
backtrace handling, so they probably only expose a latent problem(?).
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/60795] [4.7/4.8/4.9 Regression] Wrong length when allocating character array
2014-04-09 15:00 [Bug fortran/60795] New: Wrong length when allocating character array kergonath at me dot com
2014-04-09 17:08 ` [Bug fortran/60795] [4.7/4.8/4.9 Regression] " dominiq at lps dot ens.fr
@ 2014-04-09 18:38 ` kargl at gcc dot gnu.org
2014-04-10 0:25 ` quantheory at gmail dot com
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: kargl at gcc dot gnu.org @ 2014-04-09 18:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60795
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #1)
>
> What is surprising is that r173750, r174030, and r174415 are related to
> backtrace handling, so they probably only expose a latent problem(?).
>
I think it is a lot worse than it appears.
call s1
call s2
call s3
end
subroutine s1
character(:), dimension(:), allocatable :: s
allocate(character(10) :: s(2))
s(1) = 'r'
s(2) = 's'
print *, 's1: ', size(s), len(s)
end subroutine s1
!
! A variation on a theme?
!
subroutine s2
! This causes an ICE in gfortran
! character(:), dimension(:), allocatable :: s
! allocate(s(2), source='abc')
! s(1) = 'r'
! s(2) = 's'
! print *, 's2:', size(s), len(s)
end subroutine s2
!
! A variation on a theme?
!
subroutine s3
! This causes an ICE in gfortran
! character(:), dimension(:), allocatable :: s
! allocate(s(2), source=['abc','def'])
! allocate(s, source=['abc','def'])
! s(1) = 'r'
! s(2) = 's'
! print *, 's3:', size(s), len(s)
end subroutine s3
subroutine y3
! This causes gfortran to issue an error. Incorrect!
! character(:), dimension(:), allocatable :: s
! allocate(s, source=['abc','def'])
! s(1) = 'r'
! s(2) = 's'
! print *, 's3:', size(s), len(s)
end subroutine y3
subroutine t3
! This causes gfortran to issue an error. Incorrect!
! real, dimension(:), allocatable :: s
! allocate(s, source=[1., 2.])
end subroutine t3
subroutine s4
! This causes an ICE in gfortran
! character(3), dimension(:), allocatable :: s
! allocate(s(2), source=['abc','def'])
! s(1) = 'r'
! s(2) = 's'
! print *, 's3:', size(s), len(s)
end subroutine s4
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/60795] [4.7/4.8/4.9 Regression] Wrong length when allocating character array
2014-04-09 15:00 [Bug fortran/60795] New: Wrong length when allocating character array kergonath at me dot com
2014-04-09 17:08 ` [Bug fortran/60795] [4.7/4.8/4.9 Regression] " dominiq at lps dot ens.fr
2014-04-09 18:38 ` kargl at gcc dot gnu.org
@ 2014-04-10 0:25 ` quantheory at gmail dot com
2014-04-10 9:30 ` kergonath at me dot com
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: quantheory at gmail dot com @ 2014-04-10 0:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60795
Sean Santos <quantheory at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |quantheory at gmail dot com
--- Comment #3 from Sean Santos <quantheory at gmail dot com> ---
In comment 2, "y3", "t3", and the second allocation of "s3" are all cases of
PR44672; this is an unsupported feature of F2008.
The original case (comment 0, "s1") may be a duplicate of PR57456.
The case "s2" looks like a duplicate of PR58754, and "s3" and "s4" may be the
same issue. Or they may be related to PR50221.
So there are clearly some issues here, but I think that they are mostly old
issues, i.e. arrays of deferred-length strings have always been somewhat
broken.
I remember something about some intention to address this when implementing the
new array descriptor, though?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/60795] [4.7/4.8/4.9 Regression] Wrong length when allocating character array
2014-04-09 15:00 [Bug fortran/60795] New: Wrong length when allocating character array kergonath at me dot com
` (2 preceding siblings ...)
2014-04-10 0:25 ` quantheory at gmail dot com
@ 2014-04-10 9:30 ` kergonath at me dot com
2014-04-11 9:13 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: kergonath at me dot com @ 2014-04-10 9:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60795
--- Comment #4 from Kergonath <kergonath at me dot com> ---
The slightly modified version:
module m
contains
subroutine allocate_array(s_array)
character(:), dimension(:), allocatable, intent(out) :: s_array
allocate(character(2) :: s_array(10))
write(*,*) len(s_array), size(s_array)
end subroutine
end module
program stringtest
use m
character(:), dimension(:), allocatable :: s4
call allocate_array(s4)
write(*,*) len(s4), size(s4)
end program
gives the result:
0 10
0 10
when compiled with: gfortran -o stringtest stringtest.f90
but gives
0 10
32767 10
when using the -pg option.
Using -Wall does only show the following warning, which looks similar to that
in PR56670:
stringtest.f90: In function 'allocate_array':
stringtest.f90:7:0: warning: '.s_array' may be used uninitialized in this
function [-Wmaybe-uninitialized]
write(*,*) len(s_array), size(s_array)
^
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/60795] [4.7/4.8/4.9 Regression] Wrong length when allocating character array
2014-04-09 15:00 [Bug fortran/60795] New: Wrong length when allocating character array kergonath at me dot com
` (3 preceding siblings ...)
2014-04-10 9:30 ` kergonath at me dot com
@ 2014-04-11 9:13 ` rguenth at gcc dot gnu.org
2014-06-12 13:43 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-11 9:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60795
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
Target Milestone|--- |4.7.4
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/60795] [4.7/4.8/4.9 Regression] Wrong length when allocating character array
2014-04-09 15:00 [Bug fortran/60795] New: Wrong length when allocating character array kergonath at me dot com
` (4 preceding siblings ...)
2014-04-11 9:13 ` rguenth at gcc dot gnu.org
@ 2014-06-12 13:43 ` rguenth at gcc dot gnu.org
2014-07-10 19:10 ` [Bug fortran/60795] [4.8/4.9/4.10 " dominiq at lps dot ens.fr
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-12 13:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60795
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.7.4 |4.8.4
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
The 4.7 branch is being closed, moving target milestone to 4.8.4.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/60795] [4.8/4.9/4.10 Regression] Wrong length when allocating character array
2014-04-09 15:00 [Bug fortran/60795] New: Wrong length when allocating character array kergonath at me dot com
` (5 preceding siblings ...)
2014-06-12 13:43 ` rguenth at gcc dot gnu.org
@ 2014-07-10 19:10 ` dominiq at lps dot ens.fr
2014-12-19 13:27 ` [Bug fortran/60795] [4.8/4.9/5 " jakub at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-07-10 19:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60795
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.8/4.9 Regression] Wrong |[4.8/4.9/4.10 Regression]
|length when allocating |Wrong length when
|character array |allocating character array
--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still present in 4.10 r212433, adjusting the summary.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/60795] [4.8/4.9/5 Regression] Wrong length when allocating character array
2014-04-09 15:00 [Bug fortran/60795] New: Wrong length when allocating character array kergonath at me dot com
` (6 preceding siblings ...)
2014-07-10 19:10 ` [Bug fortran/60795] [4.8/4.9/4.10 " dominiq at lps dot ens.fr
@ 2014-12-19 13:27 ` jakub at gcc dot gnu.org
2015-06-23 8:19 ` [Bug fortran/60795] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-19 13:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60795
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.4 |4.8.5
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.4 has been released.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/60795] [4.8/4.9/5/6 Regression] Wrong length when allocating character array
2014-04-09 15:00 [Bug fortran/60795] New: Wrong length when allocating character array kergonath at me dot com
` (7 preceding siblings ...)
2014-12-19 13:27 ` [Bug fortran/60795] [4.8/4.9/5 " jakub at gcc dot gnu.org
@ 2015-06-23 8:19 ` rguenth at gcc dot gnu.org
2015-06-26 19:56 ` [Bug fortran/60795] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:28 ` jakub at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-23 8:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60795
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.5 |4.9.3
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/60795] [4.9/5/6 Regression] Wrong length when allocating character array
2014-04-09 15:00 [Bug fortran/60795] New: Wrong length when allocating character array kergonath at me dot com
` (8 preceding siblings ...)
2015-06-23 8:19 ` [Bug fortran/60795] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
@ 2015-06-26 19:56 ` jakub at gcc dot gnu.org
2015-06-26 20:28 ` jakub at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 19:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60795
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.3 has been released.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug fortran/60795] [4.9/5/6 Regression] Wrong length when allocating character array
2014-04-09 15:00 [Bug fortran/60795] New: Wrong length when allocating character array kergonath at me dot com
` (9 preceding siblings ...)
2015-06-26 19:56 ` [Bug fortran/60795] [4.9/5/6 " jakub at gcc dot gnu.org
@ 2015-06-26 20:28 ` jakub at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60795
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.9.3 |4.9.4
^ permalink raw reply [flat|nested] 12+ messages in thread