* [Bug fortran/40737] Pointer references sometimes fail to define "span" symbols
2009-07-13 21:37 [Bug fortran/40737] New: Pointer references sometimes fail to define "span" symbols dh458 at oakapple dot net
@ 2009-07-13 21:39 ` dh458 at oakapple dot net
2009-07-13 21:40 ` dh458 at oakapple dot net
` (9 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: dh458 at oakapple dot net @ 2009-07-13 21:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from dh458 at oakapple dot net 2009-07-13 21:39 -------
Created an attachment (id=18189)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18189&action=view)
module definition
This is the module definition file for the bug report.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40737
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug fortran/40737] Pointer references sometimes fail to define "span" symbols
2009-07-13 21:37 [Bug fortran/40737] New: Pointer references sometimes fail to define "span" symbols dh458 at oakapple dot net
2009-07-13 21:39 ` [Bug fortran/40737] " dh458 at oakapple dot net
@ 2009-07-13 21:40 ` dh458 at oakapple dot net
2009-07-14 7:50 ` burnus at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: dh458 at oakapple dot net @ 2009-07-13 21:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from dh458 at oakapple dot net 2009-07-13 21:40 -------
Created an attachment (id=18190)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18190&action=view)
module use file for bug report
Compile this module use with the other attachment module definition
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40737
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug fortran/40737] Pointer references sometimes fail to define "span" symbols
2009-07-13 21:37 [Bug fortran/40737] New: Pointer references sometimes fail to define "span" symbols dh458 at oakapple dot net
2009-07-13 21:39 ` [Bug fortran/40737] " dh458 at oakapple dot net
2009-07-13 21:40 ` dh458 at oakapple dot net
@ 2009-07-14 7:50 ` burnus at gcc dot gnu dot org
2009-07-21 15:19 ` dh458 at oakapple dot net
` (7 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-14 7:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from burnus at gcc dot gnu dot org 2009-07-14 07:50 -------
Confirm (kind of) with GCC 4.3.2 on i686-linux. With -DBIGMOD one gets:
/tmp/ccmoM1rS.o: In function `tf_ad_splitting_driver_plane_':
t.F90:(.text+0xad): undefined reference to `span.1'
t.F90:(.text+0x15c): undefined reference to `span.0'
t.F90:(.text+0x20b): undefined reference to `span.2'
t.F90:(.text+0x2ba): undefined reference to `span.3'
t.F90:(.text+0x369): undefined reference to `span.4'
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
GCC host triplet|sparc-sun-solaris2.10 |
Keywords| |wrong-code
Known to fail| |4.3.2 4.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40737
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug fortran/40737] Pointer references sometimes fail to define "span" symbols
2009-07-13 21:37 [Bug fortran/40737] New: Pointer references sometimes fail to define "span" symbols dh458 at oakapple dot net
` (2 preceding siblings ...)
2009-07-14 7:50 ` burnus at gcc dot gnu dot org
@ 2009-07-21 15:19 ` dh458 at oakapple dot net
2009-07-22 7:11 ` burnus at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: dh458 at oakapple dot net @ 2009-07-21 15:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from dh458 at oakapple dot net 2009-07-21 15:19 -------
(In reply to comment #0)
In the original SPECmpi source code,
I was able to make the compile-time bug go away with this source workaround:
change e.g.
Ro => Hydro_vars( first_cell:last_cell, j, k)%cell_var( ro_var)
to
tRo => Hydro_vars( first_cell:last_cell, j, k)%cell_var( ro_var)
call copy_pointer(Ro, tRo)
with earlier declarations for tRo and copy_pointer
< subroutine copy_pointer(p, q)
<
< use TF_NUMBER_KIND
<
< implicit none
< real(r8), pointer, dimension( :) :: p, q
<
< p => q
< return
<
< end subroutine
< use TF_NUMBER_KIND
<
< implicit none
<
< real(r8), pointer, dimension( :),save :: tRo
However execution was unsuccessful, though not necessarily due to a problem
in this part of the code. Compilation and execution of this modified
code were successful on
the same linux system using Sun Studio 12u1, but not using gfortran 4.4.0
on a sparc solaris system... so the root cause of failure is unknown.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40737
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug fortran/40737] Pointer references sometimes fail to define "span" symbols
2009-07-13 21:37 [Bug fortran/40737] New: Pointer references sometimes fail to define "span" symbols dh458 at oakapple dot net
` (3 preceding siblings ...)
2009-07-21 15:19 ` dh458 at oakapple dot net
@ 2009-07-22 7:11 ` burnus at gcc dot gnu dot org
2009-07-22 7:13 ` burnus at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-22 7:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from burnus at gcc dot gnu dot org 2009-07-22 07:10 -------
Reduced test case. The crucial part is the span ("1:2") in the assignment - and
that "Ro" is use-associated.
Dump:
tf_ad_splitting_driver_plane ()
{ [...]
extern integer(kind=8) span.0 = 0;
[...]
span.0 = 4;
module testmod
implicit none
type VARIABLES_MAILLE
real :: cell_var
end type VARIABLES_MAILLE
type (VARIABLES_MAILLE), pointer, dimension( :) :: Hydro_vars
real, pointer, dimension(:) :: Ro
end module testmod
program TF_AD_SPLITTING_DRIVER_PLANE
use testmod
implicit none
Ro => Hydro_vars(1:2)%cell_var
end program
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Known to fail|4.3.2 4.4.0 |4.3.2 4.4.0 4.5.0
Last reconfirmed|0000-00-00 00:00:00 |2009-07-22 07:10:56
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40737
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug fortran/40737] Pointer references sometimes fail to define "span" symbols
2009-07-13 21:37 [Bug fortran/40737] New: Pointer references sometimes fail to define "span" symbols dh458 at oakapple dot net
` (4 preceding siblings ...)
2009-07-22 7:11 ` burnus at gcc dot gnu dot org
@ 2009-07-22 7:13 ` burnus at gcc dot gnu dot org
2009-07-22 9:21 ` burnus at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-22 7:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from burnus at gcc dot gnu dot org 2009-07-22 07:12 -------
Paul, do you immediately see what goes wrong here? If not, I can also dig
myself.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pault at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40737
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug fortran/40737] Pointer references sometimes fail to define "span" symbols
2009-07-13 21:37 [Bug fortran/40737] New: Pointer references sometimes fail to define "span" symbols dh458 at oakapple dot net
` (5 preceding siblings ...)
2009-07-22 7:13 ` burnus at gcc dot gnu dot org
@ 2009-07-22 9:21 ` burnus at gcc dot gnu dot org
2009-10-06 22:04 ` bergner at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-22 9:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from burnus at gcc dot gnu dot org 2009-07-22 09:20 -------
My current understanding is that "span" is only created (in
gfc_get_symbol_decl)
if (sym->attr.subref_array_pointer)
is true - and is then assumed to live at the same place as the symbol (array
descriptor) itself. But this fails for use association (and maybe also for host
association).
Solution 1: Always create that variable if they symbols is a pointer to an
array.
Solution 2: Defer it until we have the proper array descriptor, which handles
this.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40737
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug fortran/40737] Pointer references sometimes fail to define "span" symbols
2009-07-13 21:37 [Bug fortran/40737] New: Pointer references sometimes fail to define "span" symbols dh458 at oakapple dot net
` (6 preceding siblings ...)
2009-07-22 9:21 ` burnus at gcc dot gnu dot org
@ 2009-10-06 22:04 ` bergner at gcc dot gnu dot org
2009-10-06 23:10 ` kargl at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: bergner at gcc dot gnu dot org @ 2009-10-06 22:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from bergner at gcc dot gnu dot org 2009-10-06 22:03 -------
Created an attachment (id=18732)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18732&action=view)
Potential patch to fix pr40737
Here is a patch from Adhemerval Zanella from our IBM LTC Performance team, that
"fixes" the problem for me and bootstraps (powerpc64-linux) and regtests with
no regressions. Can someone else give this a try on their system?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40737
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug fortran/40737] Pointer references sometimes fail to define "span" symbols
2009-07-13 21:37 [Bug fortran/40737] New: Pointer references sometimes fail to define "span" symbols dh458 at oakapple dot net
` (7 preceding siblings ...)
2009-10-06 22:04 ` bergner at gcc dot gnu dot org
@ 2009-10-06 23:10 ` kargl at gcc dot gnu dot org
2009-10-07 8:20 ` burnus at gcc dot gnu dot org
2009-10-07 22:42 ` dh458 at oakapple dot net
10 siblings, 0 replies; 17+ messages in thread
From: kargl at gcc dot gnu dot org @ 2009-10-06 23:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from kargl at gcc dot gnu dot org 2009-10-06 23:10 -------
(In reply to comment #8)
> Created an attachment (id=18732)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18732&action=view) [edit]
> Potential patch to fix pr40737
>
> Here is a patch from Adhemerval Zanella from our IBM LTC Performance team, that
> "fixes" the problem for me and bootstraps (powerpc64-linux) and regtests with
> no regressions. Can someone else give this a try on their system?
>
With the patch installed and running either of the following commands:
gfortran -S testmod.F90 testuse.F90 -UBIGMOD -m64
gfortran -S testmod.F90 testuse.F90 -DBIGMOD -m64
shows no instances of 'scan' in the resulting .s files of x86_64-*-freebsd.
Don't know if this is the result that you are looking for.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40737
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug fortran/40737] Pointer references sometimes fail to define "span" symbols
2009-07-13 21:37 [Bug fortran/40737] New: Pointer references sometimes fail to define "span" symbols dh458 at oakapple dot net
` (8 preceding siblings ...)
2009-10-06 23:10 ` kargl at gcc dot gnu dot org
@ 2009-10-07 8:20 ` burnus at gcc dot gnu dot org
2009-10-07 22:42 ` dh458 at oakapple dot net
10 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-10-07 8:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from burnus at gcc dot gnu dot org 2009-10-07 08:20 -------
(In reply to comment #8)
> Created an attachment (id=18732)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18732&action=view) [edit]
> Potential patch to fix pr40737
>
> Here is a patch from Adhemerval Zanella from our IBM LTC Performance team,
> that "fixes" the problem for me and bootstraps (powerpc64-linux) and
> regtests with no regressions. Can someone else give this a try on their
> system?
I think it only paper bags the problem. The problem is that the span
information needs to be available in all places where the pointer is available
- also if the module a separate file from the one where the assignment is done
which can be again separate from the place where the pointer is used.
Thus, as written, I only see two solutions:
Solution 1: Always create that variable if they symbols is a pointer to an
array.
Solution 2: Defer it until we have the proper array descriptor, which handles
this.
I think in 4.6 we will finally go for solution 2.
Nevertheless, one should check whether the patch improves the situation for 4.5
and should thus be applied as interim solution.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40737
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug fortran/40737] Pointer references sometimes fail to define "span" symbols
2009-07-13 21:37 [Bug fortran/40737] New: Pointer references sometimes fail to define "span" symbols dh458 at oakapple dot net
` (9 preceding siblings ...)
2009-10-07 8:20 ` burnus at gcc dot gnu dot org
@ 2009-10-07 22:42 ` dh458 at oakapple dot net
10 siblings, 0 replies; 17+ messages in thread
From: dh458 at oakapple dot net @ 2009-10-07 22:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from dh458 at oakapple dot net 2009-10-07 22:42 -------
(In reply to comment #10)
> > Here is a patch from Adhemerval Zanella from our IBM LTC Performance team,
> > that "fixes" the problem for me and bootstraps (powerpc64-linux) and
> > regtests with no regressions. Can someone else give this a try on their
> > system?
I can compile now the original source SPECmpi 129.tera_tf
but I still don't execute correctly. The variables Ro and Ets get undefined
somehow. Has anybody used any version of gfortran successfully to compile
and correctly execute all of SPECmpi ?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40737
^ permalink raw reply [flat|nested] 17+ messages in thread