[Bug rtl-optimization/49799] gcc arm generates illegal sbfx instruction

carrot at google dot com gcc-bugzilla@gcc.gnu.org
Mon Jul 25 09:26:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49799

--- Comment #6 from Carrot <carrot at google dot com> 2011-07-25 09:25:22 UTC ---
(In reply to comment #5)
> We should never generate a shift of -1.  Instead the code that does that should
> return (clobber const_int 0).

I'm afraid this method may impact gcc too much. I added the following to the
source code

K[1] = K[1] << -1;

gcc only generates a warning

auto_corr_to_refl_coef.i:19:5: warning: left shift count is negative [enabled
by default]

and generates following code

ldrsh   r1, [r0, #2]
mvn     ip, #0
mov     r1, r1, asl ip
strh    r1, [r0, #2]

What do you think?



More information about the Gcc-bugs mailing list