https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79636

--- Comment #2 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
The bug is also present in GCC-4.7 which uses the old reload pass.  But GCC-4.4
works ok on the test.

The culprit is in udivmod.  GCC-4.4 generates a shift instead of udivmod
generated by GCC-4.7 and the trunk.

As for more accurate live analysis based on partial availability.  It was
implemented in global.c 15 years ago.  Unfortunately, it created more problems
than solutions and was removed in a short time.  DF-infastructure has analogous
code (DF_LIVE problem) but it is not used for the same reasons (I remember
people tried this too in global.c).

So the simplest solution would be generating the shift for -O0 too.  Another
alternative is to implement hard reg live range splitting in LRA for this case
but it would be a dangerous approach when we are close to the release.

The code is very questionable to me.  I'd never use dx for register variable in
a real program as it is used by an integer div/mod.

I don't think it should be a P2 or even P3 bug.

Reply via email to