https://sourceware.org/bugzilla/show_bug.cgi?id=3298

--- Comment #21 from Quentin Boswank <qubos at outlook dot de> ---
(In reply to Joern Rennecke from comment #20)
> (In reply to Quentin Boswank from comment #17)
> > Created attachment 16107 [details]
> > patch for gas bug zeroing 16 or 32 bit width jumptables when relaxing V2
> 
>        max = (1ul << (fixP->fx_size * 8)) - 1;
> 
> There are many ways to avoid shifting by a shiftcount as large or larger than
> type bing shifted.  This is not one of them.
>    available / cheaper type can be used.
> 2a) Split into rounded down & rounded up halves to make do with half the
> type width,
>     e.g.  (1UL << (fixP->fx_size * 4)) << (fixP->fx_size * 4) .
> 2b) Where a shift count value (range) is know, use this to cheaper split.
>    (fixP->fx_size * 8) is in the range [8..32] , so you can subtract one to
> get
>    it into the range [7..31].  Then you can do the left shift of the literal
> by 1 first
>    to get a modified literal: (2UL << (fixP->fx_size * 8 - 1)
> 2c) A combination and/or replication of the above strategies to bridge a
> wider
>     difference between type width and shift count.
> 
> 3) Avoid the shift altogether by using an alternate computation, e.g. a
> table lookup.
> 
> There is also the further problem that the 'long' type of max is not known
> to be
> wide enough to accommodate the value 0xffffffff .  You can use unsigned long
> for that, but then you can't do a defined conversion to a signed type
> without widening first.  And the comparison to val makes no sense when that
> is 32 bit, either.

Thats what the if is designed to work around by just disabling the check if we
can not fit into the widths.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to