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]

[tree-ssa] Problem in right-assocify


Looking at this warning:
/cvs/gcc-tree-ssa-20020619-branch/gcc/tree-simple.c:880: warning: unused variable `rhs'

I noticed that either the comment is wrong and this variable is really
unused - or there's a typo.  Could somebody please check whether the
patch below is the right think to do - and then approve it or tell me
what to do?

The problem that caught me is that the comment speaks about rhs chain
but we go through the lhs:
 	  /* Walk through the rhs chain from there until we find something
 	     with a different code.  In this case, c.  */
	  for (q = &TREE_OPERAND (lhs, 1); TREE_CODE (*q) == code;

Andreas

2002-11-29  Andreas Jaeger  <aj@suse.de>

	* tree-simple.c (right_assocify_expr): Really walk rhs chain.

============================================================
Index: gcc/tree-simple.c
--- gcc/tree-simple.c	27 Nov 2002 00:43:33 -0000	1.1.4.19
+++ gcc/tree-simple.c	29 Nov 2002 08:53:51 -0000
@@ -898,7 +898,7 @@ right_assocify_expr (top)
 
 	  /* Walk through the rhs chain from there until we find something
 	     with a different code.  In this case, c.  */
-	  for (q = &TREE_OPERAND (lhs, 1); TREE_CODE (*q) == code;
+	  for (q = &TREE_OPERAND (rhs, 1); TREE_CODE (*q) == code;
 	       q = &TREE_OPERAND (*q, 1))
 	    TREE_TYPE (*q) = TREE_TYPE (cur);
 

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


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