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

            Bug ID: 82386
           Summary: [8 Regression] internal compiler error: Segmentation
                    fault on 32-bit powerpc BE targets
           Product: gcc
           Version: 8.0
            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-8.0.0-alpha20170924 (r253127) ICEs when compiling the following snippet w/
-misel -O2:

long long int fs;
int vm;

void
sd (void)
{
  fs = 1;
  vm = 2;
  goto zf;

  if (0)
    {
      int y6 = 0;
      int *uu = &y6;
      short int he;
      int of = 0;

 zf:
      for (;;)
      {
          he = of;
          if (he || (fs |= vm))
            {
              *uu = fs;
              fs += vm;
            }
          if (y6 == vm)
            fs |= he;
          he = y6 || fs;
          fs /= 0;
        }
    }
}

% powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20170924 -misel -O2 -w -c kvslssip.c
during RTL pass: combine
kvslssip.c: In function 'sd':
kvslssip.c:33:1: internal compiler error: Segmentation fault
 }
 ^
0xc71ef9 crash_signal
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170924/work/gcc-8-20170924/gcc/toplev.c:326
0x133a5d3 rtx_insn* safe_as_a<rtx_insn*, rtx_def>(rtx_def*)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170924/work/gcc-8-20170924/gcc/is-a.h:214
0x133a5d3 PREV_INSN(rtx_insn const*)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170924/work/gcc-8-20170924/gcc/rtl.h:1403
0x133a5d3 distribute_notes
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170924/work/gcc-8-20170924/gcc/combine.c:14572
0x134615f try_combine
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170924/work/gcc-8-20170924/gcc/combine.c:4451
0x134ba4f combine_instructions
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170924/work/gcc-8-20170924/gcc/combine.c:1296
0x134ba4f rest_of_handle_combine
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170924/work/gcc-8-20170924/gcc/combine.c:14778
0x134ba4f execute
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170924/work/gcc-8-20170924/gcc/combine.c:14823
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

==29805== Invalid read of size 2
==29805==    at 0x133A5D3: safe_as_a<rtx_insn*, rtx_def> (is-a.h:214)
==29805==    by 0x133A5D3: PREV_INSN (rtl.h:1403)
==29805==    by 0x133A5D3: distribute_notes(rtx_def*, rtx_insn*, rtx_insn*,
rtx_insn*, rtx_def*, rtx_def*, rtx_def*) (combine.c:14572)
==29805==    by 0x134615F: try_combine(rtx_insn*, rtx_insn*, rtx_insn*,
rtx_insn*, int*, rtx_insn*) (combine.c:4451)
==29805==    by 0x134BA4F: combine_instructions (combine.c:1296)
==29805==    by 0x134BA4F: rest_of_handle_combine (combine.c:14778)
==29805==    by 0x134BA4F: (anonymous
namespace)::pass_combine::execute(function*) (combine.c:14823)
==29805==    by 0xB6D775: execute_one_pass(opt_pass*) (passes.c:2495)
==29805==    by 0xB6E197: execute_pass_list_1(opt_pass*) (passes.c:2584)
==29805==    by 0xB6E1A9: execute_pass_list_1(opt_pass*) (passes.c:2585)
==29805==    by 0xB6E23B: execute_pass_list(function*, opt_pass*)
(passes.c:2595)
==29805==    by 0x7AC4B9: cgraph_node::expand() (cgraphunit.c:2115)
==29805==    by 0x7AD72E: expand_all_functions (cgraphunit.c:2251)
==29805==    by 0x7AD72E: symbol_table::compile() (cgraphunit.c:2599)
==29805==    by 0x7B07E7: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2692)
==29805==    by 0xC722CA: compile_file() (toplev.c:481)
==29805==    by 0x5C148A: do_compile (toplev.c:2037)
==29805==    by 0x5C148A: toplev::main(int, char**) (toplev.c:2172)
==29805==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

Reply via email to