shift subreg patch [was: gcc/Alpha]
Richard Henderson
rth@cygnus.com
Sun Dec 14 19:00:00 GMT 1997
The attached patch cleans up this untidiness.
r~
On Fri, Dec 12, 1997 at 10:31:26AM +0100, Robert Harley wrote:
> >Can you give an example of what you mean?
>
> OK. A 'zapnot' appears for code like this:
>
> ------------------------------------------------------------------------------
> typedef unsigned long u64;
>
> #define TAB_SIZE (16UL)
> #define TAB_MASK (TAB_SIZE-1UL)
>
> u64 foo(u64 bh, u64 bl, u64 *p)
> {
> u64 sh;
> static const int tab[TAB_SIZE] = { 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0 };
>
> do {
> sh = (u64)tab[bl & TAB_MASK];
> bl >>= sh; bh >>= sh;
> } while (!(bl & 1UL));
>
> *p = bh;
> return bl;
> } /* end foo */
> ------------------------------------------------------------------------------
>
> But then it disappears mysteriously at the slightest change!
> For instance, if the second shift is commented out.
>
> -- Rob.
More information about the Gcc
mailing list