On Mon, Jul 1, 2024 at 6:14 AM Roger Sayle <ro...@nextmovesoftware.com> wrote:
>
>
> As promised here's the final ternlog clean-up, that deletes the now
> obsolete legacy patterns and mode iterators from sse.md.  It also updates
> the surviving ternlog patterns to consistently use decimal immediate
> operands (instead of hexadecimal), and updates one last test case to
> match this change.
>
> This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
> and make -k check, both with and without --target_board=unix{-m32}
> with no new failures.  Ok for mainline?
>
>
> 2024-06-30  Roger Sayle  <ro...@nextmovesoftware.com>
>
> gcc/ChangeLog
>         * config/i386/sse.md (*vmov<mode>_constm1_pternlog_false_dep):
>         Use decimal instead hexadecimal.
>         (*<avx512>_cvtmask2<ssemodesuffix><mode>): Likewise.
>         (*<avx512>_cvtmask2<ssemodesuffix><mode>_pternlog_false_dep):
>         Likewise.
>         (any_logic1): Delete define_code_iterator.
>         (any_logic2): Likewise.
>         (logic_op): Delete define_code_attr.
>         (*<avx512>_vpternlog<mode>_1): Delete define_insn_and_split.
>         (*<avx512>_vpternlog<mode>_2): Likewise.
>         (*<avx512>_vpternlog<mode>_3): Likewise.
>         (<mask_codefor>one_cmpl<mode>2<mask_name>): Use decimal.
>         (*one_cmpl<mode>2_pternlog_false_dep): Likewise.
>         (*andnot<mode>3): Likewise.
>         (*iornot<mode>3): Delete define_insn.
>         (*xnor<mode>3): Likewise.
>         (andor): Delete define_code_iterator.
>         (nlogic): Delete define_code_attr.
>         (ternlog_nlogic): Likewise.
>         (*<nlogic><mode>3): Delete define_insn.
>
> gcc/testsuite/ChangeLog
>         * gcc.target/i386/pr100711-6.c: Update to check for decimal
>         immediate operand in ternlog, not hexadecimal.
I got an ICE when bootstrapped with --enable-checking=yes,rtl,extra

../pternlog/libgcc/libgcc2.c: In function ‘__multc3’:
../pternlog/libgcc/libgcc2.c:2760:1: internal compiler error: RTL
check: access of elt 1 of 'not' with last elt 0 in recog_269, at
config/i386/sse.md:25221
 2760 | }
      | ^
0x3826791 internal_error(char const*, ...)
../pternlog/gcc/diagnostic-global-context.cc:491
0x17be383 rtl_check_failed_bounds(rtx_def const*, int, char const*,
int, char const*)
../pternlog/gcc/rtl.cc:741
0x31e8b6e recog_269
../pternlog/gcc/config/i386/sse.md:25221
0x32b6c8b recog_376
../gcc/config/i386/i386.md:1251
0x32bdc29 recog(rtx_def*, rtx_insn*, int*)
../pternlog/gcc/config/i386/sse.md:30262
0x344f1d4 recog_for_combine_1
../pternlog/gcc/combine.cc:11414
0x3453858 recog_for_combine
../pternlog/gcc/combine.cc:11684
0x33f4043 try_combine
../pternlog/gcc/combine.cc:3877
0x33e2539 combine_instructions
../pternlog/gcc/combine.cc:1300
0x34711f2 rest_of_handle_combine
../pternlog/gcc/combine.cc:15127
0x34712ae execute
../pternlog/gcc/combine.cc:15171
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.


static int
recog_269 (rtx x1 ATTRIBUTE_UNUSED,
rtx_insn *insn ATTRIBUTE_UNUSED,
int *pnum_clobbers ATTRIBUTE_UNUSED)
{
  rtx * const operands ATTRIBUTE_UNUSED = &recog_data.operand[0];
  rtx x2, x3, x4, x5;
  int res ATTRIBUTE_UNUSED;
  x2 = XEXP (x1, 0);
  operands[0] = x2;
  x3 = XEXP (x1, 1);
  x4 = XEXP (x3, 1); ----> ICE here, x3 is ((not:TF (reg:TF (306))
  operands[2] = x4;

...
    case AND:
    case IOR:
    case XOR:
    case NOT:
      return recog_269 (x1, insn, pnum_clobbers);

x1 is like
 (set (reg:TF 201)
        (not:TF (reg:TF 306))

IMHO, x4 = XEXP (x3, 1); operands[2] = x4; should only be used under
specific CASE: inside recog_269, but it's hoisted out and caused ICE.
>
>
> Thanks again,
> Roger
> --
>


-- 
BR,
Hongtao

Reply via email to