This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: copyprop_hardreg_forward removes division
Lars Brinkhoff <lars.spam@nocrew.org> writes:
> Jan Hubicka <jh@suse.cz> writes:
> > Lars Brinkhoff wrote:
> > > I have a problem with a dissapearing division instruction.
> > It looks like you are having same problem as I had. copyprop_hardreg misses
> > the stores to subregs. I've commited fix to that so hope it is OK in the
> > tree (see kill_value).
> No. I'm using the trunk of the tree, updated yesterday, and your
> patch seems to be there
kill_set_value is called with the SUBREGs, so I need something like
this, or else kill_set_value will never call kill_value. However,
this duplicates what your patch did to kill_value, so maybe we can
just change "REG_P(x)" to "(REG_P (x) || GET_CODE (x) == SUBREG)"
or something.
What do you think? I'll make a fully tested patch when I know what
the best solution is.
*************** kill_set_value (x, set, data)
*** 1186,1191 ****
--- 1186,1195 ----
void *data;
{
struct value_data *vd = data;
+
+ if (GET_CODE (x) == SUBREG)
+ x = simplify_subreg (GET_MODE (x), SUBREG_REG (x),
+ GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));
if (GET_CODE (set) != CLOBBER && REG_P (x))
{
kill_value (x, vd);
--
Lars Brinkhoff http://lars.nocrew.org/ Linux, GCC, PDP-10,
Brinkhoff Consulting http://www.brinkhoff.se/ HTTP programming