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]

[patch] tree-ssa-ccp.c: PR tree-optimization/20936.


Hi,

Attached is a patch to fix PR tree-optimization/20936.

orig_lhs is known to be a VIEW_CONVERT_EXPR, which takes only one
operand, so accessing TREE_OPERAND (orig_lhs, 1) leads to crash.

Tested on i686-pc-linux-gnu.  Committed as obvious.

Kazu Hirata

2005-04-15  Kazu Hirata  <kazu@cs.umass.edu>

	PR tree-optimization/20936.
	* tree-ssa-ccp.c (visit_assignment): Fix a typo.

Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-ccp.c,v
retrieving revision 2.64
diff -u -d -p -r2.64 tree-ssa-ccp.c
--- tree-ssa-ccp.c	9 Apr 2005 01:37:23 -0000	2.64
+++ tree-ssa-ccp.c	14 Apr 2005 21:20:33 -0000
@@ -1071,7 +1071,7 @@ visit_assignment (tree stmt, tree *outpu
 			       TREE_TYPE (TREE_OPERAND (orig_lhs, 0)),
 			       val.value));
 
-	orig_lhs = TREE_OPERAND (orig_lhs, 1);
+	orig_lhs = TREE_OPERAND (orig_lhs, 0);
 	if (w && is_gimple_min_invariant (w))
 	  val.value = w;
 	else


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