This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: forall_3.f90


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);

*** ChangeLog.save	Sat Feb  7 15:09:08 2004
--- ChangeLog	Sat Feb  7 15:08:46 2004
***************
*** 1,3 ****
--- 1,11 ----
+ 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.
+ 
  2004-01-17  Paul Brook  <paul@codesourcery.com>
  
  	* lang-specs.h: Remove %<fixed-form.

*** trans-stmt.c.save	Sat Feb  7 15:09:33 2004
--- trans-stmt.c	Sat Feb  7 15:01:20 2004
***************
*** 1639,1645 ****
    *lss = gfc_walk_expr (expr1);
    *rss = NULL;
  
!   size = integer_one_node;
    if (*lss != gfc_ss_terminator)
      {
        gfc_init_loopinfo (&loop);
--- 1639,1645 ----
    *lss = gfc_walk_expr (expr1);
    *rss = NULL;
  
!   size = size_one_node;
    if (*lss != gfc_ss_terminator)
      {
        gfc_init_loopinfo (&loop);
***************
*** 1678,1684 ****
            size = fold (build (MULT_EXPR, TREE_TYPE (size), size, tmp));
          }
        gfc_add_block_to_block (pblock, &loop.pre);
-       size = gfc_evaluate_now (size, pblock);
        gfc_add_block_to_block (pblock, &loop.post);
  
        /* TODO: write a function that cleans up a loopinfo without freeing
--- 1678,1683 ----
***************
*** 1881,1887 ****
    count = gfc_create_var (gfc_array_index_type, "count");
    gfc_add_modify_expr (block, count, integer_zero_node);
  
!   inner_size = integer_one_node;
    lss = gfc_walk_expr (expr1);
    rss = gfc_walk_expr (expr2);
    if (lss == gfc_ss_terminator)
--- 1880,1886 ----
    count = gfc_create_var (gfc_array_index_type, "count");
    gfc_add_modify_expr (block, count, integer_zero_node);
  
!   inner_size = size_one_node;
    lss = gfc_walk_expr (expr1);
    rss = gfc_walk_expr (expr2);
    if (lss == gfc_ss_terminator)
***************
*** 2219,2225 ****
    /* Work out the number of elements in the mask array.  */
    tmpvar = NULL_TREE;
    lenvar = NULL_TREE;
!   size = integer_one_node;
    sizevar = NULL_TREE;
  
    for (n = 0; n < nvar; n++)
--- 2218,2224 ----
    /* Work out the number of elements in the mask array.  */
    tmpvar = NULL_TREE;
    lenvar = NULL_TREE;
!   size = size_one_node;
    sizevar = NULL_TREE;
  
    for (n = 0; n < nvar; n++)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]