R_SUBMMX not handled in SPILLING_CREATE_STORE
## Summary <!-- Summarize the bug encountered concisely --> package rtl-extra compilation fails for trunk x86_64-linux when using OPT="-n -gl -CriotR -O4" ## System Information <!-- The more information are provided the easier it is to replicate the bug --> - **Operating system:** <!-- Windows, Linux (if possible, also name the distro), FreeBSD, Android, ... --> - Bug discovered on gcc122 x86_64-linux test machine - **Processor architecture:** <!-- x86, x86-64, ARM, AARCH64, AVR, RISC-V, PowerPC, ... --> - x86-64 - **Compiler version:** <!-- 3.2, 3.2.2, 3.3, trunk, beta, ... (if possible, give also the git hash) --> - trunk - **Device:** <!-- Computer, Tablet, Mobile, Amiga, Microcontroller, ... --> ## Steps to reproduce <!-- How one can reproduce the issue - this is very important! --> ``` make -C rtl clean all OPT="-n -gl -CriotR -O4" followed by make -C packages clean all OPT="-n -gl -CriotR -O4" ``` ## Example Project <!-- If possible, please create an example project that exhibits the problematic behavior, and link to it here in the bug report. --> Given above. ## What is the current bug behavior? <!-- What actually happens --> ``` [muller@gcc121 fpcsrc]$ make -C packages clean all OPT="-n -gl -CriotR -O4" FPC=`pwd`/compiler/ppcx64 FPMAKEOPT=-I make: Entering directory `/home/muller/pas/gitlab-fpc-source/packages' make -C fpmkunit clean_bootstrap make[1]: Entering directory `/home/muller/pas/gitlab-fpc-source/packages/fpmkunit' /usr/bin/rm -rf units_bs make[1]: Leaving directory `/home/muller/pas/gitlab-fpc-source/packages/fpmkunit' ./fpmake clean -I --localunitdir=.. --os=linux --cpu=x86_64 -o -Cg -o -Fl/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -o -n -o -gl -o -CriotR -o -O4 -o -dx86_64 --compiler=/home/muller/pas/trunk/fpcsrc/compiler/ppcx64 -bu ./fpmake compile -I --localunitdir=.. --os=linux --cpu=x86_64 -o -Cg -o -Fl/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -o -n -o -gl -o -CriotR -o -O4 -o -dx86_64 --compiler=/home/muller/pas/trunk/fpcsrc/compiler/ppcx64 -bu Start compiling package a52 for target x86_64-linux. (1002) Target OS: Linux for x86-64 (3104) Compiling a52/src/a52.pas ..... (2027) User defined: Compile mmatimp.inc for Tmatrix2_double mmatimp.inc(702,13) Fatal: Internal error 2005060404 Fatal: (1018) Compilation aborted External command "/home/muller/pas/trunk/fpcsrc/compiler/ppcx64 -Tlinux -FUrtl-extra/units/x86_64-linux/ -Fu/home/muller/pas/gitlab-fpc-source/rtl/units/x86_64-linux/ -Furtl-extra/src/inc -Furtl-extra/src/unix -Firtl-extra/src/inc -Firtl-extra/src/unix -Firtl-extra/src/linux -Fl/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -Cg -Fl/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -n -gl -CriotR -O4 -dx86_64 -Sc -viq rtl-extra/BuildUnit_rtl_extra.pp" failed with exit code 256. Console output: Target OS: Linux for x86-64 Compiling rtl-extra/BuildUnit_rtl_extra.pp Compiling ./rtl-extra/src/inc/real48utils.pp Compiling ./rtl-extra/src/inc/ucomplex.pp Compiling ./rtl-extra/src/inc/matrix.pp User defined: Compile mvecimp.inc for Tvector2_single User defined: Compile mvecimp.inc for Tvector2_double User defined: Compile mvecimp.inc for Tvector2_extended User defined: Compile mvecimp.inc for Tvector3_single User defined: Compile mvecimp.inc for Tvector3_double User defined: Compile mvecimp.inc for Tvector3_extended User defined: Compile mvecimp.inc for Tvector4_single User defined: Compile mvecimp.inc for Tvector4_double User defined: Compile mvecimp.inc for Tvector4_extended User defined: Compile mmatimp.inc for Tmatrix2_single User defined: Compile mmatimp.inc for Tmatrix2_double mmatimp.inc(702,13) Fatal: Internal error 2005060404 Fatal: Compilation aborted The installer encountered the following error: Compilation of "BuildUnit_rtl_extra.pp" failed make: *** [all] Error 1 make: Leaving directory `/home/muller/pas/gitlab-fpc-source/packages' Using gppcx64: Starting program: /home/muller/pas/trunk/fpcsrc/compiler/ppcx64 -Tlinux -FUrtl-extra/units/x86_64-linux/ -Fu/home/muller/pas/gitlab-fpc-source/rtl/units/x86_64-linux/ -Furtl-extra/src/inc -Furtl-extra/src/unix -Firtl-extra/src/inc -Firtl-extra/src/unix -Firtl-extra/src/linux -Fl/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -Cg -Fl/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -n -gl -CriotR -O4 -dx86_64 -Sc -viq rtl-extra/BuildUnit_rtl_extra.pp (1002) Target OS: Linux for x86-64 (3104) Compiling rtl-extra/BuildUnit_rtl_extra.pp (3104) Compiling ./rtl-extra/src/inc/matrix.pp (2027) User defined: Compile mvecimp.inc for Tvector2_single (2027) User defined: Compile mvecimp.inc for Tvector2_double (2027) User defined: Compile mvecimp.inc for Tvector2_extended (2027) User defined: Compile mvecimp.inc for Tvector3_single (2027) User defined: Compile mvecimp.inc for Tvector3_double (2027) User defined: Compile mvecimp.inc for Tvector3_extended (2027) User defined: Compile mvecimp.inc for Tvector4_single (2027) User defined: Compile mvecimp.inc for Tvector4_double (2027) User defined: Compile mvecimp.inc for Tvector4_extended (2027) User defined: Compile mmatimp.inc for Tmatrix2_single (2027) User defined: Compile mmatimp.inc for Tmatrix2_double Breakpoint 2, INTERNALERROR (I=2005060404) at verbose.pas:592 592 UpdateStatus; (gdb) bt #0 INTERNALERROR (I=2005060404) at verbose.pas:592 #1 0x00000000004ffb1a in SPILLING_CREATE_STORE (R=(TREGISTERHIGHENUM), REF=...) at x86/aasmcpu.pas:4898 #2 0x0000000000507a71 in DO_SPILL_WRITTEN (this=0x7ffff7f3ebe0, LIST=0x7ffff614cdc0, POS=0x7ffff6161d60, SPILLTEMP=..., TEMPREG=(TREGISTERHIGHENUM), ORGSUPREG=32) at rgobj.pas:2618 #3 0x00000000005088ef in INSTR_SPILL_REGISTER (this=0x7ffff7f3ebe0, LIST=0x7ffff614cdc0, INSTR=0x7ffff6161d60, R=..., SPILLTEMPLIST=...) at rgobj.pas:2976 #4 0x000000000050787f in SPILL_REGISTERS (this=0x7ffff7f3ebe0, LIST=0x7ffff614cdc0, HEADERTAI=0x7ffff60d3c00) at rgobj.pas:2574 #5 0x0000000000502e7a in DO_REGISTER_ALLOCATION (this=0x7ffff7f3ebe0, LIST=0x7ffff614cdc0, HEADERTAI=0x7ffff60d3c00) at rgobj.pas:659 #6 0x00000000004edb7d in DO_REGISTER_ALLOCATION (this=0x7ffff6b36540, LIST=0x7ffff614cdc0, HEADERTAI=0x7ffff60d3c00) at cgobj.pas:903 #7 0x0000000000594938 in GENERATE_CODE (this=0x7ffff6827a50) at psub.pas:2163 #8 0x0000000000593669 in GENERATE_CODE_TREE (this=0x7ffff6827a50) at psub.pas:1622 #9 0x0000000000595cd5 in READ_PROC_BODY (OLD_CURRENT_PROCINFO=0x7ffff6824db0, PD=0x7ffff6869c40) at psub.pas:2636 #10 0x0000000000596421 in READ_PROC (ISCLASSMETHOD=false, USEFWPD=0x0, ISGENERIC=false) at psub.pas:2846 #11 0x0000000000596aa3 in READ_DECLARATIONS (ISLIBRARY=false) at psub.pas:3078 #12 0x00000000005904b8 in BLOCK (ISLIBRARY=false) at psub.pas:381 #13 0x0000000000595692 in PARSE_BODY (this=0x7ffff6824db0) at psub.pas:2459 #14 0x00000000006c4faf in PROC_UNIT () at pmodules.pas:1123 #15 0x00000000005784ce in COMPILE (FILENAME=...) at parser.pas:402 #16 0x00000000005675e7 in LOADPPU (this=0x7ffff78bb690) at fppu.pas:2281 #17 0x00000000006c34a3 in LOADUNITS (PRESERVEST=0x0) at pmodules.pas:541 #18 0x00000000006c49a9 in PROC_UNIT () at pmodules.pas:1001 #19 0x00000000005784ce in COMPILE (FILENAME=...) at parser.pas:402 #20 0x00000000004388eb in COMPILE (CMD=0x0) at compiler.pas:291 #21 0x000000000040042a in main () at pp.pas:301 (gdb) f 1 #1 0x00000000004ffb1a in SPILLING_CREATE_STORE (R=(TREGISTERHIGHENUM), REF=...) at x86/aasmcpu.pas:4898 4898 internalerror(2005060404); (gdb) p R $9 = (TREGISTERHIGHENUM) (gdb) p getsubreg(R) $10 = R_SUBMMX ``` ## What is the expected (correct) behavior? <!-- What you should see instead --> Successful compilation ## Relevant logs and/or screenshots <!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as it's very hard to read otherwise. You can also use syntax highlighting for Pascal with: ```pascal the code``` For more information see https://docs.gitlab.com/ee/user/markdown.html --> ## Possible fixes <!-- If you can, link to the line of code that might be responsible for the problem --> I don't know enough the MMX instruction to be able to propose a fix here...
issue