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] Fix copy_reference_ops_from_ref


We should use DECL_SIZE.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2009-06-02  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Use DECL_SIZE
	for field decls.

Index: gcc/tree-ssa-sccvn.c
===================================================================
*** gcc/tree-ssa-sccvn.c	(revision 148082)
--- gcc/tree-ssa-sccvn.c	(working copy)
*************** copy_reference_ops_from_ref (tree ref, V
*** 555,561 ****
  	      && integer_zerop (DECL_FIELD_OFFSET (temp.op0))
  	      && integer_zerop (DECL_FIELD_BIT_OFFSET (temp.op0))
  	      && host_integerp (TYPE_SIZE (TREE_TYPE (temp.op0)), 0))
! 	    temp.op0 = TYPE_SIZE (TREE_TYPE (temp.op0));
  	  break;
  	case ARRAY_RANGE_REF:
  	case ARRAY_REF:
--- 555,561 ----
  	      && integer_zerop (DECL_FIELD_OFFSET (temp.op0))
  	      && integer_zerop (DECL_FIELD_BIT_OFFSET (temp.op0))
  	      && host_integerp (TYPE_SIZE (TREE_TYPE (temp.op0)), 0))
! 	    temp.op0 = DECL_SIZE (temp.op0);
  	  break;
  	case ARRAY_RANGE_REF:
  	case ARRAY_REF:


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