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

            Bug ID: 110867
           Summary: ICE in combine after
                    7cdd0860949c6c3232e6cff1d7ca37bb5234074c
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: prathamesh3492 at gcc dot gnu.org
  Target Milestone: ---

For the following test-case adapted from libgcc/fixed-bit.c:

typedef int DItype __attribute__ ((mode (DI)));

void
__gnu_saturate1sq (DItype *a)
{
  DItype max, min;
  max = (DItype)1 << (31 + 0);
  max = max - 1;

  min = (DItype)1 << (2 * (4 * 8) - 1);
  min = min >> (2 * (4 * 8) - 1 - (31 + 0));



  if (*a > max)
    *a = max;
  else if (*a < min)
    *a = min;
}

Compiling with -O2 on armv8l-unknown-linux-gnueabihf results in following ICE:
typedef int DItype __attribute__ ((mode (DI)));

during RTL pass: combine
foo.c: In function '__gnu_saturate1sq':
foo.c:19:1: internal compiler error: in decompose, at rtl.h:2297
   19 | }
      | ^
0xaa23e3 wi::int_traits<std::pair<rtx_def*, machine_mode> >::decompose(long
long*, unsigned int, std::pair<rtx_def*, machine_mode> const&)
        ../../gcc/gcc/rtl.h:2297
0xaf5ab3 wide_int_ref_storage<false,
true>::wide_int_ref_storage<std::pair<rtx_def*, machine_mode>
>(std::pair<rtx_def*, machine_mode> const&)
        ../../gcc/gcc/wide-int.h:1030
0xaf5023 generic_wide_int<wide_int_ref_storage<false, true>
>::generic_wide_int<std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*,
machine_mode> const&)
        ../../gcc/gcc/wide-int.h:788
0xf916f9 simplify_const_unary_operation(rtx_code, machine_mode, rtx_def*,
machine_mode)
        ../../gcc/gcc/simplify-rtx.cc:2131
0xf8bad5 simplify_context::simplify_unary_operation(rtx_code, machine_mode,
rtx_def*, machine_mode)
        ../../gcc/gcc/simplify-rtx.cc:889
0xf8a591 simplify_context::simplify_gen_unary(rtx_code, machine_mode, rtx_def*,
machine_mode)
        ../../gcc/gcc/simplify-rtx.cc:360
0x9bd1b7 simplify_gen_unary(rtx_code, machine_mode, rtx_def*, machine_mode)
        ../../gcc/gcc/rtl.h:3520
0x1bd5677 simplify_comparison
        ../../gcc/gcc/combine.cc:13125
0x1bc2b2b simplify_set
        ../../gcc/gcc/combine.cc:6848
0x1bc1647 combine_simplify_rtx
        ../../gcc/gcc/combine.cc:6353
0x1bbf97f subst
        ../../gcc/gcc/combine.cc:5609
0x1bb864b try_combine
        ../../gcc/gcc/combine.cc:3302
0x1bb30fb combine_instructions
        ../../gcc/gcc/combine.cc:1264
0x1bd8d25 rest_of_handle_combine
        ../../gcc/gcc/combine.cc:15059
0x1bd8dd5 execute
        ../../gcc/gcc/combine.cc:15103
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.


Thanks,
Prathamesh

Reply via email to