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

            Bug ID: 84700
           Summary: ICE on 32-bit BE powerpc targets w/ -misel -O1
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: powerpc-*-linux-gnu*, powerpcspe-*-linux-gnu*

gcc from 5 to at least gcc-8.0.0-alpha20180225 snapshot (r257975) inclusive ICE
when compiling the following snippet w/ -misel -O1:

long long int
bk (long long int wi)
{
  long long int d0 = wi < 2;
  int ga = d0 >= 0;

  return d0 + ((wi == 0) ? d0 : ga);
}

% powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20180225 -misel -O1 -c afkfiar3.c
powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20180225: internal compiler error:
Segmentation fault signal terminated program cc1

(gdb) where
#0  0x0000000000c24d51 in simplify_const_binary_operation (code=PLUS,
mode=E_SImode, op0=0x7fffea8142a0, op1=0x7fffea8151f8)
    at
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180225/work/gcc-8-20180225/gcc/simplify-rtx.c:4032
Backtrace stopped: Cannot access memory at address 0x7ffffbffef50

And gcc 5.4.0:

(gdb) where 10
#0  0x00005555558db8aa in wi::storage_ref::storage_ref(long const*, unsigned
int, unsigned int) ()
#1  0x0000555555906622 in wi::int_traits<generic_wide_int<wide_int_storage>
>::decompose(long*, unsigned int, generic_wide_int<wide_int_storage> const&) ()
#2  0x0000555555905df6 in
wide_int_ref_storage<false>::wide_int_ref_storage<generic_wide_int<wide_int_storage>
>(generic_wide_int<wide_int_storage> const&) ()
#3  0x000055555590572f in generic_wide_int<wide_int_ref_storage<false>
>::generic_wide_int<generic_wide_int<wide_int_storage>
>(generic_wide_int<wide_int_storage> const&) ()
#4  0x0000555555f95aa0 in ?? ()
#5  0x0000555555f95fcf in simplify_subreg(machine_mode, rtx_def*, machine_mode,
unsigned int) ()
#6  0x0000555555f96b54 in simplify_gen_subreg(machine_mode, rtx_def*,
machine_mode, unsigned int) ()
#7  0x00005555565dac73 in ?? ()
#8  0x00005555565da604 in ?? ()
#9  0x00005555565cf80b in ?? ()
(More stack frames follow...)

It looks similar to PR81288 but still reproduces for both powerpc and
powerpcspe.

Reply via email to