This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about SUBREG handling in get_last_value
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: rth at redhat dot com (Richard Henderson)
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 27 Nov 2001 19:10:35 -0500 (EST)
- Subject: Re: Question about SUBREG handling in get_last_value
> On Tue, Nov 27, 2001 at 01:32:37PM -0500, John David Anglin wrote:
> > Should get_last_value not call gen_lowpart_for_combine when the
> > last value is VOIDmode or does gen_lowpart_for_combine need fixing
> > so it doesn't call simplify_gen_subreg with innermode=VOIDmode?
>
> The only VOIDmode that gen_lowpart expects to handle is CONST_INT.
> We almost certainly shouldn't have recorded a get_last_value for
> a call insn; it's not useful.
This wss my initial attempt to fix the problem:
2001-11-27 John David Anglin <dave@hiauly1.hia.nrc.ca>
* combine.c (gen_lowpart_for_combine): Don't call simplify_gen_subreg
with a VOIDmode inner mode.
--- combine.c Mon Nov 26 17:34:26 2001
+++ combine.c.new Tue Nov 27 13:40:35 2001
@@ -9739,7 +9739,7 @@
/* If we couldn't simplify X any other way, just enclose it in a
SUBREG. Normally, this SUBREG won't match, but some patterns may
include an explicit SUBREG or we may simplify it further in combine. */
- else
+ else if (GET_MODE (x) != VOIDmode)
{
int offset = 0;
rtx res;
@@ -9748,8 +9748,10 @@
res = simplify_gen_subreg (mode, x, GET_MODE (x), offset);
if (res)
return res;
- return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
+ return gen_rtx_CLOBBER (mode, const0_rtx);
}
+ else
+ return gen_rtx_CLOBBER (mode, const0_rtx);
}
/* These routines make binary and unary operations by first seeing if they
It sound like you would prefer a solution which doesn't record values
which aren't useful. I presume some mod is needed to get_last_value_validate.
However, how to decide what is useful and what isn't?
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)