This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix cprop_hardregs handling of SSE logical on fp patterns
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, aj at suse dot de, patches at x86-64 dot org
- Date: 12 Feb 2002 14:43:34 -0800
- Subject: Re: Fix cprop_hardregs handling of SSE logical on fp patterns
- References: <20020212162459.GA14553@atrey.karlin.mff.cuni.cz><20020212142853.G23328@redhat.com>
Richard Henderson <rth@redhat.com> writes:
> 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.
Yes, please do add the commentary, otherwise the first thing anyone
will do when they hit the crash is to switch to simplify_gen_subreg.
--
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>