https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127379

            Bug ID: 127379
           Summary: [17 Regression][GCN] ICE 'invalid vector types in nop
                    conversion' since r17-4207-g56c81c325cccf4
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: ams at gcc dot gnu.org
  Target Milestone: ---
            Target: gcn

Compiling newlib fails recently.
Fail:

newlib/libm/machine/amdgcn/v64df_fmod.c:196:1: error: invalid vector types in
nop conversion
  196 | DEF_VARIANTS2 (fmod, df, df)
      | ^~~~~~~~~~~~~
vector(64) unsigned int
bool
_24 = (vector(64) unsigned int) _1529;
during GIMPLE pass: forwprop

* * *

Reduced testcase:

__attribute__((
    __vector_size__(1 * sizeof(unsigned int)))) unsigned int v64df_fmod_aux_ly;
int v64df_fmod_aux_hy;
void v64df_fmod_aux() {
  v64df_fmod_aux_hy | (v64df_fmod_aux_ly | -v64df_fmod_aux_ly) >> 31;
}

* * *

Bisecting points at commit r17-4207-g56c81c325cccf4:

Author: Dominic P
Date:   Sun Sep 13 13:34:45 2026 -0600

    [PATCH] match.pd: Fold ((X + C1) | (C2 - X)) < 0 to an unsigned range test
...
    gcc/ChangeLog:
            * match.pd (ior_range_test, ior_range_test_1, ior_range_test_0):
            New matchers.
            (((X + C1) | (C2 - X)) < 0): New simplification.
            ((unsigned) ((X + C1) | (C2 - X)) >> (prec - 1)): Likewise.
            (ABS_EXPR <X> > C): Likewise.

Reply via email to