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]

[lno] Fix galgel build failure


Hello,

this patch fixes a problem caused by the fact that

mem_ref = call_expr (mem_ref)

is a valid gimple, which ivopts did not expect.

Zdenek

Index: ChangeLog.lno
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/ChangeLog.lno,v
retrieving revision 1.1.2.247
diff -c -3 -p -r1.1.2.247 ChangeLog.lno
*** ChangeLog.lno	4 Aug 2004 19:13:49 -0000	1.1.2.247
--- ChangeLog.lno	5 Aug 2004 08:45:06 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2004-08-05  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+ 
+ 	* tree-ssa-loop-ivopts.c (find_interesting_uses_stmt): Handle
+ 	arguments of CALL_EXPRs correctly.
+ 
  2004-08-04  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
  
  	* basic-block.h (get_dominated_by_region): Declare.
Index: tree-ssa-loop-ivopts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-loop-ivopts.c,v
retrieving revision 1.1.2.49
diff -c -3 -p -r1.1.2.49 tree-ssa-loop-ivopts.c
*** tree-ssa-loop-ivopts.c	4 Aug 2004 19:13:50 -0000	1.1.2.49
--- tree-ssa-loop-ivopts.c	5 Aug 2004 08:45:06 -0000
*************** find_interesting_uses_stmt (struct ivopt
*** 1602,1607 ****
--- 1602,1608 ----
    tree op, lhs, rhs;
    use_optype uses = NULL;
    unsigned i, n;
+   enum tree_code lhs_code, rhs_code;
  
    find_invariants_stmt (data, stmt);
  
*************** find_interesting_uses_stmt (struct ivopt
*** 1615,1622 ****
      {
        lhs = TREE_OPERAND (stmt, 0);
        rhs = TREE_OPERAND (stmt, 1);
  
!       if (TREE_CODE (lhs) == SSA_NAME)
  	{
  	  /* If the statement defines an induction variable, the uses are not
  	     interesting by themselves.  */
--- 1616,1625 ----
      {
        lhs = TREE_OPERAND (stmt, 0);
        rhs = TREE_OPERAND (stmt, 1);
+       lhs_code = TREE_CODE (lhs);
+       rhs_code = TREE_CODE (rhs);
  
!       if (lhs_code == SSA_NAME)
  	{
  	  /* If the statement defines an induction variable, the uses are not
  	     interesting by themselves.  */
*************** find_interesting_uses_stmt (struct ivopt
*** 1627,1651 ****
  	    return;
  	}
  
!       switch (TREE_CODE_CLASS (TREE_CODE (rhs)))
! 	{
! 	case '<':
! 	  find_interesting_uses_cond (data, stmt, &TREE_OPERAND (stmt, 1));
! 	  return;
  
! 	case 'r':
! 	  find_interesting_uses_address (data, stmt, &TREE_OPERAND (stmt, 1));
! 	  if (TREE_CODE_CLASS (TREE_CODE (lhs)) == 'r')
  	    find_interesting_uses_address (data, stmt, &TREE_OPERAND (stmt, 0));
- 	  return;
  
! 	default: ;
! 	}
  
-       if (TREE_CODE_CLASS (TREE_CODE (lhs)) == 'r')
- 	{
- 	  find_interesting_uses_address (data, stmt, &TREE_OPERAND (stmt, 0));
- 	  find_interesting_uses_op (data, rhs);
  	  return;
  	}
      }
--- 1630,1676 ----
  	    return;
  	}
  
!       /* We handle here only a few common forms of assignment statements.
! 	 The remaining cases are handled below as generic ones.  */
  
!       if (TREE_CODE_CLASS (rhs_code) == '<'
! 	  || TREE_CODE_CLASS (rhs_code) == 'r'
! 	  || TREE_CODE (rhs) == SSA_NAME
! 	  || TREE_CODE (rhs) == CALL_EXPR
! 	  || is_gimple_min_invariant (rhs))
! 	{
! 	  /* Process the lhs.  It is only interesting if it is an address.  */
! 	  if (TREE_CODE_CLASS (lhs_code) == 'r')
  	    find_interesting_uses_address (data, stmt, &TREE_OPERAND (stmt, 0));
  
! 	  /* Now handle each of the rhs possibilities.  */
! 	  if (TREE_CODE_CLASS (rhs_code) == '<')
! 	    find_interesting_uses_cond (data, stmt, &TREE_OPERAND (stmt, 1));
! 
! 	  else if (TREE_CODE_CLASS (rhs_code) == 'r')
! 	    find_interesting_uses_address (data, stmt, &TREE_OPERAND (stmt, 1));
! 
! 	  else if (TREE_CODE (rhs) == SSA_NAME)
! 	    find_interesting_uses_op (data, rhs);
! 
! 	  else if (TREE_CODE (rhs) == CALL_EXPR)
! 	    {
! 	      /* Process the call arguments.  */
! 	      tree args, arg;
! 
! 	      for (args = TREE_OPERAND (rhs, 1); args; args = TREE_CHAIN (args))
! 		{
! 		  arg = TREE_VALUE (args);
! 
! 		  if (TREE_CODE (arg) == SSA_NAME)
! 		    find_interesting_uses_op (data, arg);
! 
! 		  else if (TREE_CODE_CLASS (TREE_CODE (arg)) == 'r')
! 		    find_interesting_uses_address (data, stmt,
! 						   &TREE_VALUE (args));
! 		}
! 	    }
  
  	  return;
  	}
      }


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