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

            Bug ID: 84751
           Summary: ICE  with debug build of gcc  GIMPLE pass:
                    store-merging or IPA pass: cp
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: willschm at gcc dot gnu.org
  Target Milestone: ---

Created attachment 43587
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43587&action=edit
testcase

This was noticed during investigation into pr82982 on powerpc64-*-linux-gnu* ,
but believed to be a separate issue.

With a 'debug' build of gcc, where $CPU_COUNT is any value, and the assorted
CFLAGS values are set like in the following. 

make -j $CPU_COUNT CFLAGS="-O0 -g3 -fno-inline" CXXFLAGS="-O0 -g3 -fno-inline"
CFLAGS_FOR_BUILD="-O0 -g3 -fno-inline" CFLAGS_FOR_TARGET="-O0 -g3 -fno-inline"
CXXFLAGS_FOR_BUILD="-O0 -g3 -fno-inline" CXXFLAGS_FOR_TARGET="-O0 -g3
-fno-inline" 

the resulting gcc will ICE when building the testcase with -O2 or higher. 

# driver with -O2
~/gcc/generic.noprereqs.noconfig.debug> ./gcc/cc1 ../pr82982.c  -O2
 km
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> <visibility> <build_ssa_passes> <opt_local_passes>
<targetclone> <free-fnsummary> <whole-program> <profile_estimate> <icf>
<devirt> <cp> <fnsummary> <inline> <pure-const> <free-fnsummary> <static-var>
<single-use> <comdats>Assembling functions:
 <materialize-all-clones> kmduring GIMPLE pass: store-merging

../pr82982.c: In function ‘km’:
../pr82982.c:4:1: internal compiler error: Segmentation fault
 km (void)
 ^~
0x10f2da87 crash_signal
        /home/willschm/gcc/trunk.svn/gcc/toplev.c:325
0x11f76638 trim_filename(char const*)
        /home/willschm/gcc/trunk.svn/gcc/diagnostic.c:1023
0x11f78517 fancy_abort(char const*, int, char const*)
        /home/willschm/gcc/trunk.svn/gcc/diagnostic.c:1509
0x114b56df inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
        /home/willschm/gcc/trunk.svn/gcc/tree.c:7425
0x10f82493 iterative_hash_expr
        /home/willschm/gcc/trunk.svn/gcc/tree.h:4934
0x10f89467 tree_operand_hash::hash(tree_node* const&)
        /home/willschm/gcc/trunk.svn/gcc/tree-hash-traits.h:34
0x11d73dbb hash
        /home/willschm/gcc/trunk.svn/gcc/hash-map-traits.h:49
0x11d7497b get
        /home/willschm/gcc/trunk.svn/gcc/hash-map.h:161
0x11d84fab process_store
        /home/willschm/gcc/trunk.svn/gcc/gimple-ssa-store-merging.c:4171
0x11d85697 execute
        /home/willschm/gcc/trunk.svn/gcc/gimple-ssa-store-merging.c:4279
Please submit a full bug report,
with preprocessed source if appropriate.

# gcc with -O2
/home/willschm/gcc/install/gcc-mainline-pr82982/bin/gcc ~/gcc/pr82982.c -c -O2
during GIMPLE pass: store-merging
/home/willschm/gcc/pr82982.c: In function ‘km’:
/home/willschm/gcc/pr82982.c:4:1: internal compiler error: Segmentation fault
 km (void)
 ^~
0x10f76343 crash_signal
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/toplev.c:325
0x11fd5d98 internal_error(char const*, ...)
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/diagnostic.c:1433
0x11fd5e3f fancy_abort(char const*, int, char const*)
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/diagnostic.c:1500
0x114fd4cb inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/tree.c:7425
0x10fcad2f iterative_hash_expr
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/tree.h:4934
0x10fd1d03 tree_operand_hash::hash(tree_node* const&)
       
/home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/tree-hash-traits.h:34
0x11da7caf hash
       
/home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/hash-map-traits.h:49
0x11da886f get
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/hash-map.h:161
0x11db8e9f process_store
       
/home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/gimple-ssa-store-merging.c:4171
0x11db958b execute
       
/home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/gimple-ssa-store-merging.c:4279
Please submit a full bug report,

# gcc with -O3
# looks like the failure shows up during IPA pass: cp with -O3.
/home/willschm/gcc/install/gcc-mainline-pr82982/bin/gcc ~/gcc/pr82982.c -c -O3
during IPA pass: cp
/home/willschm/gcc/pr82982.c:31:1: internal compiler error: Segmentation fault
 }
 ^
0x10f76343 crash_signal
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/toplev.c:325
0x103de144 tree_check(tree_node*, char const*, int, char const*, tree_code)
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/tree.h:3131
0x10daaa6f opts_for_fn
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/tree.h:5319
0x10dbec43 cgraph_node::optimize_for_size_p()
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/cgraph.h:3152
0x11e526bf ipcp_cloning_candidate_p
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/ipa-cp.c:727
0x11e52ab7 initialize_node_lattices
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/ipa-cp.c:1195
0x11e5fd3f ipcp_propagate_stage
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/ipa-cp.c:3302
0x11e600db ipcp_driver
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/ipa-cp.c:5044
0x11e601c3 execute
        /home/willschm/gcc/gcc-mainline-pr82982/gcc.git/gcc/ipa-cp.c:5138
Please submit a full bug report,

Reply via email to