public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/27662]  New: Transpose doesn't work on function return
@ 2006-05-18 17:50 hjl at lucon dot org
  2006-05-18 18:24 ` [Bug fortran/27662] " hjl at lucon dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: hjl at lucon dot org @ 2006-05-18 17:50 UTC (permalink / raw)
  To: gcc-bugs

[hjl@gnu-19 tmp]$ cat x.f90
program foo
 implicit none
 real(kind=kind(1.0d0)), dimension (2, 2):: x, y, z;
 integer i, j
 open (10, status="scratch")
 write (10, *) "0.1000000000E+01    0.0000000000E+00"
 write (10, *) "0.0000000000E+00    0.1000000000E+01"
 rewind (10)
 read (10,*) x
 print "(2(e20.10))", x
 print *
 z = matmul (x, transpose (test ()))
 print "(2(e20.10))", z
 do i = 1, size (x, 1)
   do j = 1, size (x, 2)
     if (x (i, j) .ne. z (i, j)) call abort ()
   end do
 end do
 close (10)

contains
 function test () result (res)
   real(kind=kind(1.0d0)), dimension(2,2) :: res
   rewind (10)
   read (10,*) res
   print "(2(e20.10))", res
   print *
 end function
end
[hjl@gnu-19 tmp]$ /usr/gcc-4.2/bin/gfortran -static x.f90
[hjl@gnu-19 tmp]$ ./a.out
    0.1000000000E+01    0.0000000000E+00
    0.0000000000E+00    0.1000000000E+01

    0.1000000000E+01    0.0000000000E+00
    0.0000000000E+00    0.1000000000E+01

    0.1000000000E+01    0.0000000000E+00
    0.1000000000E+01    0.0000000000E+00
Aborted
[hjl@gnu-19 tmp]$


-- 
           Summary: Transpose doesn't work on function return
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl at lucon dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
@ 2006-05-18 18:24 ` hjl at lucon dot org
  2006-05-18 20:42 ` kargl at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: hjl at lucon dot org @ 2006-05-18 18:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from hjl at lucon dot org  2006-05-18 18:24 -------
This testcase is derived from Tonto in SPEC CPU 2006.


-- 

hjl at lucon dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |15502
              nThis|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
  2006-05-18 18:24 ` [Bug fortran/27662] " hjl at lucon dot org
@ 2006-05-18 20:42 ` kargl at gcc dot gnu dot org
  2006-05-18 21:22 ` hjl at lucon dot org
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: kargl at gcc dot gnu dot org @ 2006-05-18 20:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from kargl at gcc dot gnu dot org  2006-05-18 20:41 -------
Actually, transpose by itself does the right thing.  It is the
combination of matmul and transpose that is screwing up indexing.
A slightly modified version of your program gives

troutmask:kargl[290] ./z
 1.0 0.0 0.0 1.0 <-- x
 1.0 0.0 0.0 1.0 <-- a = test()
 1.0 0.0 0.0 1.0 <-- a = transpose(test())
 1.0 0.0 0.0 1.0 <-- z = matmul(x,a)
 1.0 0.0 1.0 0.0 <-- z = matmul(x,transpose(test()))
Abort (core dumped)

Here the program.

program foo

 implicit none

 real(kind=kind(1.0d0)), dimension(2, 2):: x, z, a
 integer i, j

 x(1,1) = 1.d0 
 x(2,1) = 0.d0
 x(1,2) = 0.d0
 x(2,2) = 1.d0 
!
! Uncomment to see the output.
!
  print '(4F4.1,1X,A)', x(1,1), x(2,1), x(1,2), x(2,2), '<-- x'
  a = test()
  print '(4F4.1,1X,A)', a(1,1), a(2,1), a(1,2), a(2,2), '<-- a = test()'
  a = transpose(test())
  print '(4F4.1,1X,A)', a(1,1), a(2,1), a(1,2), a(2,2), &
  & '<-- a = transpose(test())'
  z = matmul(x, a)
  print '(4F4.1,1X,A)', z(1,1), z(2,1), z(1,2), z(2,2), '<-- z = matmul(x,a)'
  z = matmul(x, transpose(test()))
  print '(4F4.1,1X,A)', z(1,1), z(2,1), z(1,2), z(2,2), &
  & '<-- z = matmul(x,transpose(test()))'

 z = matmul(x, transpose(test()))
 do i = 1, 2
   do j = 1, 2
     if (x(i,j) .ne. z(i,j)) call abort()
   end do
 end do
 close (10)

contains
 function test() result (res)
   real(kind=kind(1.0d0)), dimension(2,2) :: res
   res(1,1) = 1.d0 
   res(2,1) = 0.d0
   res(1,2) = 0.d0
   res(2,2) = 1.d0 
 end function
end


-- 

kargl at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-05-18 20:41:45
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
  2006-05-18 18:24 ` [Bug fortran/27662] " hjl at lucon dot org
  2006-05-18 20:42 ` kargl at gcc dot gnu dot org
@ 2006-05-18 21:22 ` hjl at lucon dot org
  2006-05-18 21:55 ` hjl at lucon dot org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: hjl at lucon dot org @ 2006-05-18 21:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl at lucon dot org  2006-05-18 21:22 -------
I got

  atmp.17.dtype = 538;
  atmp.17.dim[0].stride = 2;
  atmp.17.dim[0].lbound = 0;
  atmp.17.dim[0].ubound = 1;
  atmp.17.dim[1].stride = 0; <----- Shouldn't it be 1?
  atmp.17.dim[1].lbound = 0;
  atmp.17.dim[1].ubound = 1;
  atmp.17.data = &A.16;
  atmp.17.offset = 0;
  _gfortran_matmul_r8 (&parm.13, &parm.14, &atmp.17);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (2 preceding siblings ...)
  2006-05-18 21:22 ` hjl at lucon dot org
@ 2006-05-18 21:55 ` hjl at lucon dot org
  2006-05-18 22:22 ` hjl at lucon dot org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: hjl at lucon dot org @ 2006-05-18 21:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl at lucon dot org  2006-05-18 21:54 -------
Also

    atmp.6.dtype = 538;
    atmp.6.dim[0].stride = 1;
    atmp.6.dim[0].lbound = 0;
    atmp.6.dim[0].ubound = 1;
    atmp.6.dim[1].stride = 2;
    atmp.6.dim[1].lbound = 0;
    atmp.6.dim[1].ubound = 1;
    atmp.6.data = (void *) &A.7;
    atmp.6.offset = 0;
    atmp.6.dim[0].stride = 0;  <------ That causes the problem.
    test (&atmp.6);
    atmp.8.dtype = atmp.6.dtype;
    atmp.8.dim[0].stride = atmp.6.dim[1].stride;
    atmp.8.dim[0].lbound = atmp.6.dim[1].lbound;
    atmp.8.dim[0].ubound = atmp.6.dim[1].ubound;
    atmp.8.dim[1].stride = atmp.6.dim[0].stride;
    atmp.8.dim[1].lbound = atmp.6.dim[0].lbound;
    atmp.8.dim[1].ubound = atmp.6.dim[0].ubound;
    atmp.8.data = atmp.6.data;
    atmp.8.offset = atmp.6.offset;
    _gfortran_matmul_r8 (&parm.4, &parm.5, &atmp.8);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (3 preceding siblings ...)
  2006-05-18 21:55 ` hjl at lucon dot org
@ 2006-05-18 22:22 ` hjl at lucon dot org
  2006-05-18 23:02 ` hjl at lucon dot org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: hjl at lucon dot org @ 2006-05-18 22:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hjl at lucon dot org  2006-05-18 22:21 -------
There are

   2042           /* Zero the first stride to indicate a temporary.  */
   2043           tmp = gfc_conv_descriptor_stride (info->descriptor,
gfc_rank_cst[0]);
   2044           gfc_add_modify_expr (&se->pre, tmp,
   2045                                convert (TREE_TYPE (tmp),
integer_zero_node));

in gfc_conv_function_call. Later transpose is called on it. But we never
restore the first stride.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (4 preceding siblings ...)
  2006-05-18 22:22 ` hjl at lucon dot org
@ 2006-05-18 23:02 ` hjl at lucon dot org
  2006-05-20  0:28 ` hjl at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: hjl at lucon dot org @ 2006-05-18 23:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hjl at lucon dot org  2006-05-18 23:02 -------
This hack works for the testcase. But I don't know if it is the correct fix
or not.

2006-05-17  H.J. Lu  <hongjiu.lu@intel.com>

        PR fortran/27662
        * trans-expr.c (gfc_conv_function_call) Restore the first
        stride after the function call.

--- gcc/fortran/trans-expr.c.transpose  2006-04-16 11:18:33.000000000 -0700
+++ gcc/fortran/trans-expr.c    2006-05-18 15:55:30.000000000 -0700
@@ -2022,6 +2022,8 @@ gfc_conv_function_call (gfc_se * se, gfc
        retargs = gfc_chainon_list (retargs, se->expr);
       else if (sym->result->attr.dimension)
        {
+         tree stride;
+
          gcc_assert (se->loop && info);

          /* Set the type of the array.  */
@@ -2039,14 +2041,17 @@ gfc_conv_function_call (gfc_se * se, gfc
                                       false, !sym->attr.pointer,
callee_alloc);
          /* Zero the first stride to indicate a temporary.  */
-         tmp = gfc_conv_descriptor_stride (info->descriptor, gfc_rank_cst[0]);
-         gfc_add_modify_expr (&se->pre, tmp,
-                              convert (TREE_TYPE (tmp), integer_zero_node));
+         stride = gfc_conv_descriptor_stride (info->descriptor,
gfc_rank_cst[0]);
+         gfc_add_modify_expr (&se->pre, stride,
+                              convert (TREE_TYPE (stride),
integer_zero_node));
          /* Pass the temporary as the first argument.  */
          tmp = info->descriptor;
          tmp = build_fold_addr_expr (tmp);
          retargs = gfc_chainon_list (retargs, tmp);
+
+         /* Restore the first stride after the function call.  */
+         gfc_add_modify_expr (&post, stride, info->stride [0]);
        }
       else if (ts.type == BT_CHARACTER)
        {


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (5 preceding siblings ...)
  2006-05-18 23:02 ` hjl at lucon dot org
@ 2006-05-20  0:28 ` hjl at gcc dot gnu dot org
  2006-05-20  6:23 ` pault at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: hjl at gcc dot gnu dot org @ 2006-05-20  0:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from hjl at gcc dot gnu dot org  2006-05-20 00:28 -------
Subject: Bug 27662

Author: hjl
Date: Sat May 20 00:28:14 2006
New Revision: 113922

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113922
Log:
gcc/fortran/

2006-05-19  H.J. Lu  <hongjiu.lu@intel.com>

        PR fortran/27662
        * trans-array.c (gfc_conv_expr_descriptor): Don't zere the
        first stride to indicate a temporary.
        * trans-expr.c (gfc_conv_function_call): Likewise.

gcc/testsuite/

2006-05-19  H.J. Lu  <hongjiu.lu@intel.com>

        PR fortran/27662
        * gfortran.dg/temporary_1.f90: New file.

Added:
    trunk/gcc/testsuite/gfortran.dg/temporary_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (6 preceding siblings ...)
  2006-05-20  0:28 ` hjl at gcc dot gnu dot org
@ 2006-05-20  6:23 ` pault at gcc dot gnu dot org
  2006-05-20 20:10 ` pault at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-20  6:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pault at gcc dot gnu dot org  2006-05-20 06:23 -------
HJ

Your ISP does not like my address for some reason - it keeps bouncing my mail
to you.

Well done!  tonto-1.0/SPEC2006 now runs correctly.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (7 preceding siblings ...)
  2006-05-20  6:23 ` pault at gcc dot gnu dot org
@ 2006-05-20 20:10 ` pault at gcc dot gnu dot org
  2006-05-20 22:22 ` [Bug fortran/27662] [gcc 4.1]: " hjl at lucon dot org
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-20 20:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pault at gcc dot gnu dot org  2006-05-20 20:10 -------
I have been writing to Dylan and Daniel, cc'd to you but your copies bounce. 
The upshot of the exchange is that on an Athlon1700, the spec2006 testcase runs
on tonto-1.0 in 1hour 5minutes with gfortran -O3 -ffast-math and 1hour
19minutes with ifort-9.0 -O3 (fast math built is default)...

This is very pleasing indeed; it's a tribute to your efforts and those of
various of the gang, who have worked like stink on the dependency analysis, the
integration with the backend and inlining of intrinsics.  gfortran is a bit
like a Ferarri - bad news on a cold morning but it chews up tarmac when it's
running!

My intention is to get tonto-2.1 running with gfortran.  If you have time, I'd
love you to do likewise.

Paul


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] [gcc 4.1]: Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (8 preceding siblings ...)
  2006-05-20 20:10 ` pault at gcc dot gnu dot org
@ 2006-05-20 22:22 ` hjl at lucon dot org
  2006-05-21 20:08 ` [Bug fortran/27662] [4.1 only]: " pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: hjl at lucon dot org @ 2006-05-20 22:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from hjl at lucon dot org  2006-05-20 22:21 -------
I applied the same patch to gcc 4.1 redhat. Now I can build and run SPEC CPU
2006 successfully with gcc for the first time. The only issue is I have to
apply 2 patches to tonto in SPEC CPU 2006. I am not 100% sure that if tonto
in SPEC CPU 2006 conforms to Fortan standard.


-- 

hjl at lucon dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |
            Summary|Transpose doesn't work on   |[gcc 4.1]: Transpose doesn't
                   |function return             |work on function return
            Version|4.2.0                       |4.1.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] [4.1 only]: Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (9 preceding siblings ...)
  2006-05-20 22:22 ` [Bug fortran/27662] [gcc 4.1]: " hjl at lucon dot org
@ 2006-05-21 20:08 ` pinskia at gcc dot gnu dot org
  2006-05-23 16:29 ` pault at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-21 20:08 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |hjl at gcc dot gnu dot org
                   |dot org                     |
             Status|REOPENED                    |ASSIGNED
            Summary|[gcc 4.1]: Transpose doesn't|[4.1 only]: Transpose
                   |work on function return     |doesn't work on function
                   |                            |return
   Target Milestone|---                         |4.1.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] [4.1 only]: Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (10 preceding siblings ...)
  2006-05-21 20:08 ` [Bug fortran/27662] [4.1 only]: " pinskia at gcc dot gnu dot org
@ 2006-05-23 16:29 ` pault at gcc dot gnu dot org
  2006-05-23 17:15 ` hjl at lucon dot org
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-23 16:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pault at gcc dot gnu dot org  2006-05-23 16:28 -------
(In reply to comment #10)
> I applied the same patch to gcc 4.1 redhat. Now I can build and run SPEC CPU
> 2006 successfully with gcc for the first time. The only issue is I have to
> apply 2 patches to tonto in SPEC CPU 2006. I am not 100% sure that if tonto
> in SPEC CPU 2006 conforms to Fortan standard.
> 
HJ, I am puzzled - what do you have to do?  Both Daniel and I find that it
compiles as is.

Paul


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] [4.1 only]: Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (11 preceding siblings ...)
  2006-05-23 16:29 ` pault at gcc dot gnu dot org
@ 2006-05-23 17:15 ` hjl at lucon dot org
  2006-05-24  6:08 ` steven at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: hjl at lucon dot org @ 2006-05-23 17:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from hjl at lucon dot org  2006-05-23 17:15 -------
Are you using Tonto in SPEC CPU 2006? It is slightly different from Tonto 1.0
on SF. The problem in Tonto in SPEC CPU 2006 is it uses something like

integer,  pointer :: d
...
if (associated(d)) call abort()

But nullify is never called on d before. Tonto compiled by gfortran may return
TRUE and abort. I checked Fortran standard. It isn't very clear if it is valid
Fortran code.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] [4.1 only]: Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (12 preceding siblings ...)
  2006-05-23 17:15 ` hjl at lucon dot org
@ 2006-05-24  6:08 ` steven at gcc dot gnu dot org
  2006-05-27  5:03 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-05-24  6:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from steven at gcc dot gnu dot org  2006-05-24 06:08 -------
Re. comment #12, my copy of the June 1997 Fortran 95 draft is very clear
assuming we agree that there is no default initialization for this pointer.

14.6.2.1 Pointer association status
A pointer may have a pointer association status of associated, disassociated,
or undefined. Its association status may change during execution of a program.
Unless a pointer is initialized (explicitly or by default), it has an initial
association status of undefined. A pointer may be initialized to have an
association status of disassociated.

5.1.2.7 POINTER attribute
An object with the POINTER attribute shall neither be referenced nor defined
unless, as a result of executing a pointer assignment (7.5.2) or an ALLOCATE
statement (6.3.1), it becomes pointer associated with a target object that may
be referenced or defined.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] [4.1 only]: Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (13 preceding siblings ...)
  2006-05-24  6:08 ` steven at gcc dot gnu dot org
@ 2006-05-27  5:03 ` pault at gcc dot gnu dot org
  2006-05-30  4:45 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-27  5:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from pault at gcc dot gnu dot org  2006-05-27 05:03 -------
(In reply to comment #12)
> Are you using Tonto in SPEC CPU 2006? It is slightly different from Tonto 1.0
> on SF. The problem in Tonto in SPEC CPU 2006 is it uses something like

Ah, sorry HJ. You are right.

> But nullify is never called on d before. Tonto compiled by gfortran may return
> TRUE and abort. I checked Fortran standard. It isn't very clear if it is valid
> Fortran code.
> 

Stephen is correct on this.  The fortran code should take care of this. 
However, it might be very convenient to NULL all pointers by default.

Another issue, to which tonto is very sensitive, is that of chained component
references ending in a pointer.  Checking if the pointer is associated causes a
segfault if one of the intermediate references is an unallocated pointer.  I
believe that other compilers check for this.

Paul


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] [4.1 only]: Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (14 preceding siblings ...)
  2006-05-27  5:03 ` pault at gcc dot gnu dot org
@ 2006-05-30  4:45 ` pault at gcc dot gnu dot org
  2006-05-30 16:01 ` hjl at gcc dot gnu dot org
  2006-05-30 16:10 ` hjl at lucon dot org
  17 siblings, 0 replies; 19+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-30  4:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from pault at gcc dot gnu dot org  2006-05-30 04:45 -------
HJ,

It seems to me that you can clear this one on 4.1 now and get rid of the PR.

I am working on tonto-2.2, when I have the odd moment.  Did you post the
patches that you need to make the spec test work; ie. are they the ones you
posted earlier?

All the best 

Paul


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] [4.1 only]: Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (15 preceding siblings ...)
  2006-05-30  4:45 ` pault at gcc dot gnu dot org
@ 2006-05-30 16:01 ` hjl at gcc dot gnu dot org
  2006-05-30 16:10 ` hjl at lucon dot org
  17 siblings, 0 replies; 19+ messages in thread
From: hjl at gcc dot gnu dot org @ 2006-05-30 16:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from hjl at gcc dot gnu dot org  2006-05-30 16:00 -------
Subject: Bug 27662

Author: hjl
Date: Tue May 30 16:00:42 2006
New Revision: 114240

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114240
Log:
gcc/fortran/

2006-05-30  H.J. Lu  <hongjiu.lu@intel.com>

        PR fortran/27662
        Backport from mainline
        2006-05-18  H.J. Lu  <hongjiu.lu@intel.com>
        * trans-array.c (gfc_conv_expr_descriptor): Don't zero the
        first stride to indicate a temporary.
        * trans-expr.c (gfc_conv_function_call): Likewise.

gcc/testsuite/

2006-05-30  H.J. Lu  <hongjiu.lu@intel.com>

        PR fortran/27662
        Backport from mainline
        2006-05-18  H.J. Lu  <hongjiu.lu@intel.com>
        * gfortran.dg/temporary_1.f90: New file.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/temporary_1.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/trans-array.c
    branches/gcc-4_1-branch/gcc/fortran/trans-expr.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

* [Bug fortran/27662] [4.1 only]: Transpose doesn't work on function return
  2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
                   ` (16 preceding siblings ...)
  2006-05-30 16:01 ` hjl at gcc dot gnu dot org
@ 2006-05-30 16:10 ` hjl at lucon dot org
  17 siblings, 0 replies; 19+ messages in thread
From: hjl at lucon dot org @ 2006-05-30 16:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from hjl at lucon dot org  2006-05-30 16:10 -------
Yes, tonto-1.0-nullify-1.patch in PR 26106 is the one.


-- 

hjl at lucon dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27662


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

end of thread, other threads:[~2006-05-30 16:10 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-18 17:50 [Bug fortran/27662] New: Transpose doesn't work on function return hjl at lucon dot org
2006-05-18 18:24 ` [Bug fortran/27662] " hjl at lucon dot org
2006-05-18 20:42 ` kargl at gcc dot gnu dot org
2006-05-18 21:22 ` hjl at lucon dot org
2006-05-18 21:55 ` hjl at lucon dot org
2006-05-18 22:22 ` hjl at lucon dot org
2006-05-18 23:02 ` hjl at lucon dot org
2006-05-20  0:28 ` hjl at gcc dot gnu dot org
2006-05-20  6:23 ` pault at gcc dot gnu dot org
2006-05-20 20:10 ` pault at gcc dot gnu dot org
2006-05-20 22:22 ` [Bug fortran/27662] [gcc 4.1]: " hjl at lucon dot org
2006-05-21 20:08 ` [Bug fortran/27662] [4.1 only]: " pinskia at gcc dot gnu dot org
2006-05-23 16:29 ` pault at gcc dot gnu dot org
2006-05-23 17:15 ` hjl at lucon dot org
2006-05-24  6:08 ` steven at gcc dot gnu dot org
2006-05-27  5:03 ` pault at gcc dot gnu dot org
2006-05-30  4:45 ` pault at gcc dot gnu dot org
2006-05-30 16:01 ` hjl at gcc dot gnu dot org
2006-05-30 16:10 ` hjl at lucon dot 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).