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

            Bug ID: 122629
           Summary: [16 Regression] ICE at -O2/O3 during GIMPLE pass:
                    ifcvt
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xxs_chy at outlook dot com
  Target Milestone: ---

Reproducer: https://godbolt.org/z/GK4EncK16

Testcase:
#include <stdint.h>
#define BS_VEC(type, num) type __attribute__((vector_size(num * sizeof(type))))
BS_VEC(uint64_t, 2)
backsmith_pure_4(BS_VEC(uint64_t, 4), int64_t, BS_VEC(uint32_t, 2), uint16_t,
                 BS_VEC(int32_t, 16), int8_t);
int64_t backsmith_pure_6(BS_VEC(uint64_t, 32) BS_ARG_0,
                         BS_VEC(int64_t, 2) BS_ARG_2) {
  int BS_ARG_1;
  BS_VEC(uint8_t, 8) BS_VAR_0;
  uint64_t BS_VAR_1[32];
  for (uint8_t BS_INC_1; BS_INC_1; BS_INC_1 += 1)
    BS_VAR_1[2 ? BS_VAR_0[4] : 0] += BS_VAR_1[5] ? BS_ARG_0[7] : BS_ARG_0[4];
  __builtin_convertvector((BS_VEC(int8_t, 32)){}, BS_VEC(uint8_t, 32)),
      backsmith_pure_4((BS_VEC(uint64_t, 4)){}, 0,
                       __builtin_convertvector(
                           __builtin_shufflevector(BS_ARG_2, BS_ARG_2, 1, 3),
                           BS_VEC(uint32_t, 2)),
                       3,
                       __builtin_convertvector(
                           (BS_VEC(uint64_t,
16)){BS_VAR_1[191919191919191919]},
                           BS_VEC(int32_t, 16)),
                       BS_ARG_1),
      __builtin_convertvector((BS_VEC(uint16_t, 2)){}, BS_VEC(uint32_t, 2));
}

ICE dump:
<source>: In function 'backsmith_pure_6':
<source>:7:9: note: the ABI for passing parameters with 256-byte alignment has
changed in GCC 4.6
    7 | int64_t backsmith_pure_6(BS_VEC(uint64_t, 32) BS_ARG_0,
      |         ^~~~~~~~~~~~~~~~
<source>:7:9: error: invalid position or size operand to 'bit_field_ref'
iftmp.0_12 = BIT_FIELD_REF <BS_ARG_0_22(D), 64, _43>;
during GIMPLE pass: ifcvt
<source>:7:9: internal compiler error: verify_gimple failed
0x25b5f18 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x25aad0b internal_error(char const*, ...)
        ???:0
0x121995e verify_gimple_in_cfg(function*, bool, bool)
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

Reply via email to