This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: paradoxical subreg problem
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: law at redhat dot com
- Cc: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner), gcc at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Tue, 29 Jan 2002 13:06:10 +0000
- Subject: Re: paradoxical subreg problem
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> In message <10201281935.AA25716@vlsi1.ultra.nyu.edu>, Richard Kenner writes:
> > Don't assume you can break it into two expressions. Consider the
> > expression as it stands (and as combine creates it).
> >
> > Sure, but I'm trying to define what it means by comparison with
> > two expressions.
> >
> > So with your assertions in mind are these two expresions equivalent?
> >
> > (and:SI (subreg:SI (mem:QI) 0) (const_int 255))
> >
> > (subreg:SI (mem:QI X) 0)
>
> Are you sure?
>
> Are the bits outside the mode of SUBREG_REG undefined or "don't care"? That
> is the crux of the issue.
>
> If those bits are undefined, then those expressions are not equivalent as
> the result of the first expression has 24 zeros in its high bits whereas
> the second expression has 24 undefined bits. If those bits are "don't care"
> then the compiler can treat those expressions as equivalent.
>
I was under the impression that we would only create paradoxical subregs
of a mem if LOAD_EXTEND_OP returns either ZERO_EXTEND or SIGN_EXTEND for
the mode of the mem (ie, we won't create such paradoxical subregs if
LOAD_EXTEND_OP returns NIL). That is, the operation is an alternate way
of expressing the extend operation, because that is what will happen in
practice.
Given the above, then on such machines
(subreg:SI (mem:QI X) 0)
is defined for all 32 bits.
R.