View | Details | Raw Unified | Return to bug 27363
Collapse All | Expand All

(-)gcc-4_1-branch/gcc/cse.c (-2 / +46 lines)
Lines 4697-4702 Link Here
4697
  unsigned src_const_hash;
4697
  unsigned src_const_hash;
4698
  /* Table entry for constant equivalent for SET_SRC, if any.  */
4698
  /* Table entry for constant equivalent for SET_SRC, if any.  */
4699
  struct table_elt *src_const_elt;
4699
  struct table_elt *src_const_elt;
4700
  /* Table entry for the destination address.  */
4701
  struct table_elt *dest_addr_elt;
4700
};
4702
};
4701
4703
4702
static void
4704
static void
Lines 5936-5941 Link Here
5936
	 so that the destination goes into that class.  */
5938
	 so that the destination goes into that class.  */
5937
      sets[i].src_elt = src_eqv_elt;
5939
      sets[i].src_elt = src_eqv_elt;
5938
5940
5941
  /* Record destination addresses in the hash table.  This allows us to
5942
     check if they are invalidated by other sets.  */
5943
  for (i = 0; i < n_sets; i++)
5944
    {
5945
      if (sets[i].rtl)
5946
	{
5947
	  rtx x = sets[i].inner_dest;
5948
	  struct table_elt *elt;
5949
	  enum machine_mode mode;
5950
	  unsigned hash;
5951
5952
	  if (MEM_P (x))
5953
	    {
5954
	      x = XEXP (x, 0);
5955
	      mode = GET_MODE (x);
5956
	      hash = HASH (x, mode);
5957
	      elt = lookup (x, hash, mode);
5958
	      if (!elt)
5959
		{
5960
		  if (insert_regs (x, NULL, 0))
5961
		    {
5962
		      rehash_using_reg (x);
5963
		      hash = HASH (x, mode);
5964
		    }
5965
		  elt = insert (x, NULL, hash, mode);
5966
		}
5967
5968
	      sets[i].dest_addr_elt = elt;
5969
	    }
5970
	  else
5971
	    sets[i].dest_addr_elt = NULL;
5972
	}
5973
    }
5974
5939
  invalidate_from_clobbers (x);
5975
  invalidate_from_clobbers (x);
5940
5976
5941
  /* Some registers are invalidated by subroutine calls.  Memory is
5977
  /* Some registers are invalidated by subroutine calls.  Memory is
Lines 6028-6039 Link Here
6028
    }
6064
    }
6029
6065
6030
  /* We may have just removed some of the src_elt's from the hash table.
6066
  /* We may have just removed some of the src_elt's from the hash table.
6031
     So replace each one with the current head of the same class.  */
6067
     So replace each one with the current head of the same class.
6068
     Also check if destination addresses have been removed.  */
6032
6069
6033
  for (i = 0; i < n_sets; i++)
6070
  for (i = 0; i < n_sets; i++)
6034
    if (sets[i].rtl)
6071
    if (sets[i].rtl)
6035
      {
6072
      {
6036
	if (sets[i].src_elt && sets[i].src_elt->first_same_value == 0)
6073
	if (sets[i].dest_addr_elt
6074
	    && sets[i].dest_addr_elt->first_same_value == 0)
6075
	  {
6076
	    /* The elt was removed, which means this destination s not
6077
	       valid after this instruction.  */
6078
	    sets[i].rtl = NULL_RTX;
6079
	  }
6080
	else if (sets[i].src_elt && sets[i].src_elt->first_same_value == 0)
6037
	  /* If elt was removed, find current head of same class,
6081
	  /* If elt was removed, find current head of same class,
6038
	     or 0 if nothing remains of that class.  */
6082
	     or 0 if nothing remains of that class.  */
6039
	  {
6083
	  {

Return to bug 27363