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

--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
If u4 is changed to "unsigned long" in test case #4, the assembly code becomes
(via godbolt)

gforth_engine2:
        movq    gforth_engine2_in_SPs(%rip), %rax
        movq    8(%rax), %rax
.L8:
        movq    %rax, %rsi
        movabsq $-3689348814741910323, %rax
        mulq    %rsi
        movq    %rdx, %rax
        shrq    $3, %rdx
        shrq    $3, %rax
        movq    %rdx, gforth_engine2_spc(%rip)
        xorl    %edx, %edx
        leaq    (%rax,%rax,4), %rcx
        movq    %rsi, %rax
        addq    %rcx, %rcx
        subq    %rcx, %rax
        jmp     *%rdx
        xorl    %edx, %edx
        jmp     *%rdx
        xorl    %edx, %edx
        jmp     *%rdx
        xorl    %edx, %edx
        jmp     *%rdx
        xorl    %edx, %edx
        jmp     *%rdx
        xorl    %edx, %edx
        jmp     *%rdx
        jmp     .L8
        jmp     .L8
        jmp     .L8
        jmp     .L8
        jmp     .L8
        jmp     .L8
gforth_engine2_spc:
        .zero   8
gforth_engine2_in_SPs:
        .zero   8

which exhibits the same behavior, minus the

        andl    $4294967295, %edx

Reply via email to