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]

Re: -mpower4 sched2 bug miscompiles linux kernel


On Tue, Sep 10, 2002 at 04:09:11PM -0400, David Edelsohn wrote:
> ! 	  src = adjust_address (orig_src, mode, offset);
> ! 	  dest = adjust_address (orig_dest, mode, offset);
> ! 
> ! 	  if (mode == BLKmode)
>   	    {
> ! 	      if (!REG_P (XEXP (src, 0)))
>   		{
> ! 		  src = gen_rtx_MEM (BLKmode,
> ! 				     copy_addr_to_reg (XEXP (src, 0)));
> ! 		  MEM_COPY_ATTRIBUTES (src, orig_src);

I don't think this is ideal.  You're effectively saying that "src"
occupies the whole address range of "orig_src" whereas in actual fact
it doesn't.  adjust_address will take into account the "offset",
reducing rtmem->size so that "src" is seen to occupy orig_src+offset
to end of orig_src.  We can actually do better and set rtmem->size to
move_bytes, but I didn't want to raise this issue with my original
patch.  Bug fix first, optimization later.  ;)  Besides, doing so may
uncover bugs in other areas.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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