aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-10-22vect: Remove redundant LOOP_VINFO_FULLY_MASKED_PKewen Lin1-2/+1
Remove one redundant LOOP_VINFO_FULLY_MASKED_P condition check which will be checked in vect_use_loop_mask_for_alignment_p. gcc/ChangeLog: * tree-vect-loop.c (vect_transform_loop): Remove the redundant LOOP_VINFO_FULLY_MASKED_P check.
2020-10-23Daily bump.GCC Administrator8-1/+618
2020-10-23libstdc++: Ensure std::forward_as_tuple is definedJonathan Wakely2-12/+14
The recent changes to reduce includes in <memory_resource> went a bit too far, and it's possible for std::forward_as_tuple to not be defined when used. While doing this, I noticed the problematic calls to forward_as_tuple were not qualified, so performed unwanted ADL. libstdc++-v3/ChangeLog: * include/experimental/memory_resource: Include <tuple>. (polymorphic_allocator::construct): Qualify forward_as_tuple. * include/std/memory_resource: Likewise.
2020-10-23[RS6000] Power10 vec-splati-runnable multiple test failuresAlan Modra2-5/+4
FAIL: gcc.target/powerpc/vec-splati-runnable.c 1 blank line(s) in output FAIL: gcc.target/powerpc/vec-splati-runnable.c (test for excess errors) Excess errors: rs6000_emit_xxspltidp_v2df called ... and running the test fails. As the comment says /* Although the instruction says the results are not defined, it does seem to work, at least on Mambo. But no guarentees! */ So the simulator works but not real hardware. gcc/ * config/rs6000/rs6000.c (rs6000_emit_xxspltidp_v2df): Delete debug printf. Remove trailing ".\n" from inform message. Break long line. gcc/testsuite/ * gcc.target/powerpc/vec-splati-runnable.c: Don't abort on undefined output.
2020-10-22libstdc++: Fix custom clock in testJonathan Wakely1-4/+5
This test fails in C++20 mode because std::is_clock is false for the test clock, because it doesn't define a duration member. libstdc++-v3/ChangeLog: * testsuite/30_threads/condition_variable/members/68519.cc: Define recent_epoch_float_clock::duration to meet the Cpp17Clock requirements.
2020-10-22testsuite: Adjust expected results for rlwimi-2.c and vec-rlmi-rlnm.cDavid Edelsohn2-5/+6
Enable rlwimi-2.c and vec-rlmi-rlmn.c testcases for additional target configurtions and update the expected results. gcc/testsuite/ChangeLog: * gcc.target/powerpc/rlwimi-2.c: Adjust expected results for lp64. * gcc.target/powerpc/vec-rlmi-rlnm.c: Remove target and LP64. Adjust xxlor expected results.
2020-10-22Use precision and sign to compare types for rangesAndrew MacLeod1-2/+2
Updated to only use range_compatible_p in range assert sanity checks, not for actual type cmpatibility. * gimple-range-gori.cc (is_gimple_logical_p): Use types_compatible_p for logical compatibility. (logical_stmt_cache::cacheable_p): Ditto.
2020-10-22libstdc++: Only include <condition_variable> in <shared_mutex> if neededJonathan Wakely2-8/+13
The <condition_variable> header is not small, so <shared_mutex> should not include it unless it actually needs std::condition_variable, which is only the case when we don't have pthread_rwlock_t and the POSIX Timers option. The <shared_mutex> header would be even smaller if we had a header for std::condition_variable (separate from std::condition_variable_any). That's already planned for a future change. And <memory_resource> would be even smaller if it was possible to get std::shared_mutex without std::shared_timed_mutex (which depends on <chrono>). For that to be effective, the synchronized_pool_resource would have to create its own simpler version of std::shared_lock without the timed waiting functions. I have no plans to do that. libstdc++-v3/ChangeLog: * include/std/shared_mutex: Only include <condition_variable> when pthread_rwlock_t and POSIX timers are not available. (__cpp_lib_shared_mutex, __cpp_lib_shared_timed_mutex): Change value to be type 'long'. * include/std/version (__cpp_lib_shared_mutex) (__cpp_lib_shared_timed_mutex): Likewise.
2020-10-22libstdc++: Reduce header dependencies in and on <memory>Jonathan Wakely11-242/+278
By moving std::make_obj_using_allocator and the related "utility functions for uses-allocator construction" to a new header, we can avoid including the whole of <memory> in <scoped_allocator> and <memory_resource>. In order to simplify the implementation of those utility functions they now use concepts unconditionally. They are no longer defined if __cpp_concepts is not defined. To simplify the code that uses those functions I've introduced a __cpp_lib_make_obj_using_allocator feature test macro (not specified in the standard, which might be an oversight). That allows the code in <memory_resource> and <scoped_allocator> to check the feature test macro to decide whether to use the new utilities, or fall back to the C++17 code. At the same time, this reshuffles some of the headers included by <memory> so that they are (mostly?) self-contained. It should no longer be necessary to include other headers before <bits/shared_ptr.h> when other parts of the library want to use std::shared_ptr without including the whole of <memory>. libstdc++-v3/ChangeLog: * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * include/bits/shared_ptr.h: Include <iosfwd>. * include/bits/shared_ptr_base.h: Include required headers here directly, instead of in <memory>. * include/bits/uses_allocator_args.h: New file. Move utility functions for uses-allocator construction from <memory> to here. Only define the utility functions when concepts are available. (__cpp_lib_make_obj_using_allocator): Define non-standard feature test macro. * include/std/condition_variable: Remove unused headers. * include/std/future: Likewise. * include/std/memory: Remove headers that are not needed directly, and are now inclkuded where they're needed. Include new <bits/uses_allocator_args.h> header. * include/std/memory_resource: Include only the necessary headers. Use new feature test macro to detect support for the utility functions. * include/std/scoped_allocator: Likewise. * include/std/version (__cpp_lib_make_obj_using_allocator): Define.
2020-10-22Scope libstdc++ configuration for vxworks to all versionsOlivier Hainque3-3/+3
When libstdc++ is enabled, the current high level configuration bits should apply the same to all versions of VxWorks. Adjust the config triplets matching rules accordingly. 2010-10-21 Olivier Hainque <hainque@adacore.com> libstdc++-v3/ * crossconfig.m4: Turn vxworks matcher into vxworks*. * configure.host: Likewise. * configure: Regenerate.
2020-10-22Materialize clones on demandJan Hubicka11-159/+94
this patch removes the pass to materialize all clones and instead this is now done on demand. The motivation is to reduce lifetime of function bodies in ltrans that should noticeably reduce memory use for highly parallel compilations of large programs (like Martin does) or with partitioning reduced/disabled. For cc1 with one partition the memory use seems to go down from 4gb to cca 1.5gb (seeing from top, so this is not particularly accurate). gcc/ChangeLog: 2020-10-22 Jan Hubicka <hubicka@ucw.cz> * cgraph.c (cgraph_node::get_untransformed_body): Perform lazy clone materialization. * cgraph.h (cgraph_node::materialize_clone): Declare. (symbol_table::materialize_all_clones): Remove. * cgraphclones.c (cgraph_materialize_clone): Turn to ... (cgraph_node::materialize_clone): .. this one; move here dumping from symbol_table::materialize_all_clones. (symbol_table::materialize_all_clones): Remove. * cgraphunit.c (mark_functions_to_output): Clear stmt references. (cgraph_node::expand): Initialize bitmaps early; do not call execute_all_ipa_transforms if there are no transforms. * ipa-inline-transform.c (save_inline_function_body): Fix formating. (inline_transform): Materialize all clones before function is modified. * ipa-param-manipulation.c (ipa_param_adjustments::modify_call): Materialize clone if needed. * ipa.c (class pass_materialize_all_clones): Remove. (make_pass_materialize_all_clones): Remove. * passes.c (execute_all_ipa_transforms): Materialize all clones. * passes.def: Remove pass_materialize_all_clones. * tree-pass.h (make_pass_materialize_all_clones): Remove. * tree-ssa-structalias.c (ipa_pta_execute): Clear refs.
2020-10-22OpenMP: Fortran - support omp flush's memorder clausesTobias Burnus5-4/+123
gcc/fortran/ChangeLog: * gfortran.h (enum gfc_omp_memorder): Add. (gfc_omp_clauses): Use it. * openmp.c (gfc_match_omp_flush): Match memorder clauses. * trans-openmp.c (gfc_trans_omp_flush): Handle them. (gfc_trans_omp_directive): Update call. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/flush-1.f90: New test. * gfortran.dg/gomp/flush-2.f90: New test.
2020-10-22[PATCH, rs6000] VSX load/store rightmost element operationsWill Schmidt13-1/+1468
Hi, This adds support for the VSX load/store rightmost element operations. This includes the instructions lxvrbx, lxvrhx, lxvrwx, lxvrdx, stxvrbx, stxvrhx, stxvrwx, stxvrdx; And the builtins vec_xl_sext() /* vector load sign extend */ vec_xl_zext() /* vector load zero extend */ vec_xst_trunc() /* vector store truncate */. Testcase results show that the instructions added with this patch show up at low/no optimization (-O0), with a number of those being replaced with other load and store instructions at higher optimization levels. For consistency I've left the tests at -O0. [v2] Refreshed per review comments. Comments cleaned up, indentation corrected. gcc/ChangeLog: * config/rs6000/altivec.h (vec_xl_zext, vec_xl_sext, vec_xst_trunc): New defines. * config/rs6000/rs6000-builtin.def (BU_P10V_OVERLOAD_X): New builtin macro. (BU_P10V_AV_X): New builtin macro. (se_lxvrhbx, se_lxrbhx, se_lxvrwx, se_lxvrdx): Define internal names for load and sign extend vector element. (ze_lxvrbx, ze_lxvrhx, ze_lxvrwx, ze_lxvrdx): Define internal names for load and zero extend vector element. (tr_stxvrbx, tr_stxvrhx, tr_stxvrwx, tr_stxvrdx): Define internal names for truncate and store vector element. (se_lxvrx, ze_lxvrx, tr_stxvrx): Define internal names for overloaded load/store rightmost element. * config/rs6000/rs6000-call.c (altivec_builtin_types): Define the internal monomorphs P10_BUILTIN_SE_LXVRBX, P10_BUILTIN_SE_LXVRHX, P10_BUILTIN_SE_LXVRWX, P10_BUILTIN_SE_LXVRDX, P10_BUILTIN_ZE_LXVRBX, P10_BUILTIN_ZE_LXVRHX, P10_BUILTIN_ZE_LXVRWX, P10_BUILTIN_ZE_LXVRDX, P10_BUILTIN_TR_STXVRBX, P10_BUILTIN_TR_STXVRHX, P10_BUILTIN_TR_STXVRWX, P10_BUILTIN_TR_STXVRDX, (altivec_expand_lxvr_builtin): New expansion for load element builtins. (altivec_expand_stv_builtin): Update to for truncate and store builtins. (altivec_expand_builtin): Add clases for load/store rightmost builtins. (altivec_init_builtins): Add def_builtin entries for __builtin_altivec_se_lxvrbx, __builtin_altivec_se_lxvrhx, __builtin_altivec_se_lxvrwx, __builtin_altivec_se_lxvrdx, __builtin_altivec_ze_lxvrbx, __builtin_altivec_ze_lxvrhx, __builtin_altivec_ze_lxvrwx, __builtin_altivec_ze_lxvrdx, __builtin_altivec_tr_stxvrbx, __builtin_altivec_tr_stxvrhx, __builtin_altivec_tr_stxvrwx, __builtin_altivec_tr_stxvrdx, __builtin_vec_se_lxvrx, __builtin_vec_ze_lxvrx, __builtin_vec_tr_stxvrx. * config/rs6000/vsx.md (vsx_lxvr<wd>x, vsx_stxvr<wd>x, vsx_stxvr<wd>x): New define_insn entries. * doc/extend.texi: Add documentation for vsx_xl_sext, vsx_xl_zext, and vec_xst_trunc. gcc/testsuite/ChangeLog: * gcc.target/powerpc/vsx-load-element-extend-char.c: New test. * gcc.target/powerpc/vsx-load-element-extend-int.c: New test. * gcc.target/powerpc/vsx-load-element-extend-longlong.c: New test. * gcc.target/powerpc/vsx-load-element-extend-short.c: New test. * gcc.target/powerpc/vsx-store-element-truncate-char.c: New test. * gcc.target/powerpc/vsx-store-element-truncate-int.c: New test. * gcc.target/powerpc/vsx-store-element-truncate-longlong.c: New test. * gcc.target/powerpc/vsx-store-element-truncate-short.c: New test.
2020-10-22[PATCH, rs6000] int128 sign extention instructions (partial prereq)Will Schmidt1-0/+33
Hi This is a sub-set of the 128-bit sign extension support patch series that will be fully implemented in a subsequent patch from Carl. This is a necessary pre-requisite for the vector-load/store rightmost element patch that follows in this thread. [v2] Refreshed and touched up per review comments. - updated set_attr entries. removed superfluous set_attr entries. - moved define_insn and define_expand entries to vsx.md. gcc/ChangeLog: * config/rs6000/vsx.md (enum unspec): Add UNSPEC_EXTENDDITI2 and UNSPEC_MTVSRD_DITI_W1 entries. (mtvsrdd_diti_w1, extendditi2_vector): New define_insns. (extendditi2): New define_expand.
2020-10-22[Ada] Enable the support of 128-bit integer types by defaultEric Botcazou14-153/+1009
gcc/ada/ * Makefile.rtl (GNATRTL_128BIT_PAIRS): Add i-cexten.ads. * debug.adb (d.H): Document new usage. * doc/gnat_rm/representation_clauses_and_pragmas.rst (Size Clauses): Document new limit on 64-bit platforms. (Component_Size Clauses): Likewise. (Pragma Pack for Arrays): Likewise. (Pragma Pack for Records): Likewise. (Record Representation Clauses): Likewise. * gnat_rm.texi: Regenerate. * gnat1drv.adb (Adjust_Global_Switches): Rewrite code enabling or disabling the support for 128-bit integer types. * switch-c.adb (Scan_Front_End_Switches): Do not deal with e128. * usage.adb (Write_Switch_Char): Do not print -gnate128 switch. * libgnat/i-cexten__128.ads: New file. gcc/testsuite/ * ada/acats/run_all.sh: Define and substitute target_{max,min}_int. * ada/acats/support/macro.dfs: Parameterize {MAX,MIN}_INT. * gnat.dg/assert1.adb: Adjust conditionally to 128-bit integer types. * gnat.dg/size_clause1.adb: Do not expect a warning for LP64 targets. * gnat.dg/warn11.adb: Likewise. * gnat.dg/specs/rep_clause5.ads (Array_2_Type): Add alignment clause.
2020-10-22[Ada] ACATS 4.1H - B853001 - missed errors for renamed limitedJavier Miranda6-121/+229
gcc/ada/ * einfo.ads (Has_Limited_View): New synthesized attribute. * einfo.adb (Has_Limited_View): New synthesized attribute. (Set_Limited_View): Complete assertion. * sem_ch10.ads (Is_Visible_Through_Renamings): Make this routine public to invoke it from Find_Expanded_Name and avoid reporting spurious errors on renamings of limited-with packages. (Load_Needed_Body): Moved to have this spec alphabetically ordered. * sem_ch10.adb (Is_Visible_Through_Renamings): Moved to library level. (Is_Limited_Withed_Unit): New subprogram. * sem_ch3.adb (Access_Type_Declaration): Adding protection to avoid reading attribute Entity() when not available. * sem_ch8.adb (Analyze_Package_Renaming): Report error on renamed package not visible through context clauses. (Find_Expanded_Name): Report error on renamed package not visible through context clauses; handle special case where the prefix is a renaming of a (now visible) shadow package.
2020-10-22[Ada] CUDA: discover runtime types instead of hard-codingGhjuvan Lacambre2-4/+21
gcc/ada/ * exp_prag.adb (Get_Launch_Kernel_Arg_Type): New function. (Build_Shared_Memory_Declaration): Use Get_Launch_Kernel_Arg_Type. (Build_Stream_Declaration): Use Get_Launch_Kernel_Arg_Type. * rtsfind.ads: Remove RO_IC_Unsigned_Long_Long.
2020-10-22[Ada] Add more annotations and assertions in the runtimeArnaud Charlet2-2/+14
gcc/ada/ * libgnat/s-imenne.adb, libgnat/s-imgrea.adb: Add assertions.
2020-10-22[Ada] Update annotations for codepeer analysis on GNAT runtimeArnaud Charlet1-2/+2
gcc/ada/ * libgnat/s-imgrea.adb (Set_Image_Real): Update annotations.
2020-10-22[Ada] AI12-0211: Consistency of inherited nonoverridable aspectsSteve Baird6-3/+317
gcc/ada/ * aspects.ads: Introduce the subtype Nonoverridable_Aspect_Id, whose Static_Predicate reflects the list of nonoverridable aspects given in Ada RM 13.1.1(18.7). * sem_util.ads, sem_util.adb: Add two new visible subprograms, Check_Inherited_Nonoverridable_Aspects and Is_Confirming. The former is used to check the consistency of inherited nonoverridable aspects from multiple sources. The latter indicates whether two aspect specifications for a nonoverridable aspect are confirming. Because of compatibility concerns in compiling QGen, Is_Confirming always returns True if Relaxed_RM_Semantics (i.e., -gnatd.M) is specified. * sem_ch3.adb (Derived_Type_Declaration): Call new Check_Inherited_Nonoverridable_Aspects procedure if interface list is non-empty. * sem_ch9.adb (Check_Interfaces): Call new Check_Inherited_Nonoverridable_Aspects procedure if interface list is non-empty. * sem_ch13.adb (Analyze_Aspect_Specifications): When an explicit aspect specification overrides an inherited nonoverridable aspect, check that the explicit specification is confirming.
2020-10-22[Ada] Update the head comment of Check_Compile_Time_SizeEric Botcazou1-7/+7
gcc/ada/ * freeze.ads (Check_Compile_Time_Size): Adjust size limit.
2020-10-22[Ada] Allow use of debug routines when output is going elsewhereRichard Kenner2-0/+18
gcc/ada/ * sprint.adb (pg, po, ps): Use {Push,Pop}_Output. * treepr.adb (pl, pn): Likewise.
2020-10-22[Ada] Minor fix in GNAT RMEric Botcazou2-10/+10
gcc/ada/ * doc/gnat_rm/implementation_advice.rst: Minor fix. * gnat_rm.texi: Regenerate.
2020-10-22[Ada] Implement AI12-0280's interactions with container aggregatesSteve Baird1-56/+91
gcc/ada/ * sem_util.adb (Is_Container_Aggregate): A new local predicates which indicates whether a given expression is a container aggregate. The implementation of this function is incomplete; in the unusual case of a record aggregate (i.e., not a container aggregate) of a type whose Aggregate aspect is specified, the function will incorrectly return True. (Immediate_Context_Implies_Is_Potentially_Unevaluated): Improve handling of aggregate components. (Is_Repeatedly_Evaluated): Test for container aggregate components along with existing test for array aggregate components.
2020-10-22[Ada] Get rid of useless if-then-else in Exp_Fixd.Fpt_ValueEric Botcazou1-13/+2
gcc/ada/ * exp_fixd.adb (Fpt_Value): Fold if-then-else with identical arms.
2020-10-22[Ada] Ada_2020 AI12-0250: Iterator filters in Iterated_Element_AssocationsEd Schonberg2-15/+58
gcc/ada/ * par-ch4.adb (P_Iterated_Component_Association): If the construct includes an iterator filter it corresponds to an Iterated_Element_Association, so build the proper node for it. * exp_aggr.adb (Expand_Container_Aggregate, Aggregate_Size): If the component is an Iterated_Element_Association, treat it as having a non-static size.
2020-10-22[Ada] Fix parser not detecting casing issues in keywordsGhjuvan Lacambre1-1/+8
gcc/ada/ * scng.adb (Scan): Check if any letter of the token is uppercase.
2020-10-22[Ada] Wrong accessibility for conversion to named accessJustin Squirek1-0/+7
gcc/ada/ * sem_util.adb (Accessibility_Level_Helper): Conversions to named access types get the level associated with the named access type.
2020-10-22[Ada] Adjust documentation for Has_Constrained_Partial_View flagEric Botcazou1-1/+1
gcc/ada/ * einfo.ads (Has_Constrained_Partial_View): Add "base type" marker.
2020-10-22[Ada] AI12-0095 Formal types and Constrained Partial ViewsGary Dismukes2-4/+4
gcc/ada/ * einfo.adb (Has_Constrained_Partial_View): Apply Base_Type to Id. * sem_res.adb (Resolve_Actuals.Check_Aliased_Parameter): Remove "not Is_Generic_Type" test and call Object_Type_Has_Constrained_Partial_View instead of Has_Constrained_Partial_View. Improve related error message to say "does not statically match" instead of just "does not match".
2020-10-22[Ada] Implement AI12-0030: Stream attribute availabilitySteve Baird5-5/+163
gcc/ada/ * sem_util.ads, sem_util.adb: Declare and implement a new predicate, Derivation_Too_Early_To_Inherit. This function indicates whether a given derived type fails to inherit a given streaming-related attribute from its parent type because the declaration of the derived type precedes the corresponding attribute_definition_clause of the parent. * exp_tss.adb (Find_Inherited_TSS): Call Derivation_Too_Early_To_Inherit instead of unconditionally assuming that a parent type's streaming attribute is available for inheritance by an immediate descendant type. * sem_attr.adb (Stream_Attribute_Available): Call Derivation_Too_Early_To_Inherit instead of unconditionally assuming that a parent type's streaming attribute is available for inheritance by an immediate descendant type. * exp_attr.adb (Default_Streaming_Unavailable): A new predicate; given a type, indicates whether predefined (as opposed to user-defined) streaming operations for the type should be implemented by raising Program_Error. (Expand_N_Attribute_Reference): For each of the 4 streaming-related attributes (i.e., Read, Write, Input, Output), after determining that no user-defined implementation is available (including a Stream_Convert pragma), call Default_Streaming_Unavailable; if that call returns True, then implement the streaming operation as "raise Program_Error;".
2020-10-22[Ada] Fix bogus error on conversion from Float to 128-bit unsignedEric Botcazou1-0/+18
gcc/ada/ * checks.adb (Apply_Float_Conversion_Check): Saturate the bounds of the check to those of the base type of the expression.
2020-10-22[Ada] Reimplementation of accessibility checkingJustin Squirek18-1312/+994
gcc/ada/ * checks.adb (Apply_Accessibility_Check): Modify condition to avoid flawed optimization and use Get_Accessibility over Extra_Accessibility. * exp_attr.adb: Remove inclusion of Exp_Ch2.adb. * exp_ch2.adb, exp_ch2.ads (Param_Entity): Moved to sem_util. * exp_ch3.ads (Init_Proc_Level_Formal): New function. * exp_ch3.adb (Build_Init_Procedure): Add extra accessibility formal for init procs when the associated type is a limited record. (Build_Initialization_Call): Add condition to handle propagation of the new extra accessibility paramter actual needed for init procs. (Init_Proc_Level_Formal): Created to fetch a the extra accessibility parameter associated with init procs if one exists. * exp_ch4.adb (Build_Attribute_Reference): Modify static check to be dynamic. * exp_ch6.adb (Add_Cond_Expression_Extra_Actual): Move logic used to expand conditional expressions used as actuals for anonymous access formals. (Expand_Call_Helper): Remove extranious accessibility calculation logic. * exp_util.adb: Remove inclusion of Exp_Ch2.adb. * par-ch3.adb (P_Array_Type_Definition): Properly set Aliased_Present on access definitions * sem_attr.adb (Resolve_Attribute): Replace instances for Object_Access_Level with Static_Accessibility_Level. * sem_ch13.adb (Storage_Pool): Replace instances for Object_Access_Level with Static_Accessibility_Level. * sem_ch6.adb (Check_Return_Construct_Accessibility): Replace instances for Object_Access_Level with Static_Accessibility_Level. * sem_ch9.adb (Analyze_Requeue): Replace instances for Object_Access_Level with Static_Accessibility_Level. * sem_res.adb (Check_Aliased_Parameter, Check_Allocator_Discrim_Accessibility, Valid_Conversion): Replace instances for Object_Access_Level with Static_Accessibility_Level. * sem_util.adb, sem_util.ads (Accessibility_Level_Helper): Created to centralize calculation of accessibility levels. (Build_Component_Subtype): Replace instances for Object_Access_Level with Static_Accessibility_Level. (Defining_Entity): Add extra parameter to dictate whether an error is raised or empty is return in the case of an irrelevant N. (Dynamic_Accessibility_Level): Rewritten to use Accessibility_Level_Helper. (Is_View_Conversion): Check membership against Etype to capture nodes like explicit dereferences which have types but are not expanded names or identifers. (Object_Access_LeveL): Removed. (Param_Entity): Moved from sem_util. (Static_Accessibility_Level): Created as a replacement to Object_Access_Level, it also uses Accessibility_Level_Helper for its implementation. * snames.ads-tmpl: Added new name for extra accessibility parameter in init procs.
2020-10-22[Ada] Refactor appending to possibly empty listsPiotr Trojanek2-17/+5
gcc/ada/ * exp_prag.adb (Expand_Pragma_Contract_Cases, Expand_Pragma_Loop_Variant): Reuse Append_New_To. * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Fix typo. (Analyze_Pre_Post_Condition): Refactor repeated calls to Defining_Entity.
2020-10-22[Ada] Minor fixes in GNAT RMEric Botcazou2-8/+6
gcc/ada/ * doc/gnat_rm/implementation_defined_characteristics.rst: Minor fixes. * gnat_rm.texi: Regenerate.
2020-10-22[Ada] Reduce scope of local variables for detecting extra WITH clausesPiotr Trojanek1-10/+12
gcc/ada/ * sem_warn.adb (Check_Unused_Withs): Move local variables from to a nested procedure; Lunit is passed as a parameter to Check_System_Aux and its type is refined from Node_Id to Entity_Id; Cnode is now a constant.
2020-10-22[Ada] Add No_Implicit_Task_Allocations and No_Implicit_PO_Allocations to JorvikPatrick Bernardi1-42/+9
gcc/ada/ * libgnat/s-rident.ads (Profile_Info): Use a common profile definition for Jorvik and GNAT Extended Ravenscar, using the GNAT Extended Ravenscar definition.
2020-10-22[Ada] Build support units for 128-bit integer types on 64-bit platformsEric Botcazou1-60/+160
gcc/ada/ * Makefile.rtl (64-bit platforms): Add GNATRTL_128BIT_PAIRS to the LIBGNAT_TARGET_PAIRS list and also GNATRTL_128BIT_OBJS to the EXTRA_GNATRTL_NONTASKING_OBJS list.
2020-10-22[Ada] Fix error message for import aspectGhjuvan Lacambre1-6/+18
gcc/ada/ * sem_prag.adb (Process_Convention, Process_Import_Or_Interface): Fix error message.
2020-10-22[Ada] Fix transformation of Suppress aspect into pragmaGhjuvan Lacambre1-59/+72
gcc/ada/ * sem_ch13.adb (Make_Aitem_Pragma): Turn into function. This removes a side-effect on the Aitem variable. (Analyze_Aspect_Specifications): Handle Suppress and Unsuppress aspects differently from the Linker_Section aspect. (Ceck_Aspect_At_Freeze_Point): Don't expect Suppress/Unsuppress to be delayed anymore.
2020-10-22[Ada] Ada_2020: ongoing work for aggregates for bounded containersEd Schonberg2-95/+176
gcc/ada/ * sem_aggr.adb: (Resolve_Container_Aggregate): For an indexed container, verify that expressions and component associations are not both present. * exp_aggr.adb: Code reorganization, additional comments. (Expand_Container_Aggregate): Use Aggregate_Size for Iterated_ Component_Associations for indexed aggregates. If present, the default value of the formal in the constructor function is used when the size of the aggregate cannot be determined statically.
2020-10-22[Ada] Fix oversight in Eval_Attribute for Bit_PositionEric Botcazou1-1/+1
gcc/ada/ * sem_attr.adb (Eval_Attribute): Fix oversight for Bit_Position.
2020-10-22[Ada] AI12-0307: uniform resolution rules for aggregatesEd Schonberg4-1/+37
gcc/ada/ * sem_util.ads, sem_util.adb (Check_Ambiguous_Aggregate): When a subprogram call is found to be ambiguous, check whether ambiguity is caused by an aggregate actual. and indicate that it should carry a type qualification. * sem_ch4.adb (Traverse_Hoonyms, Try_Primitive_Operation): Call it. * sem_res.adb (Report_Ambiguous_Argument): Call it.
2020-10-22[Ada] Cleanup repeated code in checks for unused WITH clausesPiotr Trojanek1-51/+43
gcc/ada/ * sem_warn.adb (Check_One_Unit): Avoid repeated calls by using a local variable Lunit; remove local constant Eitem, which was identical to Lunit.
2020-10-22use wraplf for low-precision elementary functions on x86*-vxworks tooAlexandre Oliva1-0/+3
The earlier patch that introduced the wraplf variants missed the x86*-vxworks* ports. This fixes them. for gcc/ada/ChangeLog * Makefile.rtl (LIBGNAT_TARGET_PAIRS) <x86*-vxworks*>: Select nolibm and wraplf variants like other vxworks ports.
2020-10-22enable sincos optimization on mingw-w64Alexandre Oliva1-0/+6
The sincos transformation does not take place on all platforms, because the libc_has_function target hook disables it by default. Current mingw-w64's math library supports sincos, sincosl and sincosf, in 32- and 64-bit modes. I suppose this has been this way for long. This patch enables the sincos optimization on this platform. for gcc/ChangeLog * config/i386/mingw-w64.h (TARGET_LIBC_HAS_FUNCTION): Enable sincos optimization.
2020-10-22c++: Handle RANGE_EXPR index in init_subob_ctx [PR97328]Patrick Palka3-2/+39
In the testcase below, we're ICEing during constexpr evaluation of the CONSTRUCTOR {.data={{}, [1 ... 7]={}}} of type 'vector'. The interesting thing about this CONSTRUCTOR is that it has a RANGE_EXPR index for an element initializer which doesn't satisfy reduced_constant_expression_p (because the field 't' is uninitialized). This is a problem because init_subob_ctx currently punts on setting up a sub-aggregate initialization context when given a RANGE_EXPR index, so we later trip over the asserts in verify_ctor_sanity when recursing into cxx_eval_bare_aggregate on this element initializer. Fix this by making init_subob_ctx set up an appropriate initialization context when supplied a RANGE_EXPR index. gcc/cp/ChangeLog: PR c++/97328 * constexpr.c (init_subob_ctx): Don't punt on RANGE_EXPR indexes, instead build a sub-aggregate initialization context with no subobject. gcc/testsuite/ChangeLog: PR c++/97328 * g++.dg/cpp2a/constexpr-init19.C: New test. * g++.dg/cpp2a/constexpr-init20.C: New test.
2020-10-22c++: constexpr evaluation and bare EMPTY_CLASS_EXPR [PR96575]Patrick Palka2-8/+25
In the testcase below, folding of the initializer for 'ret' inside the instantiated f<lambda>::lambda ends up yielding an initializer for which potential_constant_expression returns false. This causes finish_function to mark the lambda as non-constexpr, which ultimately causes us to reject 'f(g)' as a call to a non-constexpr function. The initializer for 'ret' inside f<lambda>::lambda, prior to folding, is the CALL_EXPR <lambda(S)>::operator() (&cb, ({}, <<< Unknown tree: empty_class_expr >>>;)) where the second argument is a COMPOUND_EXPR whose second operand is an EMPTY_CLASS_EXPR that was formed by build_class_a. cp_fully_fold_init is able to only partially fold this initializer: it gets rid of the side-effectless COMPOUND_EXPR to obtain <lambda(S)>::operator() (&cb, <<< Unknown tree: empty_class_expr >>>) as the final initializer for 'ret'. This initializer no longer satifies potential_constant_expression due to the bare EMPTY_CLASS_EXPR which is not wrapped in a COMPOUND_EXPR. (cp_fully_fold_init first tries maybe_constant_value on the original CALL_EXPR, but constexpr evaluation punts upon seeing __builtin_is_constant_evaluated, since manifestly_const_eval is false.) To fix this, it seems we could either make cp_fold preserve the COMPOUND_EXPR trees produced by build_call_a, or we could improve the constexpr machinery to treat EMPTY_CLASS_EXPR trees as first-class citizens. Assuming it's safe to continue folding away these COMPOUND_EXPRs, the second approach seems cleaner, so this patch implements the second approach. gcc/cp/ChangeLog: PR c++/96575 * constexpr.c (cxx_eval_constant_expression) <case EMPTY_CLASS_EXPR>: Lower it to a CONSTRUCTOR. (potential_constant_expression_1) <case COMPOUND_EXPR>: Remove now-redundant handling of COMPOUND_EXPR with EMPTY_CLASS_EXPR second operand. <case EMPTY_CLASS_EXPR>: Return true instead of false. gcc/testsuite/ChangeLog: PR c++/96575 * g++.dg/cpp1z/constexpr-96575.C: New test.
2020-10-22c++: Check DECL_TEMPLATE_PARM_P in duplicate_decls [PR97511]Patrick Palka2-0/+7
This makes duplicate_decls differentiate a TYPE_DECL for an alias template from a TYPE_DECL for one of its template parameters. The recently added assert in template_parm_to_arg revealed this latent issue because merging of the two TYPE_DECLs cleared the DECL_TEMPLATE_PARM_P flag. With this patch, we now also correctly diagnose the name shadowing in the below testcase (as required by [temp.local]/6). gcc/cp/ChangeLog: PR c++/97511 * decl.c (duplicate_decls): Return NULL_TREE if DECL_TEMPLATE_PARM_P differ. gcc/testsuite/ChangeLog: PR c++/97511 * g++.dg/template/shadow3.C: New test.
2020-10-22[RS6000] VSX_MM_SUFFIXAlan Modra1-3/+3
gcc.target/powerpc/vsx_mask-count-runnable.c and others Assembler messages: Error: unrecognized opcode: `vcntmb<VSX_MM_SUFFIX>' * config/rs6000/vsx.md (vec_cntmb_<mode>, vec_extract_<mode>), (vec_expand_<mode>): Replace <VSX_MM_SUFFIX> with <wd>.