aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
AgeCommit message (Collapse)AuthorFilesLines
2021-04-16Daily bump.GCC Administrator1-0/+5
2021-04-15Fix handling of clones in lto_wpa_write_files [PR98599]Jan Hubicka1-1/+1
2021-04-15 Jan Hubicka <hubicka@ucw.cz> PR lto/98599 * lto.c (lto_wpa_write_files): Fix handling of clones.
2021-04-09Daily bump.GCC Administrator1-0/+5
2021-04-08PR middle-end/99883 - A couple of minor misspellingsMartin Sebor1-1/+1
gcc/c-family/ChangeLog: PR middle-end/99883 * c.opt (Wmismatched-new-delete): Correct spelling. gcc/lto/ChangeLog: PR middle-end/99883 * lto-lang.c (lto_post_options): Correct spelling.
2021-03-01Daily bump.GCC Administrator1-0/+7
2021-02-28typos: Fix various typos - mainly misspelled reference* [PR99304]Jakub Jelinek1-1/+2
The PR is about a typo in handle_malloc_attribute diagnostic message, but grepping around I found many other cases and while fixing those I've noticed a couple of other typos. 2021-02-28 Jakub Jelinek <jakub@redhat.com> PR c/99304 * ipa.c (symbol_table::remove_unreachable_nodes): Fix a comment typo - referneced -> referenced. * tree.c (component_ref_size): Fix comment typo - refernce -> reference. * tree-ssa-alias.c (access_path_may_continue_p): Fix comment typo - traling -> trailing. (aliasing_component_refs_p): Fix comment typos - refernce -> reference and refernece -> reference and traling -> trailing. (nonoverlapping_refs_since_match_p): Fix comment typo - referneces -> references. * doc/invoke.texi (--param modref-max-bases): Fix a typo - referneces -> references. gcc/c-family/ * c-attribs.c (handle_malloc_attribute): Fix a typo in inform message - refernced -> referenced. Remove superfluous space before closing paren of function calls. gcc/lto/ * lto-symtab.c (lto_symtab_prevailing_virtual_decl): Fix comment typos - refernced -> referenced and devirtualizaiton -> devirtualization.
2021-01-04Update copyright years.Jakub Jelinek18-18/+18
2021-01-04Update Copyright in ChangeLog filesJakub Jelinek1-1/+1
Do this separately from all other Copyright updates, as ChangeLog files can be modified only separately.
2020-12-17Daily bump.GCC Administrator1-0/+4
2020-12-16opts: Remove all usages of Report keyword.Martin Liska1-3/+3
gcc/brig/ChangeLog: * lang.opt: Remove usage of Report. gcc/c-family/ChangeLog: * c.opt: Remove usage of Report. gcc/ChangeLog: * common.opt: Remove usage of Report. * config/aarch64/aarch64.opt: Ditto. * config/alpha/alpha.opt: Ditto. * config/arc/arc.opt: Ditto. * config/arm/arm.opt: Ditto. * config/avr/avr.opt: Ditto. * config/bfin/bfin.opt: Ditto. * config/bpf/bpf.opt: Ditto. * config/c6x/c6x.opt: Ditto. * config/cr16/cr16.opt: Ditto. * config/cris/cris.opt: Ditto. * config/cris/elf.opt: Ditto. * config/csky/csky.opt: Ditto. * config/darwin.opt: Ditto. * config/fr30/fr30.opt: Ditto. * config/frv/frv.opt: Ditto. * config/ft32/ft32.opt: Ditto. * config/gcn/gcn.opt: Ditto. * config/i386/cygming.opt: Ditto. * config/i386/i386.opt: Ditto. * config/ia64/ia64.opt: Ditto. * config/ia64/ilp32.opt: Ditto. * config/linux-android.opt: Ditto. * config/linux.opt: Ditto. * config/lm32/lm32.opt: Ditto. * config/m32r/m32r.opt: Ditto. * config/m68k/m68k.opt: Ditto. * config/mcore/mcore.opt: Ditto. * config/microblaze/microblaze.opt: Ditto. * config/mips/mips.opt: Ditto. * config/mmix/mmix.opt: Ditto. * config/mn10300/mn10300.opt: Ditto. * config/moxie/moxie.opt: Ditto. * config/msp430/msp430.opt: Ditto. * config/nds32/nds32.opt: Ditto. * config/nios2/elf.opt: Ditto. * config/nios2/nios2.opt: Ditto. * config/nvptx/nvptx.opt: Ditto. * config/pa/pa.opt: Ditto. * config/pdp11/pdp11.opt: Ditto. * config/pru/pru.opt: Ditto. * config/riscv/riscv.opt: Ditto. * config/rl78/rl78.opt: Ditto. * config/rs6000/aix64.opt: Ditto. * config/rs6000/linux64.opt: Ditto. * config/rs6000/rs6000.opt: Ditto. * config/rs6000/sysv4.opt: Ditto. * config/rx/elf.opt: Ditto. * config/rx/rx.opt: Ditto. * config/s390/s390.opt: Ditto. * config/s390/tpf.opt: Ditto. * config/sh/sh.opt: Ditto. * config/sol2.opt: Ditto. * config/sparc/long-double-switch.opt: Ditto. * config/sparc/sparc.opt: Ditto. * config/tilegx/tilegx.opt: Ditto. * config/tilepro/tilepro.opt: Ditto. * config/v850/v850.opt: Ditto. * config/visium/visium.opt: Ditto. * config/vms/vms.opt: Ditto. * config/vxworks.opt: Ditto. * config/xtensa/xtensa.opt: Ditto. gcc/lto/ChangeLog: * lang.opt: Remove usage of Report.
2020-11-21Daily bump.GCC Administrator1-0/+9
2020-11-20configury: Fix up --enable-link-serialization supportJakub Jelinek1-5/+5
Eric reported that the --enable-link-serialization changes seemed to cause the binaries to be always relinked, for example from the gcc/ directory of the build tree: make [relink of gnat1, brig1, cc1plus, d21, f951, go1, lto1, ...] make [relink of gnat1, brig1, cc1plus, d21, f951, go1, lto1, ...] Furthermore as reported in PR, it can cause problems during make install where make install rebuilds the binaries again. The problem is that for make .PHONY targets are just "rebuilt" always, so it is very much undesirable for the cc1plus$(exeext) etc. dependencies to include .PHONY targets, but I was using them - cc1plus.prev which would depend on some *.serial and e.g. cc1.serial depending on c and c depending on cc1$(exeext). The following patch rewrites this so that *.serial and *.prev aren't .PHONY targets, but instead just make variables. I was worried that the order in which the language makefile fragments are included (which is quite random, what order we get from the filesystem matching */config-lang.in) would be a problem but it seems to work fine - as it uses make = rather than := variables, later definitions are just fine for earlier uses as long as the uses aren't needed during the makefile parsing, but only in the dependencies of make targets and in their commands. 2020-11-20 Jakub Jelinek <jakub@redhat.com> PR other/97911 gcc/ * configure.ac: In SERIAL_LIST use lang words without .serial suffix. Change $lang.prev from a target to variable and instead of depending on *.serial expand to the *.serial variable if the word is in the SERIAL_LIST at all, otherwise to nothing. * configure: Regenerated. gcc/c/ * Make-lang.in (c.serial): Change from goal to a variable. (.PHONY): Drop c.serial. gcc/ada/ * gcc-interface/Make-lang.in (ada.serial): Change from goal to a variable. (.PHONY): Drop ada.serial and ada.prev. (gnat1$(exeext)): Depend on $(ada.serial) rather than ada.serial. gcc/brig/ * Make-lang.in (brig.serial): Change from goal to a variable. (.PHONY): Drop brig.serial and brig.prev. (brig1$(exeext)): Depend on $(brig.serial) rather than brig.serial. gcc/cp/ * Make-lang.in (c++.serial): Change from goal to a variable. (.PHONY): Drop c++.serial and c++.prev. (cc1plus$(exeext)): Depend on $(c++.serial) rather than c++.serial. gcc/d/ * Make-lang.in (d.serial): Change from goal to a variable. (.PHONY): Drop d.serial and d.prev. (d21$(exeext)): Depend on $(d.serial) rather than d.serial. gcc/fortran/ * Make-lang.in (fortran.serial): Change from goal to a variable. (.PHONY): Drop fortran.serial and fortran.prev. (f951$(exeext)): Depend on $(fortran.serial) rather than fortran.serial. gcc/go/ * Make-lang.in (go.serial): Change from goal to a variable. (.PHONY): Drop go.serial and go.prev. (go1$(exeext)): Depend on $(go.serial) rather than go.serial. gcc/jit/ * Make-lang.in (jit.serial): Change from goal to a variable. (.PHONY): Drop jit.serial and jit.prev. ($(LIBGCCJIT_FILENAME)): Depend on $(jit.serial) rather than jit.serial. gcc/lto/ * Make-lang.in (lto1.serial, lto2.serial): Change from goals to variables. (.PHONY): Drop lto1.serial, lto2.serial, lto1.prev and lto2.prev. ($(LTO_EXE)): Depend on $(lto1.serial) rather than lto1.serial. ($(LTO_DUMP_EXE)): Depend on $(lto2.serial) rather than lto2.serial. gcc/objc/ * Make-lang.in (objc.serial): Change from goal to a variable. (.PHONY): Drop objc.serial and objc.prev. (cc1obj$(exeext)): Depend on $(objc.serial) rather than objc.serial. gcc/objcp/ * Make-lang.in (obj-c++.serial): Change from goal to a variable. (.PHONY): Drop obj-c++.serial and obj-c++.prev. (cc1objplus$(exeext)): Depend on $(obj-c++.serial) rather than obj-c++.serial.
2020-11-19Daily bump.GCC Administrator1-0/+12
2020-11-18lto: Fix typo in comment of gcc/lto/lto-symtab.cJerry Clcanny1-1/+1
* lto-symtab.c (lto_symtab_merge_symbols): Fix typos in comment.
2020-11-18configury: --enable-link-serialization supportJakub Jelinek1-4/+14
When performing LTO bootstraps, especially when using tmpfs for /tmp, one can run a machine to halt when using higher levels of parallelism and a large number of FEs, because there are too many concurrent LTO link commands running at the same time and each one of them puts most of the middle-end/backend objects into /tmp. We have --enable-link-mutex configure option, but --enable-link-mutex has a big problem that it decreases number of available jobs by the number of link commands waiting for the lock, so e.g. when doing make -j32 build with 11 different big programs linked with $(LLINKER) we end up with just 22 effective jobs, and with e.g. make -j8 with those 11 different big programs we actually most likely serialize everything during linking onto a single job. The following patch implements a new configure option, --enable-link-serialization, which implements different serialization and as it doesn't use the mutex, just modifying the old option to be implemented differently would be strange. We can deprecate and later remove the old option. The new option doesn't use any shell mutexes, but uses make dependencies. The option is implemented inside of gcc/ configure and Makefiles, which means that even inside of gcc/ make all (as well as e.g. make lto-dump) will serialize and build all previous large binaries when configured this way. One can always make -j32 cc1 DO_LINK_SERIALIZATION= to avoid that. Furthermore, I've implemented the idea I wrote about, so that --enable-link-serialization is the same as --enable-link-serialization=1 and means the large link commands are serialized, one can (the default) --disable-link-serialization which will cause all links to be parallelizable, but one can also --enable-link-serialization=3 etc. which says that at most 3 of the large link commands can run concurrently. And finally I've implemented (only if the serialization is enabled) simple progress bars for the linking. With --enable-link-serialization and e.g. the 5 large links I have in my current tree (cc1, cc1plus, f951, lto1 and lto-dump), before the linking it prints Linking |==-- | 20% and after it Linking |==== | 40% (each == characters stand for already finished links, each -- characters stand for the link being started). With --enable-link-serialization=3 it will change the way the start is printed, one will get: Linking |-- | 0% at the start of cc1 link, Linking |>>-- | 0% at the start of the second large link and Linking |>>>>-- | 0% at the start of the third large link, where the >> characters stand for already pending links. The printing at the end of link command is the same as with the full serialization, i.e. for the above 3: Linking |== | 20% Linking |==== | 40% Linking |====== | 60% but one could actually get them in any order depending on which of those 3 finishes first - to get it 100% accurate I'd need to add some directory with files representing finished links or similar, doesn't seem worth it. 2020-11-18 Jakub Jelinek <jakub@redhat.com> gcc/ * configure.ac: Add $lang.prev rules, INDEX.$lang and SERIAL_LIST and SERIAL_COUNT variables to Make-hooks. (--enable-link-serialization): New configure option. * Makefile.in (DO_LINK_SERIALIZATION, LINK_PROGRESS): New variables. * doc/install.texi (--enable-link-serialization): Document. * configure: Regenerated. gcc/c/ * Make-lang.in (c.serial): New goal. (.PHONY): Add c.serial c.prev. (cc1$(exeext)): Call LINK_PROGRESS. gcc/cp/ * Make-lang.in (c++.serial): New goal. (.PHONY): Add c++.serial c++.prev. (cc1plus$(exeext)): Depend on c++.prev. Call LINK_PROGRESS. gcc/fortran/ * Make-lang.in (fortran.serial): New goal. (.PHONY): Add fortran.serial fortran.prev. (f951$(exeext)): Depend on fortran.prev. Call LINK_PROGRESS. gcc/lto/ * Make-lang.in (lto, lto1.serial, lto2.serial): New goals. (.PHONY): Add lto lto1.serial lto1.prev lto2.serial lto2.prev. (lto.all.cross, lto.start.encap): Remove dependencies. ($(LTO_EXE)): Depend on lto1.prev. Call LINK_PROGRESS. ($(LTO_DUMP_EXE)): Depend on lto2.prev. Call LINK_PROGRESS. gcc/objc/ * Make-lang.in (objc.serial): New goal. (.PHONY): Add objc.serial objc.prev. (cc1obj$(exeext)): Depend on objc.prev. Call LINK_PROGRESS. gcc/objcp/ * Make-lang.in (obj-c++.serial): New goal. (.PHONY): Add obj-c++.serial obj-c++.prev. (cc1objplus$(exeext)): Depend on obj-c++.prev. Call LINK_PROGRESS. gcc/ada/ * gcc-interface/Make-lang.in (ada.serial): New goal. (.PHONY): Add ada.serial ada.prev. (gnat1$(exeext)): Depend on ada.prev. Call LINK_PROGRESS. gcc/brig/ * Make-lang.in (brig.serial): New goal. (.PHONY): Add brig.serial brig.prev. (brig1$(exeext)): Depend on brig.prev. Call LINK_PROGRESS. gcc/go/ * Make-lang.in (go.serial): New goal. (.PHONY): Add go.serial go.prev. (go1$(exeext)): Depend on go.prev. Call LINK_PROGRESS. gcc/jit/ * Make-lang.in (jit.serial): New goal. (.PHONY): Add jit.serial jit.prev. ($(LIBGCCJIT_FILENAME)): Depend on jit.prev. Call LINK_PROGRESS. gcc/d/ * Make-lang.in (d.serial): New goal. (.PHONY): Add d.serial d.prev. (d21$(exeext)): Depend on d.prev. Call LINK_PROGRESS.
2020-11-18Daily bump.GCC Administrator1-0/+7
2020-11-17Make ltrans type canonicals compatible with WPA onesJan Hubicka1-2/+3
This patch fixes profiledbootstrap failure with LTO enabled. Not refining alias sets from WPA to ltrans time is a good invariant to maintain and the canonical type hash behaves this way. However I broke this with the ODR logic. Normally we define canonical types for C++ ODR types according to their type names. However to make ODR types compatible with C types we check if structurally equivalent C type exists and if so, we ignore ODR names giving up on the precision. This however is not stable between WPA and ltrans since at ltrans the type merging does not see as many types as WPA does. To make this consistent the patch makes WPA ODR_TYPE_P == 0 for ODR types that conflicted with non-ODR type. I had to drop one sanity check in ipa-utils.h (that I think is not very important - I added it while introducing CXX_ODR_P machinery) and also it now may happen that we query odr_based_tbaa_p before registering first ODR type so we do not want to ICE here. ODR type registration happens early to produce ODR violation warings. Those are not done at ltrans, so dropping the registration is safe. The type will still be added while computing the type inheritance graph if needed for devirtualization (and late devirtualization is not very useful anyway since it won't enable inlining). gcc/ChangeLog: PR bootstrap/97857 * ipa-devirt.c (odr_based_tbaa_p): Do not ICE when odr_hash is not initialized * ipa-utils.h (type_with_linkage_p): Do not sanity check CXX_ODR_P. * tree-streamer-out.c (pack_ts_type_common_value_fields): Set CXX_ODR_P according to the canonical type. gcc/lto/ChangeLog: PR bootstrap/97857 * lto-common.c (gimple_register_canonical_type_1): Only register types with TYPE_CXX_ODR_P flag; sanity check that no conflict happens at ltrans time.
2020-11-07Daily bump.GCC Administrator1-0/+5
2020-11-06core: Rename DECL_IS_BUILTIN -> DECL_IS_UNDECLARED_BUILTINNathan Sidwell1-2/+2
In cleaning up C++'s handling of hidden decls, I renamed its DECL_BUILTIN_P, which checks for loc == BUILTINS_LOCATION to DECL_UNDECLARED_BUILTIN_P, because the location gets updated, if user source declares the builtin, and the predicate no longer holds. The original name was confusing me. (The builtin may still retain builtin properties in the redeclaration, and other predicates can still detect that.) I discovered that tree.h had its own variant 'DECL_IS_BUILTIN', which behaves in (almost) the same manner. And therefore has the same mutating behaviour. This patch deletes the C++ one, and renames tree.h's to DECL_IS_UNDECLARED_BUILTIN, to emphasize its non-constantness. I guess _IS_ wins over _P gcc/ * tree.h (DECL_IS_BUILTIN): Rename to ... (DECL_IS_UNDECLARED_BUILTIN): ... here. No need to use SOURCE_LOCUS. * calls.c (maybe_warn_alloc_args_overflow): Adjust for rename. * cfgexpand.c (pass_expand::execute): Likewise. * dwarf2out.c (base_type_die, is_naming_typedef_decl): Likewise. * godump.c (go_decl, go_type_decl): Likewise. * print-tree.c (print_decl_identifier): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (pass_post_ipa_warn::execute): Likewise. * xcoffout.c (xcoff_assign_fundamental_type_number): Likewise. gcc/c-family/ * c-ada-spec.c (collect_ada_nodes): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. (collect_ada_node): Likewise. (dump_forward_type): Likewise. * c-common.c (set_underlying_type): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. (user_facing_original_type, c_common_finalize_early_debug): Likewise. gcc/c/ * c-decl.c (diagnose_mismatched_decls): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. (warn_if_shadowing, implicitly_declare, names_builtin_p) (collect_source_refs): Likewise. * c-typeck.c (inform_declaration, inform_for_arg) (convert_for_assignment): Likewise. gcc/cp/ * cp-tree.h (DECL_UNDECLARED_BUILTIN_P): Delete. * cp-objcp-common.c (names_bultin_p): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. * decl.c (decls_match): Likewise. Replace DECL_UNDECLARED_BUILTIN_P with DECL_IS_UNDECLARED_BUILTIN. (duplicate_decls): Likewise. * decl2.c (collect_source_refs): Likewise. * name-lookup.c (anticipated_builtin_p, print_binding_level) (do_nonmember_using_decl): Likewise. * pt.c (builtin_pack_fn_p): Likewise. * typeck.c (error_args_num): Likewise. gcc/lto/ * lto-symtab.c (lto_symtab_merge_decls_1): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. gcc/go/ * go-gcc.cc (Gcc_backend::call_expression): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. libcc1/ * libcc1plugin.cc (address_rewriter): Rename DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN. * libcp1plugin.cc (supplement_binding): Likewise.
2020-10-29Daily bump.GCC Administrator1-0/+8
2020-10-28lto: LTO cgraph support for late declare variant resolution [PR96680]Jakub Jelinek2-3/+3
> I've tried to add the saving/restoring next to ipa refs saving/restoring, as > the declare variant alt stuff is kind of extension of those, unfortunately > following doesn't compile, because I need to also write or read a tree there > (ctx is a portion of DECL_ATTRIBUTES of the base function), but the ipa refs > write/read back functions don't have arguments that can be used for that. This patch adds the streaming out and in of those omp_declare_variant_alt hash table on the side data for the declare_variant_alt cgraph_nodes and treats for LTO purposes the declare_variant_alt nodes (which have no body) as if they contained a body that calls all the possible variants. After IPA all the calls to these magic declare_variant_alt calls are replaced with call to one of the variant depending on which one has the highest score in the context. 2020-10-28 Jakub Jelinek <jakub@redhat.com> PR lto/96680 gcc/ * lto-streamer.h (omp_lto_output_declare_variant_alt, omp_lto_input_declare_variant_alt): Declare variant. * symtab.c (symtab_node::get_partitioning_class): Return SYMBOL_DUPLICATE for declare_variant_alt nodes. * passes.c (ipa_write_summaries): Add declare_variant_alt to partition. * lto-cgraph.c (output_refs): Call omp_lto_output_declare_variant_alt on declare_variant_alt nodes. (input_refs): Call omp_lto_input_declare_variant_alt on declare_variant_alt nodes. * lto-streamer-out.c (output_function): Don't call collect_block_tree_leafs if DECL_INITIAL is error_mark_node. (lto_output): Call output_function even for declare_variant_alt nodes. * omp-general.c (omp_lto_output_declare_variant_alt, omp_lto_input_declare_variant_alt): New functions. gcc/lto/ * lto-common.c (lto_fixup_prevailing_decls): Don't use LTO_NO_PREVAIL on TREE_LIST's TREE_PURPOSE. * lto-partition.c (lto_balanced_map): Treat declare_variant_alt nodes like definitions. libgomp/ * testsuite/libgomp.c/declare-variant-1.c: New test.
2020-10-24Daily bump.GCC Administrator1-0/+5
2020-10-23Move thunks out of cgraph_nodeJan Hubicka1-1/+1
this patch moves thunk_info out of cgraph_node into a symbol summary. I also moved it to separate hearder file since cgraph.h became really too fat. I plan to contiue with similar breakup in order to cleanup interfaces and reduce WPA memory footprint (symbol table now consumes more memory than trees) gcc/ChangeLog: 2020-10-23 Jan Hubicka <hubicka@ucw.cz> * Makefile.in: Add symtab-thunks.o (GTFILES): Add symtab-thunks.h and symtab-thunks.cc; remove cgraphunit.c * cgraph.c: Include symtab-thunks.h. (cgraph_node::create_thunk): Update (symbol_table::create_edge): Update (cgraph_node::dump): Update (cgraph_node::call_for_symbol_thunks_and_aliases): Update (set_nothrow_flag_1): Update (set_malloc_flag_1): Update (set_const_flag_1): Update (collect_callers_of_node_1): Update (clone_of_p): Update (cgraph_node::verify_node): Update (cgraph_node::function_symbol): Update (cgraph_c_finalize): Call thunk_info::release. (cgraph_node::has_thunk_p): Update (cgraph_node::former_thunk_p): Move here from cgraph.h; reimplement. * cgraph.h (struct cgraph_thunk_info): Rename to symtab-thunks.h. (cgraph_node): Remove thunk field; add thunk bitfield. (cgraph_node::expand_thunk): Move to symtab-thunks.h (symtab_thunks_cc_finalize): Declare. (cgraph_node::has_gimple_body_p): Update. (cgraph_node::former_thunk_p): Update. * cgraphclones.c: Include symtab-thunks.h. (duplicate_thunk_for_node): Update. (cgraph_edge::redirect_callee_duplicating_thunks): Update. (cgraph_node::expand_all_artificial_thunks): Update. (cgraph_node::create_edge_including_clones): Update. * cgraphunit.c: Include symtab-thunks.h. (vtable_entry_type): Move to symtab-thunks.c. (cgraph_node::analyze): Update. (analyze_functions): Update. (mark_functions_to_output): Update. (thunk_adjust): Move to symtab-thunks.c (cgraph_node::expand_thunk): Move to symtab-thunks.c (cgraph_node::assemble_thunks_and_aliases): Update. (output_in_order): Update. (cgraphunit_c_finalize): Do not clear vtable_entry_type. (cgraph_node::create_wrapper): Update. * gengtype.c (open_base_files): Add symtab-thunks.h * ipa-comdats.c (propagate_comdat_group): UPdate. (ipa_comdats): Update. * ipa-cp.c (determine_versionability): UPdate. (gather_caller_stats): Update. (count_callers): Update (set_single_call_flag): Update (initialize_node_lattices): Update (call_passes_through_thunk_p): Update (call_passes_through_thunk): Update (propagate_constants_across_call): Update (find_more_scalar_values_for_callers_subset): Update (has_undead_caller_from_outside_scc_p): Update * ipa-fnsummary.c (evaluate_properties_for_edge): Update. (compute_fn_summary): Update. (inline_analyze_function): Update. * ipa-icf.c: Include symtab-thunks.h. (sem_function::equals_wpa): Update. (redirect_all_callers): Update. (sem_function::init): Update. (sem_function::parse): Update. * ipa-inline-transform.c: Include symtab-thunks.h. (inline_call): Update. (save_inline_function_body): Update. (preserve_function_body_p): Update. * ipa-inline.c (inline_small_functions): Update. * ipa-polymorphic-call.c: Include alloc-pool.h, symbol-summary.h, symtab-thunks.h (ipa_polymorphic_call_context::ipa_polymorphic_call_context): Update. * ipa-pure-const.c: Include symtab-thunks.h. (analyze_function): Update. * ipa-sra.c (check_for_caller_issues): Update. * ipa-utils.c (ipa_reverse_postorder): Update. (ipa_merge_profiles): Update. * ipa-visibility.c (non_local_p): Update. (cgraph_node::local_p): Update. (function_and_variable_visibility): Update. * ipa.c (symbol_table::remove_unreachable_nodes): Update. * lto-cgraph.c: Include alloc-pool.h, symbol-summary.h and symtab-thunks.h (lto_output_edge): Update. (lto_output_node): Update. (compute_ltrans_boundary): Update. (output_symtab): Update. (verify_node_partition): Update. (input_overwrite_node): Update. (input_node): Update. * lto-streamer-in.c (fixup_call_stmt_edges): Update. * symtab-thunks.cc: New file. * symtab-thunks.h: New file. * toplev.c (toplev::finalize): Call symtab_thunks_cc_finalize. * trans-mem.c (ipa_tm_mayenterirr_function): Update. (ipa_tm_execute): Update. * tree-inline.c (expand_call_inline): Update. * tree-nested.c (create_nesting_tree): Update. (convert_all_function_calls): Update. (gimplify_all_functions): Update. * tree-profile.c (tree_profiling): Update. * tree-ssa-structalias.c (associate_varinfo_to_alias): Update. * tree.c (free_lang_data_in_decl): Update. * value-prof.c (init_node_map): Update. gcc/c-family/ChangeLog: 2020-10-23 Jan Hubicka <hubicka@ucw.cz> * c-common.c (c_common_finalize_early_debug): Update for new thunk api. gcc/d/ChangeLog: 2020-10-23 Jan Hubicka <hubicka@ucw.cz> * decl.cc (finish_thunk): Update for new thunk api. gcc/lto/ChangeLog: 2020-10-23 Jan Hubicka <hubicka@ucw.cz> * lto-partition.c (add_symbol_to_partition_1): Update for new thunk api.
2020-08-28Daily bump.GCC Administrator1-0/+5
2020-08-27vec: add exact argument for various grow functions.Martin Liska1-1/+1
gcc/ada/ChangeLog: * gcc-interface/trans.c (gigi): Set exact argument of a vector growth function to true. (Attribute_to_gnu): Likewise. gcc/ChangeLog: * alias.c (init_alias_analysis): Set exact argument of a vector growth function to true. * calls.c (internal_arg_pointer_based_exp_scan): Likewise. * cfgbuild.c (find_many_sub_basic_blocks): Likewise. * cfgexpand.c (expand_asm_stmt): Likewise. * cfgrtl.c (rtl_create_basic_block): Likewise. * combine.c (combine_split_insns): Likewise. (combine_instructions): Likewise. * config/aarch64/aarch64-sve-builtins.cc (function_expander::add_output_operand): Likewise. (function_expander::add_input_operand): Likewise. (function_expander::add_integer_operand): Likewise. (function_expander::add_address_operand): Likewise. (function_expander::add_fixed_operand): Likewise. * df-core.c (df_worklist_dataflow_doublequeue): Likewise. * dwarf2cfi.c (update_row_reg_save): Likewise. * early-remat.c (early_remat::init_block_info): Likewise. (early_remat::finalize_candidate_indices): Likewise. * except.c (sjlj_build_landing_pads): Likewise. * final.c (compute_alignments): Likewise. (grow_label_align): Likewise. * function.c (temp_slots_at_level): Likewise. * fwprop.c (build_single_def_use_links): Likewise. (update_uses): Likewise. * gcc.c (insert_wrapper): Likewise. * genautomata.c (create_state_ainsn_table): Likewise. (add_vect): Likewise. (output_dead_lock_vect): Likewise. * genmatch.c (capture_info::capture_info): Likewise. (parser::finish_match_operand): Likewise. * genrecog.c (optimize_subroutine_group): Likewise. (merge_pattern_info::merge_pattern_info): Likewise. (merge_into_decision): Likewise. (print_subroutine_start): Likewise. (main): Likewise. * gimple-loop-versioning.cc (loop_versioning::loop_versioning): Likewise. * gimple.c (gimple_set_bb): Likewise. * graphite-isl-ast-to-gimple.c (translate_isl_ast_node_user): Likewise. * haifa-sched.c (sched_extend_luids): Likewise. (extend_h_i_d): Likewise. * insn-addr.h (insn_addresses_new): Likewise. * ipa-cp.c (gather_context_independent_values): Likewise. (find_more_contexts_for_caller_subset): Likewise. * ipa-devirt.c (final_warning_record::grow_type_warnings): Likewise. (ipa_odr_read_section): Likewise. * ipa-fnsummary.c (evaluate_properties_for_edge): Likewise. (ipa_fn_summary_t::duplicate): Likewise. (analyze_function_body): Likewise. (ipa_merge_fn_summary_after_inlining): Likewise. (read_ipa_call_summary): Likewise. * ipa-icf.c (sem_function::bb_dict_test): Likewise. * ipa-prop.c (ipa_alloc_node_params): Likewise. (parm_bb_aa_status_for_bb): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_analyze_node): Likewise. (update_jump_functions_after_inlining): Likewise. (ipa_read_edge_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_transform_function): Likewise. * ipa-reference.c (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (execute_split_functions): Likewise. * ira.c (find_moveable_pseudos): Likewise. * lower-subreg.c (decompose_multiword_subregs): Likewise. * lto-streamer-in.c (input_eh_regions): Likewise. (input_cfg): Likewise. (input_struct_function_base): Likewise. (input_function): Likewise. * modulo-sched.c (set_node_sched_params): Likewise. (extend_node_sched_params): Likewise. (schedule_reg_moves): Likewise. * omp-general.c (omp_construct_simd_compare): Likewise. * passes.c (pass_manager::create_pass_tab): Likewise. (enable_disable_pass): Likewise. * predict.c (determine_unlikely_bbs): Likewise. * profile.c (compute_branch_probabilities): Likewise. * read-rtl-function.c (function_reader::parse_block): Likewise. * read-rtl.c (rtx_reader::read_rtx_code): Likewise. * reg-stack.c (stack_regs_mentioned): Likewise. * regrename.c (regrename_init): Likewise. * rtlanal.c (T>::add_single_to_queue): Likewise. * sched-deps.c (init_deps_data_vector): Likewise. * sel-sched-ir.c (sel_extend_global_bb_info): Likewise. (extend_region_bb_info): Likewise. (extend_insn_data): Likewise. * symtab.c (symtab_node::create_reference): Likewise. * tracer.c (tail_duplicate): Likewise. * trans-mem.c (tm_region_init): Likewise. (get_bb_regions_instrumented): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. (build_gimple_cfg): Likewise. (create_bb): Likewise. (move_block_to_fn): Likewise. * tree-complex.c (tree_lower_complex): Likewise. * tree-if-conv.c (predicate_rhs_code): Likewise. * tree-inline.c (copy_bb): Likewise. * tree-into-ssa.c (get_ssa_name_ann): Likewise. (mark_phi_for_rewrite): Likewise. * tree-object-size.c (compute_builtin_object_size): Likewise. (init_object_sizes): Likewise. * tree-predcom.c (initialize_root_vars_store_elim_1): Likewise. (initialize_root_vars_store_elim_2): Likewise. (prepare_initializers_chain_store_elim): Likewise. * tree-ssa-address.c (addr_for_mem_ref): Likewise. (multiplier_allowed_in_address_p): Likewise. * tree-ssa-coalesce.c (ssa_conflicts_new): Likewise. * tree-ssa-forwprop.c (simplify_vector_constructor): Likewise. * tree-ssa-loop-ivopts.c (addr_offset_valid_p): Likewise. (get_address_cost_ainc): Likewise. * tree-ssa-loop-niter.c (discover_iteration_bound_by_body_walk): Likewise. * tree-ssa-pre.c (add_to_value): Likewise. (phi_translate_1): Likewise. (do_pre_regular_insertion): Likewise. (do_pre_partial_partial_insertion): Likewise. (init_pre): Likewise. * tree-ssa-propagate.c (ssa_prop_init): Likewise. (update_call_from_tree): Likewise. * tree-ssa-reassoc.c (optimize_range_tests_cmp_bitwise): Likewise. * tree-ssa-sccvn.c (vn_reference_lookup_3): Likewise. (vn_reference_lookup_pieces): Likewise. (eliminate_dom_walker::eliminate_push_avail): Likewise. * tree-ssa-strlen.c (set_strinfo): Likewise. (get_stridx_plus_constant): Likewise. (zero_length_string): Likewise. (find_equal_ptrs): Likewise. (printf_strlen_execute): Likewise. * tree-ssa-threadedge.c (set_ssa_name_value): Likewise. * tree-ssanames.c (make_ssa_name_fn): Likewise. * tree-streamer-in.c (streamer_read_tree_bitfields): Likewise. * tree-vect-loop.c (vect_record_loop_mask): Likewise. (vect_get_loop_mask): Likewise. (vect_record_loop_len): Likewise. (vect_get_loop_len): Likewise. * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): Likewise. * tree-vect-slp.c (vect_slp_convert_to_external): Likewise. (vect_bb_slp_scalar_cost): Likewise. (vect_bb_vectorization_profitable_p): Likewise. (vectorizable_slp_permutation): Likewise. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call): Likewise. (scan_store_can_perm_p): Likewise. (vectorizable_store): Likewise. * expr.c: Likewise. * vec.c (test_safe_grow_cleared): Likewise. * vec.h (vec_safe_grow): Likewise. (vec_safe_grow_cleared): Likewise. (vl_ptr>::safe_grow): Likewise. (vl_ptr>::safe_grow_cleared): Likewise. * config/c6x/c6x.c (insn_set_clock): Likewise. gcc/c/ChangeLog: * gimple-parser.c (c_parser_gimple_compound_statement): Set exact argument of a vector growth function to true. gcc/cp/ChangeLog: * class.c (build_vtbl_initializer): Set exact argument of a vector growth function to true. * constraint.cc (get_mapped_args): Likewise. * decl.c (cp_maybe_mangle_decomp): Likewise. (cp_finish_decomp): Likewise. * parser.c (cp_parser_omp_for_loop): Likewise. * pt.c (canonical_type_parameter): Likewise. * rtti.c (get_pseudo_ti_init): Likewise. gcc/fortran/ChangeLog: * trans-openmp.c (gfc_trans_omp_do): Set exact argument of a vector growth function to true. gcc/lto/ChangeLog: * lto-common.c (lto_file_finalize): Set exact argument of a vector growth function to true.
2020-06-04Daily bump.GCC Administrator1-0/+4
2020-06-03Optimize ODR enum streamingJan Hubicka1-3/+1
it turns out that half of the global decl stream of cc1 LTO build consits TREE_LISTS, identifiers and integer cosntats representing TYPE_VALUES of enums. Those are streamed only to produce ODR warning and used otherwise, so this patch moves the info to a separate section that is represented and streamed more effectively. This also adds place for more info that may be used for ODR diagnostics (i.e. at the moment we do not warn when the declarations differs i.e. by the associated member functions and their types) and the type inheritance graph rather then poluting the global stream. I was bit unsure what enums we want to store into the section. All parsed enums is probably too expensive, only those enums streamed to represent IL is bit hard to get, so I went for those seen by free lang data. As a plus we now get bit more precise warning because also the location of mismatched enum CONST_DECL is streamed. It changes: [WPA] read 4608466 unshared trees [WPA] read 2942094 mergeable SCCs of average size 1.365328 [WPA] 8625389 tree bodies read in total [WPA] tree SCC table: size 524287, 247652 elements, collision ratio: 0.383702 [WPA] tree SCC max chain length 2 (size 1) [WPA] Compared 2694442 SCCs, 228 collisions (0.000085) [WPA] Merged 2694419 SCCs [WPA] Merged 3731982 tree bodies [WPA] Merged 633335 types [WPA] 122077 types prevailed (155548 associated trees) ... [WPA] Compression: 110593119 input bytes, 287696614 uncompressed bytes (ratio: 2.601397) [WPA] Size of mmap'd section decls: 85628556 bytes [WPA] Size of mmap'd section function_body: 13842928 bytes [WPA] read 1720989 unshared trees [WPA] read 1252217 mergeable SCCs of average size 1.858507 [WPA] 4048243 tree bodies read in total [WPA] tree SCC table: size 524287, 226524 elements, collision ratio: 0.491759 [WPA] tree SCC max chain length 2 (size 1) [WPA] Compared 1025693 SCCs, 196 collisions (0.000191) [WPA] Merged 1025670 SCCs [WPA] Merged 2063373 tree bodies [WPA] Merged 633497 types [WPA] 122299 types prevailed (155827 associated trees) ... [WPA] Compression: 103428770 input bytes, 281151423 uncompressed bytes (ratio: 2.718310) [WPA] Size of mmap'd section decls: 49390917 bytes [WPA] Size of mmap'd section function_body: 13858258 bytes ... [WPA] Size of mmap'd section odr_types: 29054816 bytes So number of SCCs streamed drops to 38% and the number of unshared trees (that are bit misnamed since it is mostly integer_cst) to 37%. Things speeds up correspondingly, but I did not save time report from previous build. The enum values are still quite surprisingly large. I may take a look into ways getting it smaller incrementally, but it streams reasonably fast: Time variable usr sys wall GGC phase opt and generate : 25.20 ( 68%) 10.88 ( 72%) 36.13 ( 69%) 868060 kB ( 52%) phase stream in : 4.46 ( 12%) 0.90 ( 6%) 5.38 ( 10%) 790724 kB ( 48%) phase stream out : 6.69 ( 18%) 3.32 ( 22%) 10.03 ( 19%) 8 kB ( 0%) ipa lto gimple in : 0.79 ( 2%) 1.86 ( 12%) 2.39 ( 5%) 252612 kB ( 15%) ipa lto gimple out : 2.48 ( 7%) 0.78 ( 5%) 3.26 ( 6%) 0 kB ( 0%) ipa lto decl in : 1.71 ( 5%) 0.46 ( 3%) 2.34 ( 4%) 417883 kB ( 25%) ipa lto decl out : 3.28 ( 9%) 0.07 ( 0%) 3.27 ( 6%) 0 kB ( 0%) whopr wpa I/O : 0.40 ( 1%) 2.24 ( 15%) 2.77 ( 5%) 8 kB ( 0%) lto stream decompression : 1.38 ( 4%) 0.31 ( 2%) 1.36 ( 3%) 0 kB ( 0%) ipa ODR types : 0.18 ( 0%) 0.02 ( 0%) 0.25 ( 0%) 0 kB ( 0%) ipa inlining heuristics : 11.64 ( 31%) 1.45 ( 10%) 13.12 ( 25%) 453160 kB ( 27%) ipa pure const : 1.74 ( 5%) 0.00 ( 0%) 1.76 ( 3%) 0 kB ( 0%) ipa icf : 1.72 ( 5%) 5.33 ( 35%) 7.06 ( 13%) 16593 kB ( 1%) whopr partitioning : 2.22 ( 6%) 0.01 ( 0%) 2.23 ( 4%) 5689 kB ( 0%) TOTAL : 37.17 15.20 52.46 1660886 kB LTO-bootstrapped/regtested x86_64-linux, will comit it shortly. gcc/ChangeLog: 2020-06-03 Jan Hubicka <hubicka@ucw.cz> * ipa-devirt.c: Include data-streamer.h, lto-streamer.h and streamer-hooks.h. (odr_enums): New static var. (struct odr_enum_val): New struct. (class odr_enum): New struct. (odr_enum_map): New hashtable. (odr_types_equivalent_p): Drop code testing TYPE_VALUES. (add_type_duplicate): Likewise. (free_odr_warning_data): Do not free TYPE_VALUES. (register_odr_enum): New function. (ipa_odr_summary_write): New function. (ipa_odr_read_section): New function. (ipa_odr_summary_read): New function. (class pass_ipa_odr): New pass. (make_pass_ipa_odr): New function. * ipa-utils.h (register_odr_enum): Declare. * lto-section-in.c: (lto_section_name): Add odr_types section. * lto-streamer.h (enum lto_section_type): Add odr_types section. * passes.def: Add odr_types pass. * lto-streamer-out.c (DFS::DFS_write_tree_body): Do not stream TYPE_VALUES. (hash_tree): Likewise. * tree-streamer-in.c (lto_input_ts_type_non_common_tree_pointers): Likewise. * tree-streamer-out.c (write_ts_type_non_common_tree_pointers): Likewise. * timevar.def (TV_IPA_ODR): New timervar. * tree-pass.h (make_pass_ipa_odr): Declare. * tree.c (free_lang_data_in_type): Regiser ODR types. gcc/lto/ChangeLog: 2020-06-03 Jan Hubicka <hubicka@ucw.cz> * lto-common.c (compare_tree_sccs_1): Do not compare TYPE_VALUES. gcc/testsuite/ChangeLog: 2020-06-03 Jan Hubicka <hubicka@ucw.cz> * g++.dg/lto/pr84805_0.C: Update.
2020-05-22Avoid streaming stray references.Jan Hubicka2-17/+15
this patch avoids stremaing completely useless stray references to gobal decl stream. I am re-testing the patch (rebased to current tree) on x86_64-linux and intend to commit once testing finishes. gcc/ChangeLog: 2020-05-22 Jan Hubicka <hubicka@ucw.cz> * lto-streamer-out.c (lto_output_tree): Do not stream final ref if it is not needed. gcc/lto/ChangeLog: 2020-05-22 Jan Hubicka <hubicka@ucw.cz> * lto-common.c (lto_read_decls): Do not skip stray refs.
2020-05-20Avoid SCC hashing on unmergeable treesJan Hubicka2-96/+154
This is new incarantion of patch to identify unmergeable tree at streaming out time rather than streaming in and to avoid pickling them to sccs with with hash codes. Building cc1 plus this patch reduces: [WPA] read 4452927 SCCs of average size 1.986030 [WPA] 8843646 tree bodies read in total [WPA] tree SCC table: size 524287, 205158 elements, collision ratio: 0.505204 [WPA] tree SCC max chain length 43 (size 1) [WPA] Compared 947551 SCCs, 780270 collisions (0.823460) [WPA] Merged 944038 SCCs [WPA] Merged 5253521 tree bodies [WPA] Merged 590027 types ... [WPA] Size of mmap'd section decls: 99229066 bytes [WPA] Size of mmap'd section function_body: 18398837 bytes [WPA] Size of mmap'd section refs: 733678 bytes [WPA] Size of mmap'd section jmpfuncs: 2965981 bytes [WPA] Size of mmap'd section pureconst: 170248 bytes [WPA] Size of mmap'd section profile: 17985 bytes [WPA] Size of mmap'd section symbol_nodes: 3392736 bytes [WPA] Size of mmap'd section inline: 2693920 bytes [WPA] Size of mmap'd section icf: 435557 bytes [WPA] Size of mmap'd section offload_table: 0 bytes [WPA] Size of mmap'd section lto: 4320 bytes [WPA] Size of mmap'd section ipa_sra: 651660 bytes ... to ... [WPA] read 3312246 unshared trees [WPA] read 1144381 mergeable SCCs of average size 4.833785 [WPA] 8843938 tree bodies read in total [WPA] tree SCC table: size 524287, 197767 elements, collision ratio: 0.506446 [WPA] tree SCC max chain length 43 (size 1) [WPA] Compared 946614 SCCs, 775077 collisions (0.818789) [WPA] Merged 943798 SCCs [WPA] Merged 5253336 tree bodies [WPA] Merged 590105 types .... [WPA] Size of mmap'd section decls: 81262144 bytes [WPA] Size of mmap'd section function_body: 14702611 bytes [WPA] Size of mmap'd section ext_symtab: 0 bytes [WPA] Size of mmap'd section refs: 733695 bytes [WPA] Size of mmap'd section jmpfuncs: 2332150 bytes [WPA] Size of mmap'd section pureconst: 170292 bytes [WPA] Size of mmap'd section profile: 17986 bytes [WPA] Size of mmap'd section symbol_nodes: 3393358 bytes [WPA] Size of mmap'd section inline: 2567939 bytes [WPA] Size of mmap'd section icf: 435633 bytes [WPA] Size of mmap'd section lto: 4320 bytes [WPA] Size of mmap'd section ipa_sra: 651824 bytes so results in about 22% reduction in global decl stream and 24% reduction on function bodies stream (which is read mostly by ICF) Martin, the zstd compression breaks the compression statistics (it works when GCC is configured for zlib) At first ltrans I get: [LTRANS] Size of mmap'd section decls: 3734248 bytes [LTRANS] Size of mmap'd section function_body: 4895962 bytes ... to ... [LTRANS] Size of mmap'd section decls: 3479850 bytes [LTRANS] Size of mmap'd section function_body: 3722935 bytes So 7% reduction of global stream and 31% reduction of function bodies. Stream in seems to get about 3% faster and stream out about 5% but it is close to noise factor of my experiment. I expect bigger speedups on Firefox but I did not test it today since my Firefox setup broke again. GCC is not very good example on the problem with anonymous namespace types since we do not have so many of them. Sice of object files in gcc directory is reduced by 11% (because hash numbers do not compress well I guess). The patch makes DFS walk to recognize trees that are not merged (anonymous namespace, local function/variable decls, anonymous types etc). As discussed on IRC this is now done during the SCC walk rather than during the hash computation. When local tree is discovered we know that SCC components of everything that is on the stack reffers to it and thus is also local. Moreover we mark trees into hash set in output block so if we get a cross edge referring to local tree it gets marked too. Patch also takes care of avoiding SCC wrappers around some trees. In particular 1) singleton unmergeable SCCs are now streamed inline in global decl stream This includes INTEGER_CSTs and IDENTIFIER_NODEs that are shared by different code than rest of tree merging. 2) We use LTO_trees instead of LTO_tree_scc to wrap unmergeable SCC components. It is still necessary to mark them because of forward references. LTO_trees has simple header with number of trees and then things are streamed same way as for LTO_tree_scc. That is tree headers first followed by pickled references so things may point to future. Of course it is not necessary for LTO_tree_scc to be single component and streamer out may group more components together, but I decided to not snowball the patch even more 3) In local streams when lto_output_tree is called and the topmost SCC components turns out to be singleton we stream the tree directly instead of LTO_tree_scc, hash code, pickled tree, reference to just stremaed tree. LTO_trees is used to wrap all trees needed to represent tree being streamed. It would make sense again to use only one LTO_trees rather than one per SCC but I think this can be done incrementally. In general local trees are now recognized by new predicate local_tree_p Bit subtle is handing of TRANLSATION_UNIT_DECL, INTEGER_CST and IDENTIFIER_NODE. TRANSLATION_UNIT_DECL a local tree but references to it does not make other trees local (because we also understand local decls now). So I check for it later after localness propagation is done. INTEGER_CST and IDENTIFIER_NODEs are merged but not via the tree merging machinery. So it makes sense to stream them as unmergeable trees but we still need to compute their hashes so SCCs referring them do not get too large collision chains. For this reason they are checked just prior stream out. lto-bootstrapped/regteted x86_64-linux, OK? gcc/ChangeLog: 2020-05-19 Jan Hubicka <hubicka@ucw.cz> * lto-streamer-in.c (lto_input_scc): Add SHARED_SCC parameter. (lto_input_tree_1): Strenghten sanity check. (lto_input_tree): Update call of lto_input_scc. * lto-streamer-out.c: Include ipa-utils.h (create_output_block): Initialize local_trees if merigng is going to happen. (destroy_output_block): Destroy local_trees. (DFS): Add max_local_entry. (local_tree_p): New function. (DFS::DFS): Initialize and maintain it. (DFS::DFS_write_tree): Decide on streaming format. (lto_output_tree): Stream inline singleton SCCs * lto-streamer.h (enum LTO_tags): Add LTO_trees. (struct output_block): Add local_trees. (lto_input_scc): Update prototype. gcc/lto/ChangeLog: 2020-05-19 Jan Hubicka <hubicka@ucw.cz> * lto-common.c (compare_tree_sccs_1): Sanity check that we never read TRANSLATION_UNIT_DECL. (process_dref): Break out from ... (unify_scc): ... here. (process_new_tree): Break out from ... (lto_read_decls): ... here; handle streaming of singleton trees. (print_lto_report_1): Update statistics.
2020-05-07extend DECL_GIMPLE_REG_P to all typesRichard Biener2-1/+7
This extends DECL_GIMPLE_REG_P to all types so we can clear TREE_ADDRESSABLE even for integers with partial defs, not just complex and vector variables. To make that transition easier the patch inverts DECL_GIMPLE_REG_P to DECL_NOT_GIMPLE_REG_P since that makes the default the current state for all other types besides complex and vectors. For the testcase in PR94703 we're able to expand the partial def'ed local integer to a register then, producing a single movl rather than going through the stack. On i?86 this execute FAILs gcc.dg/torture/pr71522.c because we now expand a round-trip through a long double automatic var to a register fld/fst which normalizes the value. For that during RTL expansion we're looking for problematic punnings of decls and avoid pseudos for those - I chose integer or BLKmode accesses on decls with modes where precision doesn't match bitsize which covers the XFmode case. 2020-05-07 Richard Biener <rguenther@suse.de> PR middle-end/94703 * tree-core.h (tree_decl_common::gimple_reg_flag): Rename ... (tree_decl_common::not_gimple_reg_flag): ... to this. * tree.h (DECL_GIMPLE_REG_P): Rename ... (DECL_NOT_GIMPLE_REG_P): ... to this. * gimple-expr.c (copy_var_decl): Copy DECL_NOT_GIMPLE_REG_P. (create_tmp_reg): Simplify. (create_tmp_reg_fn): Likewise. (is_gimple_reg): Check DECL_NOT_GIMPLE_REG_P for all regs. * gimplify.c (create_tmp_from_val): Simplify. (gimplify_bind_expr): Likewise. (gimplify_compound_literal_expr): Likewise. (gimplify_function_tree): Likewise. (prepare_gimple_addressable): Set DECL_NOT_GIMPLE_REG_P. * asan.c (create_odr_indicator): Do not clear DECL_GIMPLE_REG_P. (asan_add_global): Copy it. * cgraphunit.c (cgraph_node::expand_thunk): Force args to be GIMPLE regs. * function.c (gimplify_parameters): Copy DECL_NOT_GIMPLE_REG_P. * ipa-param-manipulation.c (ipa_param_body_adjustments::common_initialization): Simplify. (ipa_param_body_adjustments::reset_debug_stmts): Copy DECL_NOT_GIMPLE_REG_P. * omp-low.c (lower_omp_for_scan): Do not set DECL_GIMPLE_REG_P. * sanopt.c (sanitize_rewrite_addressable_params): Likewise. * tree-cfg.c (make_blocks_1): Simplify. (verify_address): Do not verify DECL_GIMPLE_REG_P setting. * tree-eh.c (lower_eh_constructs_2): Simplify. * tree-inline.c (declare_return_variable): Adjust and generalize. (copy_decl_to_var): Copy DECL_NOT_GIMPLE_REG_P. (copy_result_decl_to_var): Likewise. * tree-into-ssa.c (pass_build_ssa::execute): Adjust comment. * tree-nested.c (create_tmp_var_for): Simplify. * tree-parloops.c (separate_decls_in_region_name): Copy DECL_NOT_GIMPLE_REG_P. * tree-sra.c (create_access_replacement): Adjust and generalize partial def support. * tree-ssa-forwprop.c (pass_forwprop::execute): Set DECL_NOT_GIMPLE_REG_P on decls we introduce partial defs on. * tree-ssa.c (maybe_optimize_var): Handle clearing of TREE_ADDRESSABLE and setting/clearing DECL_NOT_GIMPLE_REG_P independently. * lto-streamer-out.c (hash_tree): Hash DECL_NOT_GIMPLE_REG_P. * tree-streamer-out.c (pack_ts_decl_common_value_fields): Stream DECL_NOT_GIMPLE_REG_P. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise. * cfgexpand.c (avoid_type_punning_on_regs): New. (discover_nonconstant_array_refs): Call avoid_type_punning_on_regs to avoid unsupported mode punning. lto/ * lto-common.c (compare_tree_sccs_1): Compare DECL_NOT_GIMPLE_REG_P. c/ * gimple-parser.c (c_parser_parse_ssa_name): Do not set DECL_GIMPLE_REG_P. cp/ * optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P. * gcc.dg/tree-ssa/pr94703.c: New testcase.
2020-04-29c++, middle-end, rs6000: Fix C++17 ABI incompatibilities during class layout ↵Jakub Jelinek2-0/+6
and [[no_unique_address]] handling [PR94707] As reported by Iain and David, powerpc-darwin and powerpc-aix* have C++14 vs. C++17 ABI incompatibilities which are not fixed by mere adding of cxx17_empty_base_field_p calls. Unlike the issues that were seen on other targets where the artificial empty base field affected function argument passing or returning of values, on these two targets the difference is during class layout, not afterwards (e.g. struct empty_base {}; struct S : public empty_base { unsigned long long l[2]; }; will have different __alignof__ (S) between C++14 and C++17 (or possibly with double instead of unsigned long long too)). I've tried: struct X { }; struct Y { int : 0; }; struct Z { int : 0; Y y; }; struct U : public X { X q; }; struct A { float a, b, c, d; }; struct B : public X { float a, b, c, d; }; struct C : public Y { float a, b, c, d; }; struct D : public Z { float a, b, c, d; }; struct E : public U { float a, b, c, d; }; struct F { [[no_unique_address]] X x; float a, b, c, d; }; struct G { [[no_unique_address]] Y y; float a, b, c, d; }; struct H { [[no_unique_address]] Z z; float a, b, c, d; }; struct I { [[no_unique_address]] U u; float a, b, c, d; }; struct J { float a, b; [[no_unique_address]] X x; float c, d; }; struct K { float a, b; [[no_unique_address]] Y y; float c, d; }; struct L { float a, b; [[no_unique_address]] Z z; float c, d; }; struct M { float a, b; [[no_unique_address]] U u; float c, d; }; #define T(S, s) extern S s; extern void foo##s (S); int bar##s () { foo##s (s); return 0; } T (A, a) T (B, b) T (C, c) T (D, d) T (E, e) T (F, f) T (G, g) T (H, h) T (I, i) T (J, j) T (K, k) T (L, l) T (M, m) testcase on powerpc64-linux. Results: G++ 9 -std=c++14 A, B, C passed in fprs, the rest in gprs G++ 9 -std=c++17 A passed in fprs, the rest in gprs current trunk -std=c++14 & 17 A, B, C passed in fprs, the rest in gprs patched trunk -std=c++14 & 17 A, B, C, F, G, J, K passed in fprs, the rest in gprs clang++ [*] -std=c++14 & 17 A, B, C, F, G, J, K passed in fprs, the rest in gprs [*] clang version 11.0.0 (git@github.com:llvm/llvm-project.git 5c352e69e76a26e4eda075e20aa6a9bb7686042c) Is that what we want? I think it matches the stated intent of P0840R2 or what Jason/Jonathan said, and doing something different like e.g. not treating C, G and K as homogenous because of the int : 0 in empty bases or in zero sized [[no_unique_address] fields would be quite hard to implement (because for C++14 the FIELD_DECL just isn't there). 2020-04-29 Jakub Jelinek <jakub@redhat.com> PR target/94707 * tree-core.h (tree_decl_common): Note decl_flag_0 used for DECL_FIELD_ABI_IGNORED. * tree.h (DECL_FIELD_ABI_IGNORED): Define. * calls.h (cxx17_empty_base_field_p): Change into a temporary macro, check DECL_FIELD_ABI_IGNORED flag with no "no_unique_address" attribute. * calls.c (cxx17_empty_base_field_p): Remove. * tree-streamer-out.c (pack_ts_decl_common_value_fields): Handle DECL_FIELD_ABI_IGNORED. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise. * lto-streamer-out.c (hash_tree): Likewise. * config/rs6000/rs6000-call.c (rs6000_aggregate_candidate): Rename cxx17_empty_base_seen to empty_base_seen, change type to int *, adjust recursive calls, use DECL_FIELD_ABI_IGNORED instead of cxx17_empty_base_field_p, if "no_unique_address" attribute is present, propagate that to the caller too. (rs6000_discover_homogeneous_aggregate): Adjust rs6000_aggregate_candidate caller, emit different diagnostics when c++17 empty base fields are present and when empty [[no_unique_address]] fields are present. * config/rs6000/rs6000.c (rs6000_special_round_type_align, darwin_rs6000_special_round_type_align): Skip DECL_FIELD_ABI_IGNORED fields. * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty base artificial FIELD_DECLs. (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class field_poverlapping_p FIELD_DECLs. * lto-common.c (compare_tree_sccs_1): Handle DECL_FIELD_ABI_IGNORED. * g++.target/powerpc/pr94707-1.C: New test. * g++.target/powerpc/pr94707-2.C: New test. * g++.target/powerpc/pr94707-3.C: New test. * g++.target/powerpc/pr94707-4.C: New test. * g++.target/powerpc/pr94707-5.C: New test. * g++.target/powerpc/pr94707-4.C: New test.
2020-04-17Initialize file_data->lto_section_header before lto_mode_identity_table call.Martin Liska2-5/+13
PR lto/94612 * lto-common.c: Initialize file_data->lto_section_header before lto_mode_identity_table call. It is needed because it decompresses a LTO section.
2020-04-08Allow new/delete operator deletion only for replaceable.Martin Liska2-0/+7
PR c++/94314 * gimple.c (gimple_call_operator_delete_p): Rename to... (gimple_call_replaceable_operator_delete_p): ... this. Use DECL_IS_REPLACEABLE_OPERATOR_DELETE_P. * gimple.h (gimple_call_operator_delete_p): Rename to ... (gimple_call_replaceable_operator_delete_p): ... this. * tree-core.h (tree_function_decl): Add replaceable_operator flag. * tree-ssa-dce.c (mark_all_reaching_defs_necessary_1): Use DECL_IS_REPLACEABLE_OPERATOR_DELETE_P. (propagate_necessity): Use gimple_call_replaceable_operator_delete_p. (eliminate_unnecessary_stmts): Likewise. * tree-streamer-in.c (unpack_ts_function_decl_value_fields): Pack DECL_IS_REPLACEABLE_OPERATOR. * tree-streamer-out.c (pack_ts_function_decl_value_fields): Unpack the field here. * tree.h (DECL_IS_REPLACEABLE_OPERATOR): New. (DECL_IS_REPLACEABLE_OPERATOR_NEW_P): New. (DECL_IS_REPLACEABLE_OPERATOR_DELETE_P): New. * cgraph.c (cgraph_node::dump): Dump if an operator is replaceable. * ipa-icf.c (sem_item::compare_referenced_symbol_properties): Compare replaceable operator flags. PR c++/94314 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR. (cxx_init_decl_processing): Mark replaceable all implicitly defined operators. PR c++/94314 * lto-common.c (compare_tree_sccs_1): Compare also DECL_IS_REPLACEABLE_OPERATOR. PR c++/94314 * g++.dg/pr94314-2.C: New test. * g++.dg/pr94314-3.C: New test. * g++.dg/pr94314.C: New test.
2020-03-25middle-end: Avoid using DECL_UID in ASM_FORMAT_PRIVATE_NAME [PR94223]Jakub Jelinek2-1/+8
As mentioned in the PR, we don't guarantee DECL_UID to be the same between corresponding decls in -g and -g0 builds, -g can create more decls and all that is guaranteed is that the DECL_UIDs of the corresponding decls compare the same. The following testcase gets a -fcompare-debug failure because these functions use DECL_UID as the number in ASM_FORMAT_PRIVATE_NAME. The patch fixes it by using just a sequential number there instead. I don't think this can be called during PCH writing, this only happens for non-public decls and the C/C++ FEs shouldn't mangling those at that point (furthermore C++ FE uses a different set_decl_assembler_name hook and this one is something only the gimplifier calls on C.NNNN temporaries. 2020-03-25 Jakub Jelinek <jakub@redhat.com> PR c++/94223 * langhooks.c (lhd_set_decl_assembler_name): Use a static ulong counter instead of DECL_UID. * lto-lang.c (lto_set_decl_assembler_name): Use a static ulong counter instead of DECL_UID. * g++.dg/opt/pr94223.C: New test.
2020-03-24Fix OpenMP offload handling for target-link variables for nvptx (PR81689)Tobias Burnus2-0/+6
PR libgomp/81689 * lto.c (offload_handle_link_vars): Propagate TREE_PUBLIC state. PR libgomp/81689 * omp-offload.c (omp_finish_file): Fix target-link handling if targetm_common.have_named_sections is false. PR libgomp/81689 * testsuite/libgomp.c/target-link-1.c: Remove xfail.
2020-03-23lto/lto.c – used $ or . in generated linkptr nameTobias Burnus2-4/+7
* lto.c (offload_handle_link_vars): Reduce chance of naming clashes of generated linkptr variable.
2020-03-23Set proper DECL_ALIGN in offload_handle_link_vars (PR94233)Tobias Burnus2-9/+11
gcc/lto/ PR middle-end/94233 * lto.c (offload_handle_link_vars): Cleanup; call build_decl to ensure alignment is set.
2020-02-05Do not load body for alias symbols.Martin Liska2-10/+19
PR lto/93489 * lto-dump.c (dump_list_functions): Do not load body for aliases. (dump_body): Likewise here.
2020-01-16Fix noreorder symbol partitioning reversion.Martin Liska2-0/+9
* lto-partition.c (lto_balanced_map): Remember best_noreorder_pos and then restore to it when we revert.
2020-01-08Use cgraph_node::dump_{asm_},name where possible.Martin Liska3-7/+16
2020-01-08 Martin Liska <mliska@suse.cz> * cgraph.c (cgraph_node::dump): Use ::dump_name or ::dump_asm_name instead of (::name or ::asm_name). * cgraphclones.c (symbol_table::materialize_all_clones): Likewise. * cgraphunit.c (walk_polymorphic_call_targets): Likewise. (analyze_functions): Likewise. (expand_all_functions): Likewise. * ipa-cp.c (ipcp_cloning_candidate_p): Likewise. (propagate_bits_across_jump_function): Likewise. (dump_profile_updates): Likewise. (ipcp_store_bits_results): Likewise. (ipcp_store_vr_results): Likewise. * ipa-devirt.c (dump_targets): Likewise. * ipa-fnsummary.c (analyze_function_body): Likewise. * ipa-hsa.c (check_warn_node_versionable): Likewise. (process_hsa_functions): Likewise. * ipa-icf.c (sem_item_optimizer::merge_classes): Likewise. (set_alias_uids): Likewise. * ipa-inline-transform.c (save_inline_function_body): Likewise. * ipa-inline.c (recursive_inlining): Likewise. (inline_to_all_callers_1): Likewise. (ipa_inline): Likewise. * ipa-profile.c (ipa_propagate_frequency_1): Likewise. (ipa_propagate_frequency): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. * ipa-pure-const.c (worse_state): Likewise. (check_retval_uses): Likewise. (analyze_function): Likewise. (propagate_pure_const): Likewise. (propagate_nothrow): Likewise. (dump_malloc_lattice): Likewise. (propagate_malloc): Likewise. (pass_local_pure_const::execute): Likewise. * ipa-visibility.c (optimize_weakref): Likewise. (function_and_variable_visibility): Likewise. * ipa.c (symbol_table::remove_unreachable_nodes): Likewise. (ipa_discover_variable_flags): Likewise. * lto-streamer-out.c (output_function): Likewise. (output_constructor): Likewise. * tree-inline.c (copy_bb): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. * varpool.c (symbol_table::remove_unreferenced_decls): Likewise. 2020-01-08 Martin Liska <mliska@suse.cz> * lto-partition.c (add_symbol_to_partition_1): Use ::dump_name or ::dump_asm_name instead of (::name or ::asm_name). (lto_balanced_map): Likewise. (promote_symbol): Likewise. (rename_statics): Likewise. * lto.c (lto_wpa_write_files): Likewise. 2020-01-08 Martin Liska <mliska@suse.cz> * gcc.dg/ipa/ipa-icf-1.c: Update expected scanned output. * gcc.dg/ipa/ipa-icf-10.c: Likewise. * gcc.dg/ipa/ipa-icf-11.c: Likewise. * gcc.dg/ipa/ipa-icf-12.c: Likewise. * gcc.dg/ipa/ipa-icf-13.c: Likewise. * gcc.dg/ipa/ipa-icf-16.c: Likewise. * gcc.dg/ipa/ipa-icf-18.c: Likewise. * gcc.dg/ipa/ipa-icf-2.c: Likewise. * gcc.dg/ipa/ipa-icf-20.c: Likewise. * gcc.dg/ipa/ipa-icf-21.c: Likewise. * gcc.dg/ipa/ipa-icf-23.c: Likewise. * gcc.dg/ipa/ipa-icf-25.c: Likewise. * gcc.dg/ipa/ipa-icf-26.c: Likewise. * gcc.dg/ipa/ipa-icf-27.c: Likewise. * gcc.dg/ipa/ipa-icf-3.c: Likewise. * gcc.dg/ipa/ipa-icf-35.c: Likewise. * gcc.dg/ipa/ipa-icf-36.c: Likewise. * gcc.dg/ipa/ipa-icf-37.c: Likewise. * gcc.dg/ipa/ipa-icf-38.c: Likewise. * gcc.dg/ipa/ipa-icf-5.c: Likewise. * gcc.dg/ipa/ipa-icf-7.c: Likewise. * gcc.dg/ipa/ipa-icf-8.c: Likewise. * gcc.dg/ipa/ipa-icf-merge-1.c: Likewise. * gcc.dg/ipa/pr64307.c: Likewise. * gcc.dg/ipa/pr90555.c: Likewise. * gcc.dg/ipa/propmalloc-1.c: Likewise. * gcc.dg/ipa/propmalloc-2.c: Likewise. * gcc.dg/ipa/propmalloc-3.c: Likewise. From-SVN: r280009
2020-01-08Replace node->name/node->order with node->dump_name.Martin Liska2-2/+6
2020-01-08 Martin Liska <mliska@suse.cz> * ipa-fnsummary.c (dump_ipa_call_summary): Use symtab_node::dump_name. (ipa_call_context::estimate_size_and_time): Likewise. (inline_analyze_function): Likewise. 2020-01-08 Martin Liska <mliska@suse.cz> * lto-partition.c (lto_balanced_map): Use symtab_node::dump_name. From-SVN: r279999
2020-01-01Update copyright years.Jakub Jelinek19-19/+23
From-SVN: r279813
2019-12-19Fix symver attribute with LTOJan Hubicka2-0/+11
* cgraph.c (cgraph_node_cannot_be_local_p_1): Prevent targets of symver attributes to be localized. * ipa-visibility.c (cgraph_externally_visible_p, varpool_node::externally_visible_p): Likewise. * symtab.c (symtab_node::verify_base): Check visibility of symbol versions. * lto-common.c (read_cgraph_and_symbols): Work around binutils PR25424 Co-Authored-By: Xi Ruoyao <xry111@mengyan1223.wang> From-SVN: r279566
2019-12-10Turn tp_first_run counts back to 32bit values.Jan Hubicka2-5/+10
* cgraph.c (cgraph_node::verify_node): Verify tp_first_run. * cgraph.h (cgrpah_node): Turn tp_first_run back to int. * cgraphunit.c (tp_first_run_node_cmp): Do not watch for overflows. (expand_all_functions): First expand ordered section and then unordered. * lto-partition.c (lto_balanced_map): Fix printing of tp_first_run. * profile.c (compute_value_histograms): Error on out of range tp_first_runs. From-SVN: r279178
2019-12-08Fix overflows in -fprofile-reorder-functionsJan Hubicka2-38/+15
This patch fixes three sissues with -fprofile-reorder-functions: 1) First is that tp_first_run is stored as 32bit integer while it can easily overflow (and does so during Firefox profiling). 2) Second problem is that flag_profile_functions can not be tested w/o function context. The changes to expand_all_functions makes it to work on mixed units by first outputting all functions w/o -fprofile-reorder-function (or with no profile info) and then outputting in first_run order 3) LTO partitioner was mixing up order by tp_first_run and by order. for no_reorder we definitly want to order via first, while for everything else we want to roder by second. I have also merged duplicated comparators since they are bit fragile into tp_first_run_node_cmp. I originaly started to look into this because of undefined symbols with Firefox PGO builds. These symbols went away with fixing these bug but I am not quite sure how. it is possible that there is another problem in lto_blanced_map but even after reading the noreorder code few times carefuly I did not find it. Other explanation would be that our new qsort with broken comparator due to overflow can actualy remove some entries in the array, but that sounds bit crazy. Bootstrapped/regested x86_64-linux. * cgraph.c (cgraph_node::dump): Make tp_first_run 64bit. * cgraph.h (cgrpah_node): Likewise. (tp_first_run_node_cmp): Deeclare. * cgraphunit.c (node_cmp): Rename to ... (tp_first_run_node_cmp): ... this; export; watch for 64bit overflows; clear tp_first_run for no_reorder and !flag_profile_reorder_functions. (expand_all_functions): Collect tp_first_run and normal functions to two vectors so the other functions remain sorted. Do not check for flag_profile_reorder_functions it is function local flag. * profile.c (compute_value_histograms): Update tp_first_run printing. * lto-partition.c (node_cmp): Turn into simple order comparsions. (varpool_node_cmp): Remove. (add_sorted_nodes): Use node_cmp. (lto_balanced_map): Use tp_first_run_node_cmp. From-SVN: r279093
2019-11-30cgraph.c (cgraph_node::dump): Dump unit_id and merged_extern_inline.Jan Hubicka1-0/+7
* cgraph.c (cgraph_node::dump): Dump unit_id and merged_extern_inline. * cgraph.h (cgraph_node): Add unit_id and merged_extern_inline. (symbol_table): Add max_unit. (symbol_table::symbol_table): Initialize it. * cgraphclones.c (duplicate_thunk_for_node): Copy unit_id. merged_comdat, merged_extern_inline. (cgraph_node::create_clone): Likewise. (cgraph_node::create_version_clone): Likewise. * ipa-fnsummary.c (dump_ipa_call_summary): Dump info about cross module calls. * ipa-fnsummary.h (cross_module_call_p): New inline function. * ipa-inline-analyssi.c (simple_edge_hints): Use it. * ipa-inline.c (inline_small_functions): Likewise. * lto-symtab.c (lto_cgraph_replace_node): Record merged_extern_inline; copy merged_comdat and merged_extern_inline. * lto-cgraph.c (lto_output_node): Stream out merged_comdat, merged_extern_inline and unit_id. (input_overwrite_node): Stream in these. (input_cgraph_1): Set unit_base. * lto-streamer.h (lto_file_decl_data): Add unit_base. * symtab.c (symtab_node::make_decl_local): Record former_comdat. * g++.dg/lto/inline-crossmodule-1.h: New testcase. * g++.dg/lto/inline-crossmodule-1_0.C: New testcase. * g++.dg/lto/inline-crossmodule-1_1.C: New testcase. From-SVN: r278876
2019-11-25Prevent all uses of DFP when unsupported (PR c/91985).Joseph Myers2-3/+12
Code that directly uses _Decimal* types on architectures not supporting DFP is properly diagnosed ("error: decimal floating-point not supported for this target"), via a call to targetm.decimal_float_supported_p, if the _Decimal32, _Decimal64 or _Decimal128 keywords are used to access it. Use via mode attributes is also diagnosed ("unable to emulate 'SD'"); so is use of the FLOAT_CONST_DECIMAL64 pragma. However, it is possible to access those types via typeof applied to constants or built-in functions without such an error. I expect that there are ways to get an ICE from this; certainly it uses a completely undefined ABI. This patch arranges for the types not to exist in the compiler at all when DFP is not supported. As is done with unsupported _FloatN / _FloatNx types, the global tree nodes are left as NULL_TREE, and the built-in function machinery is made to use error_mark_node for them in that case in builtin-types.def, so that the built-in functions are unavailable. Code handling constants is adjusted to give an error, and other code that might not work with the global tree nodes being NULL_TREE is also updated. Bootstrapped with no regressions for x86_64-pc-linux-gnu. Also tested with no regressions for cross to aarch64-linux-gnu, as a configuration without DFP support. PR c/91985 gcc: * builtin-types.def (BT_DFLOAT32, BT_DFLOAT64, BT_DFLOAT128) (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR): Define to error_mark_node if corresponding global tree node is NULL. * tree.c (build_common_tree_nodes): Do not initialize dfloat32_type_node, dfloat64_type_node or dfloat128_type_node if decimal floating-point not supported. gcc/c: * c-decl.c (finish_declspecs): Use int instead of decimal floating-point types if decimal floating-point not supported. gcc/c-family: * c-common.c (c_common_type_for_mode): Handle decimal floating-point types being NULL_TREE. * c-format.c (get_format_for_type_1): Handle specified types being NULL_TREE. * c-lex.c (interpret_float): Give an error for decimal floating-point constants when decimal floating-point not supported. gcc/lto: * lto-lang.c (lto_type_for_mode): Handle decimal floating-point types being NULL_TREE. gcc/testsuite: * gcc.dg/c2x-no-dfp-1.c, gcc.dg/gnu2x-builtins-no-dfp-1.c: New tests. * gcc.dg/fltconst-pedantic-dfp.c: Expect errors when decimal floating-point not supported. From-SVN: r278684
2019-11-22Release memory-block-pool memory back to malloc.Jan Hubicka2-0/+5
* ggc-page.c (ggc_collect): Call memory_block_pool::trim. * memory-block.cc (memory_block_pool::clear_free_list): Rename to ... (memory_block_pool::reduce_free_list): ... this one. (memory_block_pool::trim): New static function. * memory-block.h (memory_block_pool::freelist_size): New constant (memory_block_pool::clear_free_list): Rename to ... (memory_block_pool::reduce_free_list): ... this one. (memory_block_pool::trim): Declare. * lto.c (lto_wpa_write_files): Call memory_block_pool::trim. From-SVN: r278616
2019-11-14Remove wrong lto-dump: lto1 makefile dependency.Martin Liska2-1/+6
2019-11-14 Martin Liska <mliska@suse.cz> * Make-lang.in: Remove wrong dependency of LTO_DUMP_EXE on LTO_EXE. From-SVN: r278212
2019-11-12Remove gcc/params.* files.Martin Liska4-3/+6
2019-11-12 Martin Liska <mliska@suse.cz> * Makefile.in: Remove PARAMS_H and params.list and params.options. * params-enum.h: Remove. * params-list.h: Remove. * params-options.h: Remove. * params.c: Remove. * params.def: Remove. * params.h: Remove. * asan.c: Do not include params.h. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfgloopanal.c: Likewise. * cgraph.c: Likewise. * combine.c: Likewise. * common/config/aarch64/aarch64-common.c: Likewise. * common/config/gcn/gcn-common.c: Likewise. * common/config/ia64/ia64-common.c: Likewise. * common/config/powerpcspe/powerpcspe-common.c: Likewise. * common/config/rs6000/rs6000-common.c: Likewise. * common/config/sh/sh-common.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr.c: Likewise. * config/csky/csky.c: Likewise. * config/i386/i386-builtins.c: Likewise. * config/i386/i386-expand.c: Likewise. * config/i386/i386-features.c: Likewise. * config/i386/i386-options.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000-logue.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sparc/sparc.c: Likewise. * config/visium/visium.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dse.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * gimple-loop-interchange.cc: Likewise. * gimple-loop-jam.c: Likewise. * gimple-loop-versioning.cc: Likewise. * gimple-ssa-split-paths.c: Likewise. * gimple-ssa-sprintf.c: Likewise. * gimple-ssa-store-merging.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-ssa-warn-alloca.c: Likewise. * gimple-ssa-warn-restrict.c: Likewise. * graphite-isl-ast-to-gimple.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * hsa-gen.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-fnsummary.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-sra.c: Likewise. * ira-build.c: Likewise. * ira-conflicts.c: Likewise. * loop-doloop.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lra-assigns.c: Likewise. * lra-constraints.c: Likewise. * modulo-sched.c: Likewise. * opt-suggestions.c: Likewise. * opts.c: Likewise. * postreload-gcse.c: Likewise. * predict.c: Likewise. * reload.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * shrink-wrap.c: Likewise. * stmt.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-chrec.c: Likewise. * tree-data-ref.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadbackward.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. 2019-11-12 Martin Liska <mliska@suse.cz> * gimple-parser.c: Do not include params.h. 2019-11-12 Martin Liska <mliska@suse.cz> * name-lookup.c: Do not include params.h. * typeck.c: Likewise. 2019-11-12 Martin Liska <mliska@suse.cz> * lto-common.c: Do not include params.h. * lto-partition.c: Likewise. * lto.c: Likewise. From-SVN: r278086