https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68332
Bug ID: 68332 Summary: [6 Regression] ICE: in rs6000_is_valid_mask, at config/rs6000/rs6000.c:17052 with __sync_and_and_fetch() @ powerpc Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Created attachment 36702 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36702&action=edit reduced testcase Running the testsuite with RTL checking enabled shows several times the following assertion failure: $ powerpc-unknown-linux-gnu-gcc testcase.c testcase.c: In function 'foo': testcase.c:6:3: internal compiler error: RTL check: expected code 'const_int', have 'reg' in rs6000_is_valid_mask, at config/rs6000/rs6000.c:17052 __sync_and_and_fetch (&a, b); ^ 0xaa4747 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int, char const*) /repo/gcc-trunk/gcc/rtl.c:811 0xe59608 rs6000_is_valid_mask(rtx_def*, int*, int*, machine_mode) /repo/gcc-trunk/gcc/config/rs6000/rs6000.c:17052 0xe59627 rs6000_is_valid_and_mask(rtx_def*, machine_mode) /repo/gcc-trunk/gcc/config/rs6000/rs6000.c:17109 0x1045eff and_operand(rtx_def*, machine_mode) /repo/gcc-trunk/gcc/config/rs6000/predicates.md:867 0x9f9ee6 insn_operand_matches /repo/gcc-trunk/gcc/optabs.c:6691 0x9f9ee6 maybe_legitimize_operand_same_code /repo/gcc-trunk/gcc/optabs.c:6719 0x9fdc61 maybe_legitimize_operand /repo/gcc-trunk/gcc/optabs.c:6789 0x9fdc61 maybe_legitimize_operands(insn_code, unsigned int, unsigned int, expand_operand*) /repo/gcc-trunk/gcc/optabs.c:6854 0x9fe349 maybe_gen_insn(insn_code, unsigned int, expand_operand*) /repo/gcc-trunk/gcc/optabs.c:6872 0x9fea58 maybe_expand_insn(insn_code, unsigned int, expand_operand*) /repo/gcc-trunk/gcc/optabs.c:6915 0xa003d1 maybe_emit_op /repo/gcc-trunk/gcc/optabs.c:6457 0xa06640 expand_atomic_fetch_op_no_fallback /repo/gcc-trunk/gcc/optabs.c:6497 0xa0685f expand_atomic_fetch_op(rtx_def*, rtx_def*, rtx_def*, rtx_code, memmodel, bool) /repo/gcc-trunk/gcc/optabs.c:6575 0x690301 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int) /repo/gcc-trunk/gcc/builtins.c:6538 0x7d1fbf expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /repo/gcc-trunk/gcc/expr.c:10578 0x6b6f8e expand_expr /repo/gcc-trunk/gcc/expr.h:256 0x6b6f8e expand_call_stmt /repo/gcc-trunk/gcc/cfgexpand.c:2622 0x6b6f8e expand_gimple_stmt_1 /repo/gcc-trunk/gcc/cfgexpand.c:3510 0x6b6f8e expand_gimple_stmt /repo/gcc-trunk/gcc/cfgexpand.c:3673 0x6b8702 expand_gimple_basic_block /repo/gcc-trunk/gcc/cfgexpand.c:5679 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. $ powerpc-unknown-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest-powerpc/bin/powerpc-unknown-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-230115-checking-yes-rtl-df-nographite-powerpc/bin/../libexec/gcc/powerpc-unknown-linux-gnu/6.0.0/lto-wrapper Target: powerpc-unknown-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-checking=yes,rtl,df --without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=powerpc-unknown-linux-gnu --with-ld=/usr/bin/powerpc-unknown-linux-gnu-ld --with-as=/usr/bin/powerpc-unknown-linux-gnu-as --with-sysroot=/chroot/powerpc --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-230115-checking-yes-rtl-df-nographite-powerpc Thread model: posix gcc version 6.0.0 20151110 (experimental) (GCC) RTL checking must be enabled. Tested revisions: r230264 - ICE r230115 - ICE 5-branch r230247 - OK 4_9-branch r230249 - OK 4_8-branch r224828 - OK