Bug 112540 - [14 regression] ICE in extract_insn, at recog.cc:2804 since r14-5456-gb42a09b258c3ed
Summary: [14 regression] ICE in extract_insn, at recog.cc:2804 since r14-5456-gb42a09b...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: 14.0
Assignee: Uroš Bizjak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-15 08:27 UTC by David Binderman
Modified: 2023-11-15 15:14 UTC (History)
1 user (show)

See Also:
Host: x86
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2023-11-15 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2023-11-15 08:27:46 UTC
For this C code:

__imlib_BlendShapedSpanToRGB(int *dst) {
  int tmp;
  ((unsigned char *)dst)[2] = tmp = dst;
  ((unsigned char *)dst)[1] = dst[1] + (tmp >> 8);
}

compiled as follows:

cvise $ ~/gcc/results/bin/gcc -w -O1 -march=znver1 -c bug980.c
cvise $ ~/gcc/results/bin/gcc -w -O2 -march=znver1 -c bug980.c
bug980.c: In function ‘__imlib_BlendShapedSpanToRGB’:
bug980.c:5:1: error: unrecognizable insn:
    5 | }
      | ^
(insn 26 25 12 2 (parallel [
            (set (strict_low_part (reg:QI 1 dx [orig:109 dst.0_1 ] [109]))
                (plus:QI (subreg:QI (zero_extract:DI (reg:QI 1 dx [orig:109 dst.0_1 ] [109])
                            (const_int 8 [0x8])
                            (const_int 8 [0x8])) 0)
                    (reg:QI 2 cx [115])))
            (clobber (reg:CC 17 flags))
        ]) "bug980.c":4:29 -1
     (nil))
during RTL pass: split2
bug980.c:5:1: internal compiler error: in extract_insn, at recog.cc:2804
0xe46c04 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
	/home/dcb38/gcc/working/gcc/../../trunk.year/gcc/rtl-error.cc:108
0xe46c2b _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
	/home/dcb38/gcc/working/gcc/../../trunk.year/gcc/rtl-error.cc:116
0xe00198 extract_insn(rtx_insn*)
	/home/dcb38/gcc/working/gcc/../../trunk.year/gcc/recog.cc:2804

The bug first seems to occur sometime between g:6043bfbd89b335dd
from yesterday and g:081fddbbcf979022 from this morning. 

There are 47 commits in this range.
Comment 1 David Binderman 2023-11-15 08:55:38 UTC
Bisection running.
Comment 2 David Binderman 2023-11-15 09:36:22 UTC
On the current bisection range, the only i386 change is this one:

commit b42a09b258c3ed8d1368e0ef0948034dcf0f8ac9
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Tue Nov 14 18:34:43 2023 +0100

    i386: Generate strict_low_part QImode insn with high input register

So that is a likely candidate. Adding Uros for their opinion.
Comment 3 David Binderman 2023-11-15 10:13:42 UTC
As expected:

trunk.year $ git bisect good d64b7c82dab4f0aa
b42a09b258c3ed8d1368e0ef0948034dcf0f8ac9 is the first bad commit
commit b42a09b258c3ed8d1368e0ef0948034dcf0f8ac9
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Tue Nov 14 18:34:43 2023 +0100

    i386: Generate strict_low_part QImode insn with high input register
Comment 5 GCC Commits 2023-11-15 15:12:07 UTC
The master branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

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

commit r14-5500-gdeff85c1e490c5594eb626697b8052a4e555e51b
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Wed Nov 15 16:11:30 2023 +0100

    i386: Fix strict_low_part QImode insn with high input register patterns [PR112540]
    
            PR target/112540
    
    gcc/ChangeLog:
    
            * config/i386/i386.md (*addqi_ext<mode>_1_slp):
            Correct operand numbers in split pattern.  Replace !Q constraint
            of operand 1 with !qm.  Add insn constrain.
            (*subqi_ext<mode>_1_slp): Ditto.
            (*<any_logic:code>qi_ext<mode>_1_slp): Ditto.
Comment 6 Uroš Bizjak 2023-11-15 15:14:08 UTC
Fixed.