Bug 1169338 - m4 miscompiled by profiling on arm32
m4 miscompiled by profiling on arm32
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Development
Current
armv7 Other
: P5 - None : Normal (vote)
: ---
Assigned To: Richard Biener
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-13 18:28 UTC by Andreas Schwab
Modified: 2022-03-22 12:48 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schwab 2020-04-13 18:28:36 UTC
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:ARM/m4/standard/armv7l

The function ntoa inlined into m4_incr is miscompiled with -fprofile-use, using signed divmod instead of unsigned divmod.

        add     r2, pc, r8
        strb    r1, [r2, #307]
        bmi     .L567
.L575:
        ldr     r9, .L605+56
        movw    r8, #52429
        mov     r1, #10
        ldr     r10, .L605+60
        mov     r0, r7
        movt    r8, 52428
        bl      __aeabi_idivmod(PLT)
        cmp     r7, #9
.LPIC155:
        add     r9, pc, r9
.LPIC154:
        add     r6, pc, r10
        ldrb    r0, [r9, r1]    @ zero_extendqisi2
        umull   r10, fp, r7, r8
        lsr     fp, fp, #3
        strb    r0, [r6, #306]
        bls     .L585
        mov     r0, fp
        umull   r10, fp, fp, r8
        mov     r1, #10
        bl      __aeabi_idivmod(PLT)
        ldrb    ip, [r9, r1]    @ zero_extendqisi2
        cmp     r7, #99
        lsr     r8, fp, #3
        strb    ip, [r6, #305]
        bhi     .L582
        add     r3, r6, #52
        add     r6, r3, #253
        add     r9, r3, #254
        b       .L576
Comment 1 Andreas Schwab 2020-04-13 18:49:53 UTC
This is no longer reproducable with gcc-10.
Comment 2 Richard Biener 2020-04-14 07:45:06 UTC
Please file an upstream bugreport.
Comment 3 Richard Biener 2022-03-22 12:48:37 UTC
Fixed with gcc10+ as used in Tumbleweed now.