* [Bug fortran/57117] ICE for sourced allocation of a UP entity that uses the transpose intrinsic
2013-04-29 19:59 [Bug fortran/57117] New: ICE for sourced allocation of a UP entity that uses the transpose intrinsic Bader at lrz dot de
@ 2013-04-29 21:34 ` dominiq at lps dot ens.fr
2013-04-30 12:22 ` [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE janus at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-04-29 21:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57117
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-04-29
Ever Confirmed|0 |1
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-04-29 21:34:28 UTC ---
Confirmed. If I comment out the block
call construct(x, 1)
allocate(y(3,3), source=transpose(x))
select type (y)
type is(ti)
if (y(3,1)%i /= 7) ok(5) = .false.
class default
ok(6) = .false.
end select
deallocate(y) <--- it should be deallocate(x, y) otherwise call construct(x,
2) complains
then I get the following ICE
pr57117_db.f90: In function 'intr_02':
pr57117_db.f90:86:0: internal compiler error: in gfc_conv_procedure_call, at
fortran/trans-expr.c:4888
allocate(z(9), source=reshape(x, (/ 9 /)))
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE
2013-04-29 19:59 [Bug fortran/57117] New: ICE for sourced allocation of a UP entity that uses the transpose intrinsic Bader at lrz dot de
2013-04-29 21:34 ` [Bug fortran/57117] " dominiq at lps dot ens.fr
@ 2013-04-30 12:22 ` janus at gcc dot gnu.org
2015-10-25 15:54 ` pault at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2013-04-30 12:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57117
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |janus at gcc dot gnu.org
Summary|CLASS(*): ICE for sourced |[OOP] ICE for sourced
|allocation of a UP entity |allocation of a polymorphic
|that uses the transpose |entity using TRANSPOSE
|intrinsic |
--- Comment #2 from janus at gcc dot gnu.org 2013-04-30 12:22:40 UTC ---
Also this one can be triggered without UP:
implicit none
type :: ti
end type
class(ti), allocatable :: x(:,:), y(:,:)
allocate(y(3,3), source=transpose(x))
end
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE
2013-04-29 19:59 [Bug fortran/57117] New: ICE for sourced allocation of a UP entity that uses the transpose intrinsic Bader at lrz dot de
2013-04-29 21:34 ` [Bug fortran/57117] " dominiq at lps dot ens.fr
2013-04-30 12:22 ` [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE janus at gcc dot gnu.org
@ 2015-10-25 15:54 ` pault at gcc dot gnu.org
2015-10-28 14:58 ` pault at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu.org @ 2015-10-25 15:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57117
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org
--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> ---
The result from the reshape call is completely screwed up. The temporary, is
descriptor, whose data field is class objects, rather than returning the _data
field of the class object.
I can see how to fix this.
Paul
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE
2013-04-29 19:59 [Bug fortran/57117] New: ICE for sourced allocation of a UP entity that uses the transpose intrinsic Bader at lrz dot de
` (2 preceding siblings ...)
2015-10-25 15:54 ` pault at gcc dot gnu.org
@ 2015-10-28 14:58 ` pault at gcc dot gnu.org
2015-10-28 17:24 ` dominiq at lps dot ens.fr
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu.org @ 2015-10-28 14:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57117
--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 36609
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36609&action=edit
Draft patch for the PR
The two TODOs should be noted. These must be fixed before submission. However,
this patch does regtest without regressions.
The following version of the testcase runs correctly.
Cheers
Paul
implicit none
integer :: j, k
type :: ti
real(8) :: r
end type
type, extends (ti) :: ri
integer :: i
end type
class(ti), allocatable :: x(:,:), z(:)
allocate (z, source = [(ti (real (j)), j = 1, 9)])
allocate(x(3,3), source=reshape(z, (/ 3,3 /)))
call foo
deallocate (z, x)
allocate (z, source = [(ri (real (j), j), j = 1, 9)])
allocate(x(3,3), source=reshape(z, (/ 3,3 /)))
call foo
deallocate (z, x)
contains
subroutine foo
select type (x)
type is (ti)
print *, "ti"
print *, x%r
type is (ri)
print *, "ri"
print *, x%r
print *, x%i
class default
call abort
end select
end subroutine
end
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE
2013-04-29 19:59 [Bug fortran/57117] New: ICE for sourced allocation of a UP entity that uses the transpose intrinsic Bader at lrz dot de
` (3 preceding siblings ...)
2015-10-28 14:58 ` pault at gcc dot gnu.org
@ 2015-10-28 17:24 ` dominiq at lps dot ens.fr
2015-10-29 12:33 ` dominiq at lps dot ens.fr
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-28 17:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57117
--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Created attachment 36609 [details]
> Draft patch for the PR
With this patch, the tests in this PR compile. However it seems that there is a
remaining issue with "allocate(y(3,3), source=transpose(x))": running the
original test outputs
FAIL: T T T T F T T T T T T T T T T
'y' seems to be filled with 'x' and not 'transpose(x)'.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE
2013-04-29 19:59 [Bug fortran/57117] New: ICE for sourced allocation of a UP entity that uses the transpose intrinsic Bader at lrz dot de
` (4 preceding siblings ...)
2015-10-28 17:24 ` dominiq at lps dot ens.fr
@ 2015-10-29 12:33 ` dominiq at lps dot ens.fr
2015-10-29 19:02 ` pault at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-29 12:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57117
--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Related to/duplicate of pr55824? Still fails for
"allocate(vector,source=pack(array,.true.))".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE
2013-04-29 19:59 [Bug fortran/57117] New: ICE for sourced allocation of a UP entity that uses the transpose intrinsic Bader at lrz dot de
` (5 preceding siblings ...)
2015-10-29 12:33 ` dominiq at lps dot ens.fr
@ 2015-10-29 19:02 ` pault at gcc dot gnu.org
2015-10-30 8:38 ` dominiq at lps dot ens.fr
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu.org @ 2015-10-29 19:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57117
--- Comment #9 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 36618
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36618&action=edit
A completely different approach to the fix.
This one does far better and is less invasive. It is not yet regtested but I am
certain that any problems will be trivial.
I will try with other transformational intrinsics than transpose and rehape,
whilst on tonight's flight to London.
Cheers
Paul
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE
2013-04-29 19:59 [Bug fortran/57117] New: ICE for sourced allocation of a UP entity that uses the transpose intrinsic Bader at lrz dot de
` (6 preceding siblings ...)
2015-10-29 19:02 ` pault at gcc dot gnu.org
@ 2015-10-30 8:38 ` dominiq at lps dot ens.fr
2015-10-30 9:29 ` paul.richard.thomas at gmail dot com
2015-10-30 9:39 ` dominiq at lps dot ens.fr
9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-30 8:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57117
--- Comment #10 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Created attachment 36618
> --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36618&action=edit
> A completely different approach to the fix.
>
> This one does far better and is less invasive. It is not yet regtested
> but I am certain that any problems will be trivial.
This patch does not like reshape and pack.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE
2013-04-29 19:59 [Bug fortran/57117] New: ICE for sourced allocation of a UP entity that uses the transpose intrinsic Bader at lrz dot de
` (7 preceding siblings ...)
2015-10-30 8:38 ` dominiq at lps dot ens.fr
@ 2015-10-30 9:29 ` paul.richard.thomas at gmail dot com
2015-10-30 9:39 ` dominiq at lps dot ens.fr
9 siblings, 0 replies; 11+ messages in thread
From: paul.richard.thomas at gmail dot com @ 2015-10-30 9:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57117
--- Comment #11 from paul.richard.thomas at gmail dot com <paul.richard.thomas at gmail dot com> ---
Dear Dominique,
That's odd, it does fine with reshape on my machine ****sigh****
Could you send me the error, please?
pack generates a completely new ICE in the most peculiar place.
I have to put this on one side for a few days. I feel that I have got
to the core of the problem.but need to sort out the implementation.
With best regards
Paul
On 30 October 2015 at 09:38, dominiq at lps dot ens.fr
<gcc-bugzilla@gcc.gnu.org> wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57117
>
> --- Comment #10 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
>> Created attachment 36618
>> --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36618&action=edit
>> A completely different approach to the fix.
>>
>> This one does far better and is less invasive. It is not yet regtested
>> but I am certain that any problems will be trivial.
>
> This patch does not like reshape and pack.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You are the assignee for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/57117] [OOP] ICE for sourced allocation of a polymorphic entity using TRANSPOSE
2013-04-29 19:59 [Bug fortran/57117] New: ICE for sourced allocation of a UP entity that uses the transpose intrinsic Bader at lrz dot de
` (8 preceding siblings ...)
2015-10-30 9:29 ` paul.richard.thomas at gmail dot com
@ 2015-10-30 9:39 ` dominiq at lps dot ens.fr
9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-30 9:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57117
--- Comment #12 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> That's odd, it does fine with reshape on my machine ****sigh****
Are you sure to have attached the right patch?
> Could you send me the error, please?
Compiling the test in comment 5 gives
pr57117_3.f90:12:0:
allocate(x(3,3), source=reshape(z, (/ 3,3 /)))
1
internal compiler error: Segmentation fault: 11
The backtrace is
#0 0x000000010010d6fc in vptr_field_get(tree_node*, int) ()
#1 0x0000000100114003 in gfc_copy_class_to_class(tree_node*, tree_node*,
tree_node*, bool) ()
#2 0x000000010016615e in gfc_trans_allocate(gfc_code*) ()
#3 0x00000001000d7798 in trans_code(gfc_code*, tree_node*) ()
#4 0x000000010010a0b6 in gfc_generate_function_code(gfc_namespace*) ()
#5 0x000000010008cd4c in gfc_parse_file() ()
#6 0x00000001000d407b in gfc_be_parse_file() ()
#7 0x0000000100ae893a in compile_file() ()
#8 0x0000000100fbafcc in toplev::main(int, char**) ()
#9 0x0000000100fbc989 in main ()
^ permalink raw reply [flat|nested] 11+ messages in thread