On November 9, 2017 5:11:39 PM GMT+01:00, Eric Botcazou <ebotca...@adacore.com> wrote: >Hi, > >the patch > >2017-07-06 Jan Hubicka <hubi...@ucw.cz> > > * lto-wrapper.c (merge_and_complain): Do not merge > fexceptions, fnon_call_exceptions, ftrapv, ffp_contract_, fmath_errno, > fsigned_zeros, ftrapping_math, fwrapv. > (append_compiler_options): Do not track these options. > (append_linker_options): Likewie > >has broken exception handling in LTO mode for targets which don't force >either >-funwind-tables or -fasynchronous-unwind-tables (i.e not x86) and do >not >default to -fdwarf2-cfi-asm (i.e. not Linux), for example >SPARC/Solaris. > >The problem is that the eh_frame section is no longer generated because >it is >emitted from compile_file: > > #if defined DWARF2_DEBUGGING_INFO || defined DWARF2_UNWIND_INFO > if (dwarf2out_do_frame ()) > dwarf2out_frame_finish (); > #endif > >and this requires that either flag_unwind_tables or flag_exceptions be >set. > >But both -funwind-tables and -fexceptions are optimization options >defaulting >to 0 and they are reset to 0 through optimization_default_node after >the last >function is processed by the cgraph machinery. > >Note that flag_exceptions is generally set to 1 in lto_init_eh very >early, but >the above mechanism overrides it. However, flag_exceptions may *never* >be set >to 1 for a specific partition if it contains only EH-neutral functions; >that's >why I think that there is no other way than restoring the build-wide >handling >of -fexceptions before Jan's patch (hopefully it's the only affected >switch). > >Tested (lightly for now) on x86-64/Linux and SPARC/Solaris, OK for >mainline?
OK. Richard. > >2017-11-09 Eric Botcazou <ebotca...@adacore.com> > > * lto-opts.c (lto_write_options): Do not save -fnon-call-exceptions, > -ffp-contract, -fmath-errno, -fsigned-zeros, -ftrapping-math, -ftrapv > and -fwrapv. > * lto-wrapper.c (merge_and_complain): Merge again -fexceptions. > (append_compiler_options): Pass again -fexceptions.