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]

alias.c patch for loop/alias bugs


This fixes an alias problem that can show up when compiling nested
loops.  The loop.c function loop_regs_update passes alias info to
alias.c, and then alias can get confused because it handles these values
incorrectly.  The key problem here is that reg_base_value is only
supposed to hold one of the three values: SYMBOL_REF, LABEL_REF, or
ADDRESS.  However, find_base_value can return a REG in some cases.  This
breaks base_alias_check.

This patch has been discussed in length on the gcc list, and in the PRs
9745, 10021, and 11319.  More info can be found there.

This patch is likely to cause performance regressions for some
applications.  I will be looking into this.  Good examples showing this
problem would be useful.

This patch has been added to the trunk, and to the 3.3 branch for the
3.3.2 release with Mark Mitchell's blessing.

This was tested with an x86-linux bootstrap and make check.

2003-08-11  James E Wilson  <wilson@tuliptree.org>

	PR optimization/11319
	PR target/10021
	* alias.c (find_base_value, case REG): Return 0 not src if no base
	found.

Index: alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/alias.c,v
retrieving revision 1.198
retrieving revision 1.199
diff -p -r1.198 -r1.199
*** alias.c	22 Jul 2003 23:15:23 -0000	1.198
--- alias.c	12 Aug 2003 05:28:45 -0000	1.199
*************** find_base_value (rtx src)
*** 782,788 ****
  	    return reg_base_value[regno];
  	}
  
!       return src;
  
      case MEM:
        /* Check for an argument passed in memory.  Only record in the
--- 782,788 ----
  	    return reg_base_value[regno];
  	}
  
!       return 0;
  
      case MEM:
        /* Check for an argument passed in memory.  Only record in the
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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