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

            Bug ID: 81288
           Summary: [5/6/7/8 Regression] ICE on 32-bit BE powerpc targets
                    -w -misel -O2 (-O3, -Ofast, -Os)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          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 8.0.0-alpha20170625 snapshot inclusive ICE when
compiling the following snippet w/ -misel -O2 (-O3, -Ofast, -Os):

int
yk (unsigned long long int t4, int f3)
{
  unsigned int *un = (f3 != 0) ? &t4 : 0;

  *un ^= t4;
  if (*un == t4)
    f3 = !!t4;

  return f3;
}

% powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20170625 -Os -misel -c -w k2ei2ru6.c 
powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20170625: internal compiler error:
Segmentation fault (program cc1)

gcc 8 demonstrates the following backtrace:

(gdb) where
#0  0x0000000000c26481 in simplify_immed_subreg (outermode=SImode,
op=0x3fff712f480, innermode=DImode, byte=4)
    at
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20170625/work/gcc-8-20170625/gcc/simplify-rtx.c:5686
Backtrace stopped: Cannot access memory at address 0x3fffbffefd0

And gcc 5.4.0:

(gdb) where 10
#0  0x000002aaab00ec7e in vec<df_ref_d*, va_heap, vl_ptr>::vec() ()
#1  0x000002aaab00ecee in auto_vec<df_ref_d*, 128ul>::auto_vec() ()
#2  0x000002aaab00e9a2 in df_collection_rec::df_collection_rec() ()
#3  0x000002aaab0062ab in df_insn_rescan(rtx_insn*) ()
#4  0x000002aaab426c13 in confirm_change_group() ()
#5  0x000002aaab426c79 in apply_change_group() ()
#6  0x000002aaabb4f43d in ?? ()
#7  0x000002aaabb4f8cf in ?? ()
#8  0x000002aaabb4f8cf in ?? ()
#9  0x000002aaabb4f8cf in ?? ()
(More stack frames follow...)
(gdb) where -20
#190606 0x000002aaabb4f8cf in ?? ()
#190607 0x000002aaabb5225f in ?? ()
#190608 0x000002aaabb52630 in ?? ()
#190609 0x000002aaabb589f3 in ?? ()
#190610 0x000002aaabb58f4b in ?? ()
#190611 0x000002aaabb5b236 in ?? ()
#190612 0x000002aaabb5b3c9 in ?? ()
#190613 0x000002aaab3ed4b7 in execute_one_pass(opt_pass*) ()
#190614 0x000002aaab3ed746 in ?? ()
#190615 0x000002aaab3ed777 in ?? ()
#190616 0x000002aaab3ed7ee in execute_pass_list(function*, opt_pass*) ()
#190617 0x000002aaaafca86e in cgraph_node::expand() ()
#190618 0x000002aaaafcad99 in ?? ()
#190619 0x000002aaaafcb94d in symbol_table::compile() ()
#190620 0x000002aaaafcba8c in symbol_table::finalize_compilation_unit() ()
#190621 0x000002aaaae27901 in c_write_global_declarations() ()
#190622 0x000002aaab50bcff in ?? ()
#190623 0x000002aaab50e6b9 in ?? ()
#190624 0x000002aaab50e9cb in toplev::main(int, char**) ()
#190625 0x000002aaabcb5b9f in main ()

Reply via email to