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: Unrevied patches^3


> From: Richard Sandiford <rsandifo@redhat.com>
> Date: 20 Oct 2003 18:28:29 +0100

> Geoff Keating <geoffk@geoffk.org> writes:
> > (set (reg r2) (mem ...)) (REG_EQUIV (high (symbol_ref "x")))
> 
> Right.  That's exactly what MIPS port does.  And from a correctness
> POV, it seems to work.
> 
> The problem is that combine can optimise something like:
> 
>     (set (reg x) (high (symbol_ref "foo")))
>     (set (reg y) (lo_sum (reg x) (symbol_ref "foo")))
>     (set (reg z) (plus (reg y) (const_int 4)))
> 
> into:
> 
>     (set (reg x) (high (const (plus (symbol_ref "foo") (const_int 4)))))
>     (set (reg y)
> 	 (lo_sum (reg x) (const (plus (symbol_ref "foo") (const_int 4)))))
> 
> But it doesn't know how to do that when you use a mem for
> the high part.  The point of this patch is to tell it.

Why not just do the obvious thing, and write a
define_insn/define_split pair?

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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