This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]