Re: forall_3.f90

Canqun Yang canqun@nudt.edu.cn
Sat Feb 7 13:46:00 GMT 2004


I have tested the patch both on IA32 and IA64 Liunx. On 
IA32, all testcase passed, but on IA64, specifics.f90 
still can not be passed.

2004-02-07  Canqun Yang  <canqun@nudt.edu.cn>
 
 	* trans-stmt.c (compute_inner_temp_size): 
Build the expression for
 	calculating the size of the temporaries while 
not to evaluate it.
 	(compute_inner_temp_size): Use size_one_node 
to initialize the size.
 	(gfc_trans_pointer_assign_need_temp): Ditto.
 	(gfc_trans_forall_1): Ditto.

Below is the wrong code segment extracted from 
forall_3.f90.t03.orginal.
The while loop does not get the proper element number 
(num.63) for the
temporary due to the inner_size (T.62) evaluated too 
early.
    
    T.62 = (*(struct t[] *)&v[-1])[(int8)i.56].s;
    num.63 = 0;
    i.56 = 1;
    count.64 = 5;
    while (1)
      {
        if (count.64 <= 0)
          {
            goto L.8;
          }
        else
          {
            (void)0;
          }
        num.63 = num.63 + T.62;
        i.56 = i.56 + 1;
        count.64 = count.64 - 1;;
      }
    L.8:;
    temp.65 = (int4[] *)_gfortran_internal_malloc64 
(num.63 * 4);

Below is the correct code segment.
    num.62 = 0;
    i.56 = 1;
    count.63 = 5;
    while (1)
      {
        if (count.63 <= 0)
          {
            goto L.8;
          }
        else
          {
            (void)0;
          }
        num.62 = num.62 + (*(struct t[] *)&v[-1])[(int8)
i.56].s;
        i.56 = i.56 + 1;
        count.63 = count.63 - 1;;
      }
    L.8:;
    temp.64 = (int4[] *)_gfortran_internal_malloc64 
(num.62 * 4);

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: forall.patch
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20040207/06ebc9d5/attachment-0001.ksh>


More information about the Fortran mailing list