This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LTO problems with -fprofile-generate (aarch64)


> Hi,
> 
> I have problems compiling xalan as part of spec2006 benchmark for aarch64, both native and cross.
> The issue arises when both -flto and -fprofile-generate are enabled during LTO.
> Compiling with the same flags for x86 has no problem.
> Also other projects for aarch64 compile with -flto and -fprofile-generate without problem.
> 
> lto1: internal compiler error: in add_symbol_to_partition_1, at lto/lto-partition.c:210
> 
>  204   /* Ensure that SAME_COMDAT_GROUP lists all allways added in a group.  */
>  205   if (node->same_comdat_group)
>  206     for (node1 = node->same_comdat_group;
>  207          node1 != node; node1 = node1->same_comdat_group)
>  208       if (!node->alias)
>  209         {
>  210           bool added = add_symbol_to_partition_1 (part, node1);
>  211           gcc_assert (added);
>  212         }
>  213   return true;
>  214 }
> 
> Is this a known issue? How can I debug this? Do I need additional options?
> Any hints?

I am not aware of similar PR.  Can you please just fill in an PR and attach dumps of 
-fdump-ipa-cgraph
I think the bug is quite obivous - the function recurses to add_symbol_to_partition_1
and if you have more than 2 symbols in a group it needs to ICE, but I would like to double
check it is indeed the case.

You can just rmeove the assert to see if it lets things to compile well.

Honza
> 
> 
> I get this error:
> 
> lto1: internal compiler error: in add_symbol_to_partition_1, at lto/lto-partition.c:210
> 0x484349 add_symbol_to_partition_1
>         /home/bhuber/sandbox/gcc/toolchain-build-scripts/buildroot/../src/gcc/gcc/lto/lto-partition.c:210
> 0x48442d add_symbol_to_partition_1
>         /home/bhuber/sandbox/gcc/toolchain-build-scripts/buildroot/../src/gcc/gcc/lto/lto-partition.c:182
> 0x48442d add_symbol_to_partition_1
>         /home/bhuber/sandbox/gcc/toolchain-build-scripts/buildroot/../src/gcc/gcc/lto/lto-partition.c:182
> 0x48442d add_symbol_to_partition_1
>         /home/bhuber/sandbox/gcc/toolchain-build-scripts/buildroot/../src/gcc/gcc/lto/lto-partition.c:182
> 0x484403 add_symbol_to_partition_1
>         /home/bhuber/sandbox/gcc/toolchain-build-scripts/buildroot/../src/gcc/gcc/lto/lto-partition.c:180
> 0x4854a1 lto_balanced_map(int)
>         /home/bhuber/sandbox/gcc/toolchain-build-scripts/buildroot/../src/gcc/gcc/lto/lto-partition.c:549
> 0x47e277 do_whole_program_analysis
>         /home/bhuber/sandbox/gcc/toolchain-build-scripts/buildroot/../src/gcc/gcc/lto/lto.c:3297
> 0x47e277 lto_main()
>         /home/bhuber/sandbox/gcc/toolchain-build-scripts/buildroot/../src/gcc/gcc/lto/lto.c:3451
> Please submit a full bug report,
> with preprocessed source if appropriate.
> Please include the complete backtrace with any bug report.
> See  for instructions.
> lto-wrapper: fatal error: /home/bhuber/sandbox/gcc/toolchain-build-scripts/buildroot-upstream/upstream-le/install/opt/for-aarch64/upstream-le/bin/aarch64-for-linux-gnu-g++ returned 1 exit status
> compilation terminated.
> collect2: fatal error: lto-wrapper returned 1 exit status
> compilation terminated.
> 
> 
> I am using a very recent 5.0 based gcc:
> 
> commit e0eaf9732ae973d6204928da23a954683dcfe304
> Author: edlinger <edlinger@138bc75d-0d04-0410-961f-82ee72b054a4>
> Date:   Sun Feb 22 19:38:53 2015 +0000
> 
>     2015-02-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> 
>             PR fortran/64980
>             PR fortran/61960
>             * trans-expr.c (gfc_apply_interface_mapping_to_expr): Remove mapping
>             for component references to class objects.
>             (gfc_conv_procedure_call): Compare the class by name.
> 
>     testsuite:
>     2015-02-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>
> 
>             PR fortran/64980
>             PR fortran/61960
>             * gfortran.dg/pr61960.f90: New.
>             * gfortran.dg/pr64230.f90: New.
>             * gfortran.dg/pr64980.f03: New.
> 
> 
>     git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220899 138bc75d-0d04-0410-961f-82ee72b054a4
> 
> 
> Compilation command is (same for all *.cpp):
> 
> /home/bhuber/sandbox/gcc/toolchain-build-scripts/buildroot-upstream/upstream-le/install/opt/for-aarch64/upstream-le/bin/aarch64-for-linux-gnu-g++
> -c -O3 -flto=8
> -I/home/bhuber/sandbox/spec/cpu2006/benchspec/CPU2006/483.xalancbmk/src
> -I/home/bhuber/sandbox/spec/cpu2006/benchspec/CPU2006/483.xalancbmk/src/xercesc
> -I/home/bhuber/sandbox/spec/cpu2006/benchspec/CPU2006/483.xalancbmk/src/xercesc/dom
> -I/home/bhuber/sandbox/spec/cpu2006/benchspec/CPU2006/483.xalancbmk/src/xercesc/dom/impl
> -I/home/bhuber/sandbox/spec/cpu2006/benchspec/CPU2006/483.xalancbmk/src/xercesc/sax
> -I/home/bhuber/sandbox/spec/cpu2006/benchspec/CPU2006/483.xalancbmk/src/xercesc/util/MsgLoaders/InMemory
> -I/home/bhuber/sandbox/spec/cpu2006/benchspec/CPU2006/483.xalancbmk/src/xercesc/util/Transcoders/Iconv
> -I/home/bhuber/sandbox/spec/cpu2006/benchspec/CPU2006/483.xalancbmk/src/xalanc/include
> -DSPEC_CPU_LP64 -DSPEC_CPU_LINUX -DNDEBUG -DSPEC_CPU -DAPP_NO_THREADS
> -DXALAN_INMEM_MSG_LOADER -DPROJ_XMLPARSER -DPROJ_XMLUTIL -DPROJ_PARSERS
> -DPROJ_SAX4C -DPROJ_SAX2 -DPROJ_DOM -DPROJ_VALIDATORS
> -DXML_USE_NATIVE_TRANSCODER -DXML_USE_INMEM_MESSAGELOADER -fno-vect-cost-model
> -lpthread -funroll-all-loops - finline-limit=1000 --param
> max-inline-insns-single=2000 --param max-inline-insns-auto=2000 --param
> large-unit-insns=30000 --param inline-unit-growth=400 --param
> ipcp-unit-growth=100 --param early-inlining-insns=200 -fprofile-generate -ffast-math -Wall -Wextra
> /home/bhuber/sandbox/spec/cpu2006/benchspec/CPU2006/483.xalancbmk/src/YearMonthDatatypeValidator.cpp
> 
> 
> Linker command:
> 
> /home/bhuber/sandbox/gcc/toolchain-build-scripts/buildroot-upstream/upstream-le/install/opt/for-aarch64/upstream-le/bin/aarch64-for-linux-gnu-g++
> -o /home/bhuber/sandbox/try/out/my_executable -O3 -flto=8 -DSPEC_CPU_LP64
> -DSPEC_CPU_LINUX -DNDEBUG -DSPEC_CPU -DAPP_NO_THREADS -DXALAN_INMEM_MSG_LOADER
> -DPROJ_XMLPARSER -DPROJ_XMLUTIL -DPROJ_PARSERS -DPROJ_SAX4C -DPROJ_SAX2
> -DPROJ_DOM -DPROJ_VALIDATORS -DXML_USE_NATIVE_TRANSCODER
> -DXML_USE_INMEM_MESSAGELOADER -fno-vect-cost-model -lpthread -funroll-all-loops
> -finline-limit=1000 --param max-inline-insns-single=2000 --param
> max-inline-insns-auto=2000 --param large-unit-insns=30000 --param
> inline-unit-growth=400 --param ipcp-unit-growth=100 -param
> early-inlining-insns=200 -fprofile-generate -ffast-math
> /home/bhuber/sandbox/try/out/*.o -lm
> 
> Thank you and best regards,
> Benedikt
> 
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]