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: Fix cprop_hardregs handling of SSE logical on fp patterns


On Tue, Feb 12, 2002 at 05:24:59PM +0100, Jan Hubicka wrote:
> +   if (GET_CODE (x) == SUBREG)
> +     x = simplify_subreg (GET_MODE (x), SUBREG_REG (x),
> + 			 GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));

I wonder if it would be better to just do

  if (GET_CODE (x) == SUBREG)
    {
      /* SUBREGS are supposed to have been eliminated by now.  But some
	 ports, e.g. i386 sse, use them to smuggle vector type information
	 through to instruction selection.  So allow mode frobbing that
	 changes type, but doesn't change size.  */
      if (!subreg_lowpart_p (x)
	  || (GET_MODE_SIZE (GET_MODE (x))
	      != GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))))
	abort ();
      x = SUBREG_REG (x);
    }

Eh.  I guess either works.  If it's now a very simple subreg
we'll get NULL back, which will promptly crash.  I suppose you
could add some commentary saying what sorts of things we 
expect here, and if it doesn't simplify you've done something
wrong.


r~


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