[Bug rtl-optimization/85925] [7/8/9 regression] Mis-compilation at -02, masking with 257 goes wrong in combine

ebotcazou at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Nov 11 15:21:00 GMT 2018


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

--- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
For the testcase, the tentative fix adds only one instruction:

--- pr85925_0.s 2018-11-11 16:14:32.883280168 +0100
+++ pr85925.s   2018-11-11 16:16:34.734727859 +0100
@@ -38,6 +38,7 @@
        ldreq   lr, [ip]
        mov     r3, r0
 .L5:
+       ubfx    r3, r3, #0, #15
        str     r3, [r1]
        ldr     r3, [r2]
        add     r3, r3, #1

whereas reverting the nonzero_bits1 change of PR rtl-opt/59461 adds two:

--- pr85925_0.s 2018-11-11 16:14:32.883280168 +0100
+++ pr85925_1.s 2018-11-11 16:15:18.800577679 +0100
@@ -38,6 +38,8 @@
        ldreq   lr, [ip]
        mov     r3, r0
 .L5:
+       ubfx    r3, r3, #0, #15
+       uxth    r3, r3
        str     r3, [r1]
        ldr     r3, [r2]
        add     r3, r3, #1


More information about the Gcc-bugs mailing list