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]

Re: A loop.c patch


On Tue, Jun 30, 1998 at 11:08:52PM -3100, H.J. Lu wrote:
> Here is a loop patch and a testcase. I have reported it earlier with
> my analysis.

You gave to test case, and I could not find the post in which
you reported it earlier -- a reference would have been nice.

The patch is certainly not correct.

> +      /* We need to check if the memory referenced by SET_SRC (pat) is
> +	 set or not before since SET_SRC (pat) may be used to reference
> +	 that memory later. */
> +      if (GET_CODE (pat) != SET)
> +	pat = single_set (pat);
> +
> +      if (!pat || !rtx_equal_p (SET_DEST (pat), x)
> +	  || rtx_equal_p (SET_SRC (pat), x)
> +	  || GET_CODE (x) != REG)
> +	return;
> +
> +      for (i = 0; i < loop_store_mems_idx; i++)
> +  	if (rtx_equal_p (XEXP (loop_store_mems[i], 0), SET_SRC (pat)))
> +	  {
> +	    loop_store_mems[loop_store_mems_idx++]
> +	      = gen_rtx_MEM (GET_MODE (loop_store_mems[i]), x);

Meaning that if I have

	(set (mem:SI (reg:DI 1)) (something))
	(set (reg:SI 2) (mem:SI (reg:DI 1)))

that (mem:SI (reg:SI 2)) will be recorded in loop_store_mems?!?

You've just completely bollixed invariant_p, as far as I can tell,
which may well have hidden the actual problem.


r~


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