aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2020-06-03c++: constrained nested partial specialization [PR92103]Patrick Palka2-9/+32
When determining the most specialized partial specialization of a primary template that is nested inside a class template, we first tsubst the outer template arguments into the TEMPLATE_DECL of each partial specialization, and then check for satisfaction of each of the new TEMPLATE_DECL's constraints. But tsubst_template_decl does not currently guarantee that constraints from the original DECL_TEMPLATE_RESULT get reattached to the new DECL_TEMPLATE_RESULT. In the testcase below, this leads to the constraints_satisfied_p check in most_specialized_partial_spec to trivially return true for each of the partial specializations. I'm not sure if such a guarantee would be desirable, but in this case we can just check constraints_satisfied_p on the original TEMPLATE_DECL instead of on the tsubsted TEMPLATE_DECL here, which is what this patch does (alongside some reorganizing). gcc/cp/ChangeLog: PR c++/92103 * pt.c (most_specialized_partial_spec): Reorganize the loop over DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on the original template declaration, not on the tsubsted one. gcc/testsuite/ChangeLog: PR c++/92103 * g++.dg/cpp2a/concepts-partial-spec7.C: New test.
2020-06-03Optimize ODR enum streamingJan Hubicka13-89/+379
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-06-03coroutines: Allow parameter packs in co_await/yield expressions [PR95345]Iain Sandoe2-24/+53
This corrects a pasto, where I copied the constraint on bare parameter packs from the co_return to co_yield/await without properly reviewing it. gcc/cp/ChangeLog: PR c++/95345 * coroutines.cc (finish_co_await_expr): Revise to allow for parameter packs. (finish_co_yield_expr): Likewise. gcc/testsuite/ChangeLog: PR c++/95345 * g++.dg/coroutines/pr95345.C: New test.
2020-06-03Fix missing dependencies for selftests which occasionally causes failed builds.Romain Naour1-2/+4
gcc/ * Makefile.in (SELFTEST_DEPS): Move before including language makefile fragments.
2020-06-03c++: Fix VLA in template [PR95232]Jason Merrill4-4/+35
In a non-template, grokdeclarator notices when we build a pointer to a variably-modified type, and inserts a TYPE_DECL to make sure that type gets gimplified. But in a template we can't always recognize a variably-modified type, so we need to deal with it at instantiation time. gcc/cp/ChangeLog: PR c++/95232 * cp-tree.h (predeclare_vla): Declare. * cp-gimplify.c (predeclare_vla): Handle getting a decl. * pt.c (tsubst_expr) [DECL_EXPR]: Use it. gcc/testsuite/ChangeLog: PR c++/95232 * g++.dg/ubsan/vla-2.C: New test.
2020-06-03Simple patch only add assumed-rank to the list of possible attributes.José Rui Faustino de Sousa2-1/+86
gcc/fortran/ChangeLog: 2020-06-03 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/95214 PR fortran/66833 PR fortran/67938 * trans-expr.c (gfc_maybe_dereference_var): Add assumed-rank to character dummy arguments list of possible attributes. gcc/testsuite/ChangeLog: 2020-06-03 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/95214 PR fortran/66833 PR fortran/67938 * gfortran.dg/PR95214.f90: New test.
2020-06-03tree-optimization/95487 - use a truth type for scatter masksRichard Biener2-2/+26
This makes sure to get a truth type for scatter masks even when they are invariant. 2020-06-03 Richard Biener <rguenther@suse.de> PR tree-optimization/95487 * tree-vect-stmts.c (vectorizable_store): Use a truth type for the scatter mask. * g++.dg/vect/pr95487.cc: New testcase.
2020-06-03jit: implement BT_CONST_VOLATILE_PTR [PR 95306]David Malcolm2-1/+4
gcc/jit/ChangeLog: PR jit/95306 * jit-builtins.c (builtins_manager::make_primitive_type): Implement BT_CONST_VOLATILE_PTR. gcc/testsuite/ChangeLog: PR jit/95306 * jit.dg/test-pr95306-builtin-types.c (create_code): Add test of getting __atomic_load.
2020-06-03use a bitmap obstack in the gori object instead of mallocAndrew MacLeod2-16/+14
2020-06-03tree-optimization/95495 - use SLP_TREE_REPRESENTATIVE in assertionRichard Biener2-1/+17
This fixes a place where I missed to use SLP_TREE_REPRESENTATIVE after its introduction. 2020-06-03 Richard Biener <rguenther@suse.de> PR tree-optimization/95495 * tree-vect-slp.c (vect_slp_analyze_node_operations): Use SLP_TREE_REPRESENTATIVE in the shift assertion. * gcc.dg/vect/pr95495.c: New testcase.
2020-06-03Prefer simple case changes in spelling suggestionsTom Tromey1-43/+79
I got this error message when editing gcc and recompiling: ../../gcc/gcc/ada/gcc-interface/decl.c:7714:39: error: ‘DWARF_GNAT_ENCODINGS_all’ was not declared in this scope; did you mean ‘DWARF_GNAT_ENCODINGS_GDB’? 7714 | = debug_info && gnat_encodings == DWARF_GNAT_ENCODINGS_all; | ^~~~~~~~~~~~~~~~~~~~~~~~ | DWARF_GNAT_ENCODINGS_GDB This suggestion could be improved -- what happened here is that I failed to upper-case the word, and DWARF_GNAT_ENCODINGS_ALL was the correct spelling. This patch changes gcc's spell checker to prefer simple case changes when possible. I tested this using the self-tests. A new self-test is also included. gcc/ChangeLog: * spellcheck.c (CASE_COST): New define. (BASE_COST): New define. (get_edit_distance): Recognize case changes. (get_edit_distance_cutoff): Update. (test_edit_distances): Update. (get_old_cutoff): Update. (test_find_closest_string): Add case sensitivity test.
2020-06-03Do not call SCEV in loop_ranger::range_of_ssa_name.Aldy Hernandez3-22/+2
This was huge hammer that was calling SCEV for every SSA, and it causes Fortran timeouts because SCEV went into an infinite loop.
2020-06-03simplify visited flag unsetting in SLP scalar cost computationRichard Biener1-5/+5
This changes the loop over all stmts to a loop over all costed stmts. 2020-06-03 Richard Biener <rguenther@suse.de> * tree-vect-slp.c (vect_bb_vectorization_profitable_p): Loop over the cost vector to unset the visited flag on stmts.
2020-06-03[OpenMP] Fix mapping of artificial variables (PR94874)Tobias Burnus14-5/+134
gcc/c-family/ChangeLog: * c-common.h (c_omp_predetermined_mapping): Declare. * c-omp.c (c_omp_predetermined_mapping): New. gcc/c/ChangeLog: * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redefine. gcc/cp/ChangeLog: * cp-gimplify.c (cxx_omp_predetermined_mapping): New. * cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine. * cp-tree.h (cxx_omp_predetermined_mapping): Declare. gcc/fortran/ChangeLog: * f95-lang.c (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redefine. * trans-openmp.c (gfc_omp_predetermined_mapping): New. * trans.h (gfc_omp_predetermined_mapping): Declare. gcc/ChangeLog: * gimplify.c (omp_notice_variable): Use new hook. * langhooks-def.h (lhd_omp_predetermined_mapping): Declare. (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Define (LANG_HOOKS_DECLS): Add it. * langhooks.c (lhd_omp_predetermined_sharing): Remove bogus unused attr. (lhd_omp_predetermined_mapping): New. * langhooks.h (struct lang_hooks_for_decls): Add new hook. gcc/testsuite/ChangeLog 2020-06-03 Thomas Schwinge <thomas@codesourcery.com> Tobias Burnus <tobias@codesourcery.com> PR middle-end/94874 * c-c++-common/gomp/pr94874.c: New.
2020-06-03Cleanup LTO tag streaming.Jan Hubicka1-37/+35
this patch cleanups a bit the way LTO tags are assigned (so we do not use magic numbers of 2) and reorders them approximately by their frequency so the stream gets little bit smaller because of uleb coding. From: [WPA] Compression: 111213968 input bytes, 293801489 uncompressed bytes (ratio: 2.641768) [WPA] Size of mmap'd section decls: 85983129 bytes [WPA] Size of mmap'd section function_body: 14058627 bytes to: [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 lto-bootstrapped/regtested x86_64-linux, will commit it shortly. * lto-streamer.h (LTO_tags): Reorder so frequent tags has small indexes; add LTO_first_tree_tag and LTO_first_gimple_tag. (lto_tag_is_tree_code_p): Update. (lto_tag_is_gimple_code_p): Update. (lto_gimple_code_to_tag): Update. (lto_tag_to_gimple_code): Update. (lto_tree_code_to_tag): Update. (lto_tag_to_tree_code): Update.
2020-06-03[Ada] Fix for missing calls to Adjust primitive with nested genericsEric Botcazou1-126/+81
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_ch12.adb (Denotes_Previous_Actual): Delete. (Check_Generic_Actuals): Do not special case array types whose component type denotes a previous actual. Do not special case access types whose base type is private. (Check_Private_View): Remove code dealing with secondary types. Do not switch the views of an array because of its component. (Copy_Generic_Node): Add special handling for a comparison operator on array types. (Instantiate_Type): Do not special case access types whose designated type is private. (Set_Global_Type): Do not special case array types whose component type is private.
2020-06-03[Ada] Spurious ineffective with clause warnings on use type clauseJustin Squirek1-7/+18
2020-06-03 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_ch10.adb (Process_Body_Clauses): Add loop to interate through all prefixes in a use_type clause so that all packages in the expanded name get examined for effectiveness.
2020-06-03[Ada] Small housekeeping work in Check_Private_ViewEric Botcazou1-19/+9
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_ch12.adb (Check_Private_View): Clean up implementation of second main case, when the generic sees the private declaration.
2020-06-03[Ada] Add detection of uninitialized big realsArnaud Charlet3-8/+39
2020-06-03 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/a-nbnbin.ads: Minor reformatting. * libgnat/a-nbnbre.ads, libgnat/a-nbnbre.adb (Is_Valid): Add convention Intrinsic. Add detection of uninitialized big reals.
2020-06-03[Ada] Remove more cases of empty loopsArnaud Charlet3-16/+113
2020-06-03 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_util.ads, sem_util.adb (Side_Effect_Free_Statements, Side_Effect_Free_Loop): New functions. (Has_Non_Null_Statements): Consider N_Call_Marker as a null statement. * sem_ch5.adb (Analyze_Loop_Parameter_Specification): Call Set_Is_Null_Loop even inside a generic instantiation. (Analyze_Loop_Statement): Mark for removal loops with no side effects.
2020-06-03[Ada] Support pragma Allow_Integer_Address on 64-bit targetsEric Botcazou4-11/+33
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * opt.ads (Allow_Integer_Address): Fix typo in comment. * stand.ads (Standard_Address): New entity. * cstand.adb (Create_Standard): Create it. * sem_ch4.adb (Operator_Check): Convert the operands of an operation with addresses and integers to Standard_Address if pragma Allow_Integer_Address is in effect.
2020-06-03[Ada] Get rid of more references to Universal_Integer in expanded codeEric Botcazou2-6/+8
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * libgnat/s-atopar.adb (Atomic_Fetch_And_Add): Make use of an equivalent static expression. (Atomic_Fetch_And_Subtract): Likewise. (Is_Lock_Free): Likewise. * libgnat/s-atopex.adb (Atomic_Exchange): Likewise. (Atomic_Compare_And_Exchange): Likewise. (Is_Lock_Free): Likewise.
2020-06-03[Ada] Fix typosVadim Godunko3-3/+3
2020-06-03 Vadim Godunko <godunko@adacore.com> gcc/ada/ * libgnat/s-parame.ads, libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads: Fix typos.
2020-06-03[Ada] Avoid creating temporaries in Universal_Integer, continuedEric Botcazou1-6/+9
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_util.adb (Remove_Side_Effects): For a type conversion, do not remove the side effects of the expression only if it is of universal integer type.
2020-06-03[Ada] Update headersArnaud Charlet4-0/+16
2020-06-03 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/s-aotase.ads, libgnat/s-atoope.ads, libgnat/s-atopar.ads, libgnat/s-atopex.ads: Update header.
2020-06-03[Ada] Small improvement to Expand_N_Unchecked_Type_ConversionEric Botcazou1-3/+3
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_N_Unchecked_Type_Conversion): Also fold the conversion for literals of enumeration types.
2020-06-03[Ada] Improve handling of SPARK_Mode in generic instancesYannick Moy4-10/+39
2020-06-03 Yannick Moy <moy@adacore.com> gcc/ada/ * rtsfind.adb (Load_RTU): Correctly set/reset global variable to ignore SPARK_Mode in instances around loading. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Accept Off without prior On. * sem_ch7.adb (Analyze_Package_Body_Helper): Likewise. * sem_prag.adb (Analyze_Pragma): Always take into account SPARK_Mode Off.
2020-06-03[Ada] Initial infrastructure for adding a tree checkerArnaud Charlet5-2/+101
2020-06-03 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * frontend.adb (Frontend): Call (dummy for now) tree checker. * debug.adb: Reserve -gnatd_V for the tree checker. * vast.ads, vast.adb: New files. * gcc-interface/Make-lang.in: Add vast.o.
2020-06-03[Ada] Incorrect accessibility checking on aliased formalsJustin Squirek9-67/+134
2020-06-03 Justin Squirek <squirek@adacore.com> gcc/ada/ * libgnat/a-cborse.adb, libgnat/a-cihase.adb, libgnat/a-ciorse.adb, libgnat/a-coorse.adb: Modified to use 'Unrestricted_Access in certain cases where static accessibility errors were triggered. * exp_ch6.adb (Expand_Simple_Return_Statement): Add generation of dynamic accessibility checks as determined by Is_Special_Aliased_Formal_Access. * sem_attr.adb (Resolve_Attribute): Add call to Is_Special_Aliased_Formal_Access to avoid performing static checks where dynamic ones are required. * sem_ch6.adb (Check_Return_Obj_Accessibility): Handle renamed objects within component associations requiring special accessibility checks. * sem_util.adb, sem_util.ads (Is_Special_Aliased_Formal_Access): Created to detect the special case where an aliased formal is being compared against the level of an anonymous access return object. (Object_Access_Level): Remove incorrect condition leading to overly permissive accessibility levels being returned on explicitly aliased parameters.
2020-06-03[Ada] Improve 'Val implementation for some enumeration typesEric Botcazou3-158/+208
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * einfo.ads (Enum_Pos_To_Rep): Adjust description. * exp_attr.adb (Expand_N_Attribute_Reference) <Pred>: Reimplement in the case of an enumeration type with non-standard but contiguous representation. <Succ>: Likewise. <Val>: Likewise. * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Count the literals in the first loop. If the representation is contiguous, just build the index type of the array type and set Enum_Pos_To_Rep to it.
2020-06-03[Ada] Unnesting problems with expansion of Loop_Entry attributeGary Dismukes1-11/+25
2020-06-03 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * exp_attr.adb (Expand_Loop_Entry_Attribute): Revise loop that resets the scopes of entities associated with Loop_Id to the scope of the new function, so the resetting is not restricted to itypes, but excludes loop parameters and the function entity itself. However, this fix is believed to be incomplete and a ??? comment is added to indicate that.
2020-06-03[Ada] Minor change to comment in System.Regexp specBob Duff1-2/+4
2020-06-03 Bob Duff <duff@adacore.com> gcc/ada/ * libgnat/s-regexp.ads: Fix comment
2020-06-03[Ada] Get rid of more references to Universal_Integer in expanded codeEric Botcazou1-80/+128
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference) <Enum_Rep>: In the case of an enumeration type, do an intermediate conversion to a small integer type. Remove useless stuff. <Finalization_Size>: Do not hardcode Universal_Integer and fix a type mismatch in the assignment to the variable. <Max_Size_In_Storage_Elements>: Likewise. <From_Any>: Do not redefine the Ptyp local variable. <To_Any>: Likewise. <TypeCode>: Likewise. <Pos>: Small tweaks. <Val>: For an enumeration type with standard representation, apply the range check to the expression of a convertion to Universal_Integer, if any. For an integer type, expand to a mere conversion.
2020-06-03[Ada] More efficient System.Random_Numbers.Random_Discrete for 32-bit typesEric Botcazou1-22/+67
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * libgnat/s-rannum.adb (Random_Discrete): In the 32-bit case, use the same linear implementation as in the 64-bit case when the type has a contiguous representation.
2020-06-03[Ada] Debug info not available on subp having a class-wide preconditionGary Dismukes1-0/+7
2020-06-03 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * sem_util.adb (Build_Class_Wide_Clone_Decl): Call Set_Debug_Info_Needed to set the Needs_Debug_Info flag on Clone_Id if the flag is set on Spec_Id.
2020-06-03[Ada] Fix missing overflow checks in analysis of predefined unitYannick Moy1-1/+9
2020-06-03 Yannick Moy <moy@adacore.com> gcc/ada/ * inline.adb (Expand_Inlined_Call): Do not suppress checks on inlined code in GNATprove mode.
2020-06-03[Ada] Fix typo in commentEric Botcazou1-1/+1
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * einfo.ads (Has_Contiguous_Rep): Fix typo in comment.
2020-06-03[Ada] Iterate with procedural versions of Next_... routines where possiblePiotr Trojanek24-70/+70
2020-06-03 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * checks.adb, einfo.adb, exp_aggr.adb, exp_ch4.adb, exp_ch6.adb, exp_unst.adb, exp_util.adb, freeze.adb, inline.adb, repinfo.adb, sem_aggr.adb, sem_attr.adb, sem_aux.adb, sem_ch13.adb, sem_ch3.adb, sem_ch4.adb, sem_ch8.adb, sem_elab.adb, sem_eval.adb, sem_prag.adb, sem_res.adb, sem_smem.adb, sem_util.adb, treepr.adb: Replace uses of Next_ functions with corresponding procedures.
2020-06-03[Ada] Get rid of more references to Universal_Integer in expanded codeEric Botcazou2-2/+2
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_attr.adb (Attribute_Valid): Use Standard_Long_Long_Integer in lieu of Universal_Integer as large integer type. * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Likewise.
2020-06-03[Ada] Add Address_Int declaration in s-auxdec.adsArnaud Charlet1-0/+2
2020-06-03 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/s-auxdec.ads (Address_Int): New.
2020-06-03[Ada] Remove ASIS tree generationArnaud Charlet46-2280/+36
2020-06-03 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * aspects.adb, aspects.ads, atree.adb, atree.ads, elists.adb, elists.ads, fname.adb, fname.ads, gnat1drv.adb, lib.adb, lib.ads, namet.adb, namet.ads, nlists.adb, nlists.ads, opt.adb, opt.ads, osint-c.adb, osint-c.ads, repinfo.adb, repinfo.ads, sem_aux.adb, sem_aux.ads, sinput.adb, sinput.ads, stand.ads, stringt.adb, stringt.ads, switch-c.adb, table.adb, table.ads, uintp.adb, uintp.ads, urealp.adb, urealp.ads (Tree_Read, Tree_Write): Remove generation of ASIS trees. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Remove -gnatt and -gnatct documentation. * gnat_ugn.texi: Regenerate. * tree_in.ads, tree_in.adb, tree_io.ads, tree_io.adb, tree_gen.ads, tree_gen.adb, stand.adb: Remove. * gcc-interface/Makefile.in, gcc-interface/Make-lang.in: Remove references to tree_gen.o tree_in.o tree_io.o.
2020-06-03[Ada] Put a couple of options in alphabetical orderEric Botcazou1-9/+9
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * opt.ads (Disable_FE_Inline): Move around. (Disable_FE_Inline_Always): Likewise.
2020-06-03[Ada] Avoid creating temporaries in Universal_Integer for range checksEric Botcazou2-58/+91
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * checks.adb (Is_Single_Attribute_Reference): New predicate. (Generate_Range_Check): Do not force the evaluation if the node is a single attribute reference. * exp_util.adb (Side_Effect_Free_Attribute): New predicate. (Side_Effect_Free) <N_Attribute_Reference>: Call it. (Remove_Side_Effects): Remove the side effects of the prefix for an attribute reference whose prefix is not a name.
2020-06-03[Ada] Remove -gnatt switch processingArnaud Charlet2-12/+0
2020-06-03 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * switch-c.adb (Scan_Front_End_Switches): Remove processing of -gnatt. * usage.adb (Usage): Remove mention of -gnatt.
2020-06-03[Ada] Minor tweaks in commentaryEric Botcazou1-5/+5
2020-06-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sinfo.ads: Minor tweaks in commentary.
2020-06-03Daily bump.GCC Administrator7-1/+2408
2020-06-02jit: fix __builtin_unreachable [PR 95426]David Malcolm3-1/+511
PR jit/95426 reports a crash deep inside "expand" when using __builtin_unreachable via gcc_jit_context_get_builtin_function, due to BLOCK_FOR_INSN being erroneously used on a barrier within rtl_verify_bb_pointers. The root cause turns out to be that I didn't implement LANG_HOOKS_COMMON_ATTRIBUTE_TABLE and LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE for the jit "frontend". When building a decl for the builtin, the libgccjit frontend generates a chain of attributes names, but when this is passed to decl_attributes and the attributes are looked up by namespace and name within lookup_scoped_attribute_spec, attributes_table is empty. Hence no attributes were being associated with the fndecl, and so ECF_NORETURN was not set on the gimple_call (along with various other flags missing on the decl, etc), and so the call is treated as not terminating its BB, and so the CFG rapidly diverges from the equivalent created by the C frontend. This patch fixes things by implementing these langhooks, copying the minimal attribute-handling code from LTO. I stepped through the creation of the fndecl and verified that with this fix it has the same attributes as the equivalent created by the C frontend. gcc/jit/ChangeLog: PR jit/95426 * dummy-frontend.c: Include "options.h", "stringpool.h", and "attribs.h". (ATTR_EXCL): New, copied from lto/lto-lang.c. (attr_noreturn_exclusions): Likewise. (attr_returns_twice_exclusions): Likewise. (attr_const_pure_exclusions): Likewise. (jit_attribute_table): Likewise, copied from lto_attribute_table. (jit_format_attribute_table): Likewise, copied from lto_format_attribute_table. (handle_noreturn_attribute): New, copied from lto/lto-lang.c. (handle_leaf_attribute): Likewise. (handle_const_attribute): Likewise. (handle_malloc_attribute): Likewise. (handle_pure_attribute): Likewise. (handle_novops_attribute): Likewise. (get_nonnull_operand): Likewise. (handle_nonnull_attribute): Likewise. (handle_nothrow_attribute): Likewise. (handle_sentinel_attribute): Likewise. (handle_type_generic_attribute): Likewise. (handle_transaction_pure_attribute): Likewise. (handle_returns_twice_attribute): Likewise. (handle_patchable_function_entry_attribute): Likewise. (ignore_attribute): Likewise. (handle_format_attribute): Likewise. (handle_format_arg_attribute): Likewise. (handle_fnspec_attribute): Likewise. (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define. (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define. gcc/testsuite/ChangeLog: PR jit/95426 * jit.dg/all-non-failing-tests.h: Add note about... * jit.dg/test-builtin-unreachable.c: New test.
2020-06-02c++: *this capture in const member fn [PR95193].Jason Merrill2-1/+13
Here, the capture proxy for *this is const, but its DECL_VALUE_EXPR is not. Don't ICE on this; it's a reasonable difference, since in C++ an rvalue of scalar type does not have cv-qualifiers. gcc/cp/ChangeLog: PR c++/95193 * pt.c (tsubst_decl): Relax assert. gcc/testsuite/ChangeLog: PR c++/95193 * g++.dg/cpp1z/lambda-this7.C: New test.
2020-06-02[Ada] remove last traces of -auxbaseAlexandre Oliva2-2/+2
Remove occurrences of auxbase that remained in comments. for gcc/ada/ChangeLog * lib.ads (Compilation_Switches): Remove -auxbase from comments. * switch.ads (Is_Internal_GCC_Switch): Likewise.
2020-06-02coroutines: Wrap co_await in a target expr where needed [PR95050]Iain Sandoe2-2/+76
Since the co_await expression is mostly opaque to the existing machinery, we were hiding the details of the await_resume return value. If that needs to be wrapped in a target expression, then emulate this with the whole co_await. Similarly, if the await expression we build in response to co_await p.yield_value (e) is wrapped in a target expression, then we need to transfer that wrapper to the resultant CO_YIELD_EXPR (which is, itself, just a proxy for the underlying co_await). gcc/cp/ChangeLog: PR c++/95050 * coroutines.cc (build_co_await): Wrap the co_await expression in a TARGET_EXPR, where needed. (finish_co_yield_expr): Likewise. gcc/testsuite/ChangeLog: PR c++/95050 * g++.dg/coroutines/pr95050.C: New test.