Bug 99454 - internal compiler error: kernel module tg3 tg3_start_xmit
Summary: internal compiler error: kernel module tg3 tg3_start_xmit
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: 11.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 99455 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-03-07 19:54 UTC by Khem Raj
Modified: 2021-05-30 20:34 UTC (History)
1 user (show)

See Also:
Host: x86_64
Target: x86_64
Build: x86_64
Known to work: 10.2.0
Known to fail: 11.0
Last reconfirmed:


Attachments
testcase (616.81 KB, application/x-xz)
2021-03-07 19:54 UTC, Khem Raj
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Khem Raj 2021-03-07 19:54:48 UTC
Created attachment 50325 [details]
testcase

Compiling kernel 5.10 for x86_64 is resulting in below ICE

=======================
$ x86_64-yoe-linux-musl/x86_64-yoe-linux-musl-gcc -c a.c -O

a.c: In function 'tg3_start_xmit':
a.c:97234:1: error: unrecognizable insn:
97234 | }
      | ^
(insn 258 1293 1351 23 (parallel [
            (set (reg:SI 0 ax [orig:542 sum ] [542])
                (asm_operands:SI ("  addl %1, %0
  adcl %2, %0
  adcl %3, %0
  adcl $0, %0
") ("=r") 0 [
                        (mem:SI (plus:DI (mem/c:DI (plus:DI (reg/f:DI 7 sp)
                                        (const_int 64 [0x40])) [555 %sfp+-32 S8 A64])
                                (const_int 16 [0x10])) [4 MEM[(struct iphdr *)_287].daddr+0 S4 A32])
                        (mem:SI (plus:DI (mem/c:DI (plus:DI (reg/f:DI 7 sp)
                                        (const_int 64 [0x40])) [555 %sfp+-32 S8 A64])
                                (const_int 12 [0xc])) [4 MEM[(struct iphdr *)_287].saddr+0 S4 A32])
                        (const_int 1536 [0x600])
                        (reg:SI 0 ax [orig:542 sum ] [542])
                    ]
                     [
                        (asm_input:SI ("g") a.c:48913)
                        (asm_input:SI ("g") a.c:48913)
                        (asm_input:SI ("g") a.c:48913)
                        (asm_input:SI ("0") a.c:48913)
                    ]
                     [] a.c:48913))
            (clobber (reg:CC 17 flags))
        ]) "a.c":48913:2 -1
     (nil))
during RTL pass: postreload
a.c:97234:1: internal compiler error: in extract_constrain_insn, at recog.c:2670
0x1564e08 internal_error(char const*, ...)
        ???:0
0x60277f fancy_abort(char const*, int, char const*)
        ???:0
0x5dddbe _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        ???:0
0x5dddda _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ???:0
===============


attached is the preprocessed source 


compiler version
gcc version 11.0.1 20210307 (experimental) (GCC)
Comment 1 Khem Raj 2021-03-07 19:57:03 UTC
btw. another data point when compiling with -Os it works but fails with -O1 or -O2
it was working ok with gcc snapshot from 10 days ago.
Comment 2 Andrew Pinski 2021-03-07 20:34:59 UTC
Dup of bug 99422.

*** This bug has been marked as a duplicate of bug 99422 ***
Comment 3 Khem Raj 2021-03-08 19:19:02 UTC
This is not resolved with the fix for #99422 therefore I am re-opening.

I tried with fresh build with head being https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=0d9a70ea3881c284b7689b691d54d047b55b486d which includes the fix for #99422
Comment 4 Vladimir Makarov 2021-03-08 22:23:44 UTC
I've reproduced it.  Sorry for all the troubles.  I'll try to fix it tomorrow.
Comment 5 GCC Commits 2021-03-09 14:06:51 UTC
The master branch has been updated by Vladimir Makarov <vmakarov@gcc.gnu.org>:

https://gcc.gnu.org/g:9725df0233b6fb6e761875968b3b8e9fd9f522ac

commit r11-7578-g9725df0233b6fb6e761875968b3b8e9fd9f522ac
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Tue Mar 9 09:05:05 2021 -0500

    [PR99454] LRA: Process 0..9 constraints in process_address_1
    
    We need to process 0..9 constraints to fetch the right op constraint in
    the function.  Also 0..9 constraints gives unknown class constraint
    class which can result in skipping address normalization for memory in asm.
    
    gcc/ChangeLog:
    
            PR target/99454
            * lra-constraints.c (process_address_1): Process 0..9 constraints
            in process_address_1.
Comment 6 Vladimir Makarov 2021-03-09 15:08:22 UTC
The patch is not enough. It seems that there are other asms in the test which results in LRA crash.
Comment 7 GCC Commits 2021-03-09 16:10:44 UTC
The master branch has been updated by Vladimir Makarov <vmakarov@gcc.gnu.org>:

https://gcc.gnu.org/g:fb5d9e8361892a627f5ef9dda7f356f34000ed5b

commit r11-7584-gfb5d9e8361892a627f5ef9dda7f356f34000ed5b
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Tue Mar 9 10:57:21 2021 -0500

    [PR99454] LRA: Process separately 'g' and digital constraints > 9 in process_address_1
    
    gcc/ChangeLog:
    
            PR target/99454
            * lra-constraints.c (process_address_1): Process constraint 'g'
            separately and digital constraints containing more one digit.
    
    gcc/testsuite/ChangeLog:
    
            PR target/99454
            * gcc.target/i386/pr99454.c: New.
Comment 8 Andrew Pinski 2021-05-30 20:33:50 UTC
Fixed.
Comment 9 Andrew Pinski 2021-05-30 20:34:21 UTC
*** Bug 99455 has been marked as a duplicate of this bug. ***