https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78602
Bug ID: 78602 Summary: PowerPC vec-extract-v2df.c can fail if -mcpu=power9 -O0 Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: meissner at gcc dot gnu.org Target Milestone: --- In doing testing of a future patch, I forgot to apply any optimization when I was building the vec-extract-v*.c tests for -mcpu=power9, and the compiler fails with an insn not found error: -genoa-> ./xgcc -B./ -save-temps -c -mcpu=power9 vec-extract-v2df.c In file included from vec-extract-v2df.c:9:0: vec-extract.h: In function 'get_auto_n': vec-extract.h:36:1: error: unrecognizable insn: } ^ (insn 8 7 9 2 (parallel [ (set (reg:DF 158) (unspec:DF [ (reg:V2DF 157) (mem/c:DI (plus:DI (reg/f:DI 150 virtual-stack-vars) (const_int 16 [0x10])) [4 n+0 S8 A64]) ] UNSPEC_VSX_EXTRACT)) (clobber (scratch:DI)) (clobber (scratch:V2DI)) ]) "vec-extract.h":35 -1 (nil)) vec-extract.h:36:1: internal compiler error: in extract_insn, at recog.c:2311 0x10888313 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /home/meissner/fsf-src/trunk-242932/gcc/rtl-error.c:108 0x10888377 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) /home/meissner/fsf-src/trunk-242932/gcc/rtl-error.c:116 0x1084bc4b extract_insn(rtx_insn*) /home/meissner/fsf-src/trunk-242932/gcc/recog.c:2311 0x105703a7 instantiate_virtual_regs_in_insn /home/meissner/fsf-src/trunk-242932/gcc/function.c:1589 0x105703a7 instantiate_virtual_regs /home/meissner/fsf-src/trunk-242932/gcc/function.c:1956 0x105703a7 execute /home/meissner/fsf-src/trunk-242932/gcc/function.c:2005 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. The cause of the error is the rs6000_expand_vector_extract function was expecting the element number to be either a constant or a register. Normal optimization does a force_reg before doing the expansion in the hopes of letting GCSE find common instructions. However if no optimization is used, this is not done.