aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2020-10-24c++: Fix verify_ctor_sanity ICE [PR96241]Marek Polacek3-2/+74
The code added in r10-6437 caused us to create a CONSTRUCTOR when we're {}-initializing an aggregate. Then we pass this new CONSTRUCTOR down to cxx_eval_constant_expression which, if the CONSTRUCTOR isn't TREE_CONSTANT or reduced_constant_expression_p, calls cxx_eval_bare_aggregate. In this case the CONSTRUCTOR wasn't reduced_constant_expression_p because for r_c_e_p a CONST_DECL isn't good enough so it returns false. So we go to cxx_eval_bare_aggregate where we crash, because ctx->ctor wasn't set up properly. So my fix is to do so. Since we're value-initializing, I'm not setting CONSTRUCTOR_NO_CLEARING. To avoid keeping a garbage constructor around, I call free_constructor in case the evaluation did not use it. gcc/cp/ChangeLog: PR c++/96241 * constexpr.c (cxx_eval_array_reference): Set up ctx->ctor if we are initializing an aggregate. Call free_constructor on the new CONSTRUCTOR if it isn't returned from cxx_eval_constant_expression. gcc/testsuite/ChangeLog: PR c++/96241 * g++.dg/cpp0x/constexpr-96241.C: New test. * g++.dg/cpp1y/constexpr-96241.C: New test.
2020-10-24Handle undefined ranges in get_size_range.Aldy Hernandez2-6/+31
An undefined range was leaking through to the end of this function, which leads us to use an uninitialized wide_int. gcc/ChangeLog: PR tree-optimization/97538 * calls.c (get_size_range): Handle undefined ranges. gcc/testsuite/ChangeLog: * g++.dg/pr97538.C: New test.
2020-10-24cgraph: move former_thunk_p out of CHECKING_P macro.Martin Liska1-15/+15
This fixes the following failure: ld: cgraph.o: in function `cgraph_edge::verify_corresponds_to_fndecl(tree_node*)': gcc/cgraph.c:3067: undefined reference to `cgraph_node::former_thunk_p()' ld: cgraph.o: in function `clone_of_p': gcc/ChangeLog: * cgraph.c (cgraph_node::former_thunk_p): Move out of CHECKING_P macro.
2020-10-24[RS6000] altivec style lvx/stvx addresses vs power10Alan Modra1-4/+10
gcc.target/powerpc/fold-vec-st-pixel.c and other testcases fail on power10, generating addi 9,5,12 rldicr 9,9,0,59 stxv 34,0(9) rather than addi 5,5,12 stvx 2,0,5 for an altivec lvx/stvx style address. The problem starts with fwprop creating (insn 9 4 0 2 (set (mem:V8HI (and:DI (plus:DI (reg/v/f:DI 121 [ vpp ]) (const_int 12 [0xc])) (const_int -16 [0xfffffffffffffff0])) [0 MEM <vector(8) short int> [(void *)_4 & -16B]+0 S16 A128]) (reg/v:V8HI 120 [ vp1 ])) "pixel.c":6:10 1237 {vsx_movv8hi_64bit} which is finally thrown out as invalid by lra. lra of course does that by reloading the entire address. fwprop creates the invalid address due to rs6000_legitimate_address_p trimming off the outer AND of altivec style addresses before applying other predicates. address_is_prefixed then allows the inner address. Now at the time the AND stripping was added (git commit 850e8d3d56d), rs6000_legitimate_address looked a lot simpler. This patch allows through just those addresses that were legitimate in those simpler days. * config/rs6000/rs6000.c (rs6000_legitimate_address_p): Limit AND addressing to just lvx/stvx style addresses.
2020-10-24[RS6000] Power10 ICE running gcc.target/powerpc/ppc-ne0-1.cAlan Modra1-1/+1
* config/rs6000/rs6000.md (cstore<mode>4): Don't call rs6000_emit_int_cmove for power10 when -mno-isel.
2020-10-24Daily bump.GCC Administrator9-1/+686
2020-10-23net/http/cgi: merge upstream changes to default env varsNikhil Benesch1-1/+1
Incorporate upstream modifications to the cgi package's set of rules about which environment variables should be inherited by child processes by default on each platform. In particular this permits tests to pass on NetBSD by preserving the value of the LD_LIBRARY_PATH environment variable. This is a partial backport of the following upstream CLs: https://golang.org/cl/263802 https://golang.org/cl/263577 https://golang.org/cl/254740 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/264097
2020-10-23testsuite: Fix -Wsizeof-array-div tests.Marek Polacek2-4/+4
gcc/testsuite/ChangeLog: * c-c++-common/Wsizeof-array-div1.c: Expect certain warnings on lp64 targets only. * g++.dg/warn/Wsizeof-array-div2.C: Only run on lp64 targets.
2020-10-23Move thunks out of cgraph_nodeJan Hubicka33-761/+1045
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-10-23c, c++: Implement -Wsizeof-array-div [PR91741]Marek Polacek14-22/+226
This patch implements a new warning, -Wsizeof-array-div. It warns about code like int arr[10]; sizeof (arr) / sizeof (short); where we have a division of two sizeof expressions, where the first argument is an array, and the second sizeof does not equal the size of the array element. See e.g. <https://www.viva64.com/en/examples/v706/>. Clang makes it possible to suppress the warning by parenthesizing the second sizeof like this: sizeof (arr) / (sizeof (short)); so I followed suit. In the C++ FE this was rather easy, because finish_parenthesized_expr already set TREE_NO_WARNING. In the C FE I've added a new tree code, PAREN_SIZEOF_EXPR, to discern between the non-() and () versions. This warning is enabled by -Wall. An example of the output: x.c:5:23: warning: expression does not compute the number of elements in this array; element type is ‘int’, not ‘short int’ [-Wsizeof-array-div] 5 | return sizeof (arr) / sizeof (short); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ x.c:5:25: note: add parentheses around ‘sizeof (short int)’ to silence this warning 5 | return sizeof (arr) / sizeof (short); | ^~~~~~~~~~~~~~ | ( ) x.c:4:7: note: array ‘arr’ declared here 4 | int arr[10]; | ^~~ gcc/c-family/ChangeLog: PR c++/91741 * c-common.c (verify_tree): Handle PAREN_SIZEOF_EXPR. (c_common_init_ts): Likewise. * c-common.def (PAREN_SIZEOF_EXPR): New tree code. * c-common.h (maybe_warn_sizeof_array_div): Declare. * c-warn.c (sizeof_pointer_memaccess_warning): Unwrap NOP_EXPRs. (maybe_warn_sizeof_array_div): New function. * c.opt (Wsizeof-array-div): New option. gcc/c/ChangeLog: PR c++/91741 * c-parser.c (c_parser_binary_expression): Implement -Wsizeof-array-div. (c_parser_postfix_expression): Set PAREN_SIZEOF_EXPR. (c_parser_expr_list): Handle PAREN_SIZEOF_EXPR like SIZEOF_EXPR. * c-tree.h (char_type_p): Declare. * c-typeck.c (char_type_p): No longer static. gcc/cp/ChangeLog: PR c++/91741 * typeck.c (cp_build_binary_op): Implement -Wsizeof-array-div. gcc/ChangeLog: PR c++/91741 * doc/invoke.texi: Document -Wsizeof-array-div. gcc/testsuite/ChangeLog: PR c++/91741 * c-c++-common/Wsizeof-pointer-div.c: Add dg-warning. * c-c++-common/Wsizeof-array-div1.c: New test. * g++.dg/warn/Wsizeof-array-div1.C: New test. * g++.dg/warn/Wsizeof-array-div2.C: New test.
2020-10-23PR middle-end/97552 - missing waning passing null to a VLA argument declared ↵Martin Sebor4-4/+60
[static] gcc/ChangeLog: PR middle-end/97552 * attribs.c (init_attr_rdwr_indices): Handle static VLA parameters. gcc/c/ChangeLog: PR middle-end/97552 * c-decl.c (get_parm_array_spec): Handle static VLA parameters. gcc/testsuite/ChangeLog: PR middle-end/97552 * gcc.dg/Wvla-parameter-2.c: Adjust text of expected warning. * gcc.dg/Wnonnull-5.c: New test.
2020-10-23PR c/97463 - ICE in warn_parm_ptrarray_mismatch on an incompatible function ↵Martin Sebor2-4/+11
redeclaration gcc/c-family/ChangeLog: PR c/97463 * c-warn.c (warn_parm_ptrarray_mismatch): Move null test earlier. gcc/testsuite/ChangeLog: PR c/97463 * gcc.dg/pr97463.c: New test.
2020-10-23Darwin, Ada : Fix bootstrap after stat entry changes.Iain Sandoe1-0/+5
Darwin struct stat has timeval entry fields for file access and modification times but they are named differently from those on Linux. As a workaround define the field names to the Darwin equivalent. gcc/ada/ChangeLog: * adaint.c: On Darwin platforms, define st_atim to st_atimespec. Likwise st_mtim to st_mtimespec.
2020-10-23Fix typo in recent change to Makefile.rtl (bis)Eric Botcazou1-1/+1
gcc/ada/ChangeLog: * Makefile.rtl (EXTRA_GNATRTL_NONTASKING_OBJS) [IA64/Linux]: Fix typo.
2020-10-23Fix typo in recent change to Makefile.rtlEric Botcazou1-1/+1
gcc/ada/ChangeLog: * Makefile.rtl (EXTRA_GNATRTL_NONTASKING_OBJS) [IA64/Linux]: Fix typo.
2020-10-23Link with the configured net lib on vxworks7Douglas Rupp1-1/+1
The net library is configurable on vxworks7. Pick the library to include in link closures in accordance with the availability of a revealing header file, using the recently introduced if-exist-then-else spec builtin function. 2021-10-23 Douglas Rupp <rupp@adacore.com> gcc/ * config/vxworks.h (VXWORKS_NET_LIBS_RTP): Use -lrtnet if rtnetStackLib.h is available,fallback to -lnet otherwise.
2020-10-23testsuite: Correct vec-rlmi-rlnm.c testsuite expected resultDavid Edelsohn1-2/+1
gcc/testsuite/ChangeLog: * gcc.target/powerpc/vec-rlmi-rlnm.c: Update xxlor expect.
2020-10-23Add a if-exists-then-else built-in spec functionDouglas Rupp2-0/+38
This patch adds an if-exists-then-else builtin spec function, which tests for the existence of a file and returns one or the other of the following arguments depending on the result of the test. This differs from the existing if-exists or if-exists-else function which return the name of the tested file if it exists. This new function is of help to a forthcoming change for VxWorks where we check for the presence of a specific header file to decide the name of a library to include in the link closure. 2020-10-23 Douglas Rupp <rupp@adacore.com> gcc/ * gcc.c (if-exists-then-else): New built-in spec function. * doc/invoke.texi: Document it.
2020-10-23rs6000: Fix extraneous characters in the documentationTulio Magno Quites Machado Filho via Gcc-patches1-3/+3
Replace them with a whitespace in order to avoid artifacts in the HTML document. 2020-08-19 Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> gcc/ * doc/extend.texi (PowerPC Built-in Functions): Replace extraneous characters with whitespace.
2020-10-23gcov: fix reading of zero sections.Martin Liska1-4/+4
I noticed that during coverage build of binutils. gcc/ChangeLog: * gcov.c (read_count_file): Never call gcov_sync with a negative value.
2020-10-23testsuite: Add noexcept(false) to throwing destructorJonathan Wakely1-0/+6
I think this test is intended to check this property of the C++ standard: "If a destructor directly invoked by stack unwinding exits via an exception, std::terminate is invoked." [except.throw] Since C++11 any exception escaping a destructor will call std::terminate, so the test would terminate even if the unwinding behaviour was wrong. Give the destructor a potentially-throwing exception specification, so that we know that terminate was called for the right reason. gcc/testsuite/ChangeLog: * g++.dg/compat/eh/filter2_y.C: Add noexcept(false) to destructor.
2020-10-23more wraplf for aux long long float: s390, sparc and powerpcAlexandre Oliva1-0/+3
The wraplf version of Ada.Numerics.Aux_Long_Long_Float is needed on s390* as well. Also add it to sparc*-linux-gnu and powerpc-darwin, that were missed when adding it for sparc and ppc targets. for gcc/ada/ChangeLog PR ada/97504 * Makefile.rtl (LIBGNAT_TARGET_PAIRS): Select wraplf version of Aux_Long_Long_Float for s390 and remaining sparc and powerpc targets.
2020-10-23[Ada] Sockets.Poll implementationDmitriy Anisimkov15-8/+1235
gcc/ada/ * Makefile.rtl (GNATRTL_SOCKETS_OBJS): New object g-socpol$(objext) New source files noted: g-socpol.adb, g-socpol.ads, g-socpol__dummy.adb, g-socpol__dummy.ads, g-sopowa.adb, g-sopowa__posix.adb, g-sopowa__mingw.adb, g-spogwa.adb, g-spogwa.ads. * impunit.adb (Non_Imp_File_Names_95): New base filename g-socpol in "GNAT Library Units" section for GNAT.Sockets.Poll unit. * libgnat/g-socket.ads, libgnat/g-socket.adb: (Raise_Socket_Error): Moved from body to private part of specification to use in GNAT.Sockets.Poll. * libgnat/g-socpol.ads, libgnat/g-socpol.adb: Main unit of the implementation. * libgnat/g-socpol__dummy.ads, libgnat/g-socpol__dummy.adb: Empty unit for the systems without sockets support. * libgnat/g-spogwa.ads, libgnat/g-spogwa.adb: Generic unit implementing sockets poll on top of select system call. * libgnat/g-sopowa.adb (Wait): Separate implementation for operation systems with poll system call support. * libgnat/g-sopowa__posix.adb (Wait): Separate implementation for POSIX select system call. * libgnat/g-sopowa__mingw.adb (Wait): Separate implementation for Windows select system call. * gsocket.h (_WIN32_WINNT): Increase to 0x0600 for winsock2.h to allow WSAPoll related definitions. * s-oscons-tmplt.c: Fix comment next to #endif for #if defined (__linux__) || defined (__ANDROID__) line. Include <poll.h> for all except VxWorks and Windows. (SIZEOF_nfds_t): New definition. (SIZEOF_fd_type): New definition. (SIZEOF_pollfd_events): New definition. (POLLIN, POLLPRI, POLLOUT, POLLERR, POLLHUP, POLLNVAL): New definitions for VxWorks to be able to emulate poll on top of select in it. Define POLLPRI as zero on Windows as it is not supported there. (Poll_Linkname): New definition, because the poll system call has different name in Windows and POSIX.
2020-10-23[Ada] Further Ada 2020 work on accessibility checkingJustin Squirek14-571/+925
gcc/ada/ * checks.adb (Apply_Accessibility_Check): Skip checks against the extra accessibility of a function result when in Ada 2005 mode or earlier. * exp_ch3.adb (Build_Initialization_Call): Modify accessibility level calls to use Accessibility_Level. (Expand_N_Object_Declaration): Modify accessibility level calls to use Accessibility_Level. * exp_ch4.adb (Expand_Allocator_Expression): Add static check for anonymous access discriminants. Remove unneeded propagation of accessibility actual. (Expand_N_In): Modify accessibility level calls to use Accessibility_Level. (Expand_N_Type_Conversion): Modify accessibility level calls to use Accessibility_Level. * exp_ch5.adb (Expand_N_Assignment_Statement): Modify accessibility level calls to use Accessibility_Level. * exp_ch6.adb (Expand_Call_Helper): Rewrite accessibility calculation for the extra accessibility of result actual in function calls, and modify accessibility level calls to use Accessibility_Level. (Check_Against_Result_Level): Removed. * exp_ch9.adb (Expand_N_Requeue_Statement): Add dynamic accessibility check for requeues * sem_attr.adb (Resolve_Attribute): Modify accessibility level calls to use Accessibility_Level. * sem_ch13.adb (Associate_Storage_Pool): Modify accessibility level calls to use Accessibility_Level. * sem_ch4.adb (Analyze_Call): Add static check for explicitly aliased formals in function calls within return statements. * sem_ch6.adb (Check_Return_Construct_Accessibility): Rewrite routine to account for non-aggregate return objects. (Generate_Minimum_Accessibility): Created. (Analyze_Call): Modify accessibility level calls to use Accessibility_Level. (Analyze_Subprogram_Body_Helper): Add generation of minimum accessibility for the extra accessibility of the function result. * sem_ch9.adb (Analyze_Requeue): Modify accessibility level calls to use Accessibility_Level. * sem_res.adb: (Check_Aliased_Parameters): Modify accessibility level calls to use Accessibility_Level. (Valid_Conversion): Modify accessibility level calls to use Accessibility_Level. * sem_util.adb, sem_util.ads (Accessibility_Level_Helper): Renamed to Accessibility_Level, add detection for functions in prefix notation, and add cases where to return zero when specified. Modified to take new, more descriptive, parameters. (Accessibility_Level): Created. (Function_Call_Level): Removed. (Function_Call_Or_Allocator_Level): Created to centralize the calculation accessibility levels for function calls and allocators. (Static_Accessibility_Level): Removed. (Dynamic_Accessibility_Level): Removed. (Get_Dynamic_Accessibility): Renamed from Get_Accessibility. (In_Return_Value): Created to determine if a given expression contributes to the current function's return value. (Is_Master): Created. (Is_Explicitly_Aliased): Created
2020-10-23[Ada] gnatpp: Document --no-comments-fillBob Duff1-2/+3
gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Document --no-comments-fill.
2020-10-23[Ada] Reject illegal syntax in pragma Contract_CasesPiotr Trojanek2-4/+13
gcc/ada/ * contracts.adb (Analyze_Entry_Or_Subprogram_Contract, Analyze_Subprogram_Body_Stub_Contract): Fix missing references to Subprogram_Variant where similar references to Contract_Cases are present. * sem_prag.adb (Analyze_Contract_Case, Analyze_Variant): Check that aggregate parameter has no expressions. (Analyze_Pragma): Replace Contract_Cases with Subprogram_Variant in a copy-pasted comment.
2020-10-23[Ada] GNAT.Sockets: fix comment typoPhilippe Gil1-4/+4
gcc/ada/ * libgnat/g-socket.ads: Fix comment typo.
2020-10-23[Ada] Implement new legality rules introduced in C.6(12) by AI12-0363Eric Botcazou24-479/+393
gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (VFA): Remove uage restrictions in conjunction with Atomic and Aliased. * gnat_rm.texi: Regenerate. * aspects.ads (Aspect_Id): Add Aspect_Full_Access_Only. (Is_Representation_Aspect): Likewise. (Aspect_Names): Likewise. (Aspect_Delay): Likewise. * einfo.ads (Is_Atomic_Or_VFA): Rename into... (Is_Full_Access): ...this. (Is_Volatile_Full_Access): Document new usage for Full_Access_Only. * einfo.adb (Is_Atomic_Or_VFA): Rename into... (Is_Full_Access): ...this. * freeze.ads (Is_Atomic_VFA_Aggregate): Rename into... (Is_Full_Access_Aggregate): ...this. * freeze.adb (Is_Atomic_VFA_Aggregate): Rename into... (Is_Full_Access_Aggregate): ...this. Adjust to above renaming. (Freeze_Array_Type): Likewise. (Freeze_Entity): Likewise. * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Likewise. (Expand_Record_Aggregate): Likewise. * exp_ch4.adb (Expand_N_Op_Eq): Likewise. * exp_ch5.adb (Expand_Assign_Array): Likewise. * exp_ch8.adb (Evaluation_Required): Likewise. * layout.adb (Layout_Type): Likewise. (Set_Composite_Alignment): Likewise. * sem_aux.ads (Has_Rep_Item): Delete. * sem_aux.adb (Has_Rep_Item): Likewise. * sem_attr.adb (Resolve_Attribute) <Attribute_Access>: Implement new legality rules in C.6(12). * sem_ch12.adb (Instantiate_Object): Likewise. * sem_res.adb (Resolve_Actuals): Likewise. * sem_ch13.adb (Inherit_Delayed_Rep_Aspects): Deal with aspect Full_Access_Only. (Check_False_Aspect_For_Derived_Type): Likewise. (Make_Pragma_From_Boolean_Aspect): Test for the presence of Expr. Deal with aspect Full_Access_Only. (Analyze_Aspects_At_Freeze_Point): Likewise. (Analyze_One_Aspect): Do not set Delay_Required to true even for Always_Delay boolean aspects if they have no expression. Force Delay_Required to true for aspect Full_Access_Only in all cases. Reject aspect Full_Access_Only if not in Ada 2020 mode. (Check_Aspect_At_End_Of_Declarations): Deal with empty expression. (Check_Aspect_At_Freeze_Point): Likewise. (Rep_Item_Entity): Delete. (Inherit_Aspects_At_Freeze_Point): Align handling for Bit_Order with that for Scalar_Storage_Order. * sem_prag.adb (Check_Atomic_VFA): Delete. (Check_VFA_Conflicts): Likewise. (Check_Full_Access_Only): New procedure. (Process_Atomic_Independent_Shared_Volatile): Call to implement the new legality checks in C.6(8/2) and mark the entity last. (Analyze_Pragma) <Pragma_Atomic_Components>: Remove obsolete check. * sem_util.ads (Is_Atomic_Or_VFA_Object): Rename into... (Is_Full_Access_Object): ...this. (Is_Subcomponent_Of_Atomic_Object): Rename into... (Is_Subcomponent_Of_Full_Access_Object): ...this. * sem_util.adb (Inherit_Rep_Item_Chain): Use Present_In_Rep_Item. (Is_Atomic_Or_VFA_Object): Rename into... (Is_Full_Access_Object): ...this. (Is_Subcomponent_Of_Atomic_Object): Rename into... (Is_Subcomponent_Of_Full_Access_Object): ...this and adjust. * snames.ads-tmpl (Name_Full_Access_Only): New name of aspect. * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust for renaming. (promote_object_alignment): Likewise. (gnat_to_gnu_field): Likewise. Rename local variable and use specific qualifier in error message for Volatile_Full_Access. * gcc-interface/trans.c (lvalue_required_p): Likewise.
2020-10-23[Ada] Clean up in writing of ALI filesArnaud Charlet2-103/+3
gcc/ada/ * lib-writ.ads, lib-writ.adb (Write_ALI): No longer read existing ALI files in -gnatc mode.
2020-10-23[Ada] Fix logic in C_Select under mingwArnaud Charlet1-11/+10
gcc/ada/ * libgnat/g-socthi__mingw.adb (C_Select): Fix logic in code and make it explicit that we are checking against null values before dereferencing them.
2020-10-23[Ada] Do not use Long_Long_Long_Integer'Image with pragma Discard_NamesEric Botcazou1-5/+8
gcc/ada/ * exp_imgv.adb (Expand_Image_Attribute): For an enumeration type subject to pragma Discard_Names, convert 'Pos to Long_Long_Integer before applying 'Img to the result.
2020-10-23[Ada] Crash on expression function and access typeEd Schonberg1-10/+10
gcc/ada/ * freeze.adb (Freeze_Type_Refs): Add guard on freezing of the designated type of an access type appearing in the expression, when expression includes an explicit dereference whose prefix includes a function call.
2020-10-23[Ada] Fix crash in SPARK on array delta_aggregate with subtype_indicationPiotr Trojanek1-8/+13
gcc/ada/ * exp_spark.adb (Expand_SPARK_Delta_Or_Update): Handle subtype_indication; do not apply range checks for ranges; add comment saying that others_choices is not allowed.
2020-10-23[Ada] Decorate iterated_component_association in SPARK expansionPiotr Trojanek1-1/+94
gcc/ada/ * exp_spark.adb (Expand_SPARK_N_Aggregate, Expand_SPARK_Delta_Or_Update): Expand Iterated_Component_Association occurring within delta aggregates. (Expand_SPARK): Apply SPARK-specific expansion to ordinary aggregates.
2020-10-23[Ada] GNATprove: remove support for external axiomatizationsJohannes Kanig4-218/+1
gcc/ada/ * exp_util.adb, exp_util.ads (Containing_Package_With_Ext_Axioms, Has_Annotate_Pragma_For_External_Axiomatizations): Removed. * sem_ch8.adb (Analyze_Subprogram_Renaming): Removed code related to external axiomatizations. * einfo.ads (Is_Generic_Actual_Subprogram): Removed comment about external axiomatization.
2020-10-23[Ada] Ignore container types for aggregates if not in Ada_2020Ed Schonberg1-0/+1
gcc/ada/ * sem_aggr.adb (Resolve_Aggregate): Do not call Resolve_Container_Aggregate if compilation version is earlier than Ada_2020.
2020-10-23[Ada] Improve documentation of pragma Abort_DeferArnaud Charlet2-2/+30
gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Improve documentation of pragma Abort_Defer. * gnat_rm.texi: Regenerate.
2020-10-23[Ada] CUDA: fix CUDA_Execute not working with aggregatesGhjuvan Lacambre1-4/+21
gcc/ada/ * exp_prag.adb (Etype_Or_Dim3): New function. (Expand_Pragma_Cuda_Execute): Use Etype_Or_Dim3 for temporary decls.
2020-10-23[Ada] Error when closing c_streamArnaud Charlet1-2/+2
gcc/ada/ * libgnat/s-fileio.adb (Open): Fix setting of Tempfile.
2020-10-23[Ada] CUDA: Use internal types instead of public onesGhjuvan Lacambre2-61/+121
gcc/ada/ * exp_prag.adb (Get_Launch_Kernel_Arg_Type): Renamed to Get_Nth_Arg_Type and made more generic. (Build_Dim3_Declaration): Now builds a CUDA.Internal.Dim3 instead of a CUDA.Vector_Types.Dim3. (Build_Shared_Memory_Declaration): Now infers needed type from Launch_Kernel instead of using a hard-coded type. (Expand_Pragma_CUDA_Execute): Build additional temporaries to store Grids and Blocks. * rtsfind.ads: Move Launch_Kernel from public to internal package.
2020-10-23[Ada] Missing detection of unused with_clauseArnaud Charlet2-10/+23
gcc/ada/ * sem_ch4.adb (Complete_Object_Operation): Only mark entities referenced if we are compiling the extended main unit. * sem_attr.adb (Analyze_Attribute [Attribute_Tag]): Record a reference on the type and its scope.
2020-10-23[Ada] Prevent copying uninitialized array with address clauseEd Schonberg1-1/+48
gcc/ada/ * freeze.adb (Is_Uninitialized_Aggregate): Recognize an array aggregate with box initialization, scalar components, and no component default values. (Freeze_Entity, Check_Address_Clause): Call it, and simplify freeze code for entity by removing useless assignment.
2020-10-23[Ada] Spurious errors on tagged types with renamed subprogramsJavier Miranda1-3/+11
gcc/ada/ * sem_ch3.adb (Check_Abstract_Overriding): Subprogram renamings cannot be overridden. (Derive_Subprogram): Enable setting attribute Requires_Overriding on functions with controlling access results of record extensions with a null extension part require overriding (AI95-00391/06).
2020-10-23[Ada] Fix scope of index parameter inside a delta aggregatePiotr Trojanek1-2/+2
gcc/ada/ * sem_aggr.adb (Resolve_Delta_Array_Aggregate): Push scope of the implicit loop before entering name of the index parameter, not after; enter name no matter if the identifier has been decorated before.
2020-10-23[Ada] Better error for illegal call to abstract operation in instantiationsGary Dismukes1-0/+19
gcc/ada/ * sem_ch4.adb (Analyze_Call): In the case where the call is not overloaded, check for a call to an abstract nondispatching operation and flag an error.
2020-10-23[Ada] Always enable the support for 128-bit integer types on 64-bit platformsEric Botcazou1-21/+12
gcc/ada/ * gnat1drv.adb (Adjust_Global_Switches): Rewrite again code enabling or disabling the support for 128-bit integer types.
2020-10-23[Ada] Update header of front-end filesArnaud Charlet72-714/+280
gcc/ada/ * alloc.ads, aspects.adb, aspects.ads, atree.adb, atree.ads, casing.adb, casing.ads, csets.adb, csets.ads, debug.adb, debug.ads, einfo.adb, einfo.ads, elists.adb, elists.ads, fname.adb, fname.ads, gnatvsn.adb, gnatvsn.ads, hostparm.ads, indepsw-aix.adb, indepsw-darwin.adb, indepsw-gnu.adb, indepsw.adb, indepsw.ads, krunch.adb, krunch.ads, lib-list.adb, lib-sort.adb, lib.adb, lib.ads, namet-sp.adb, namet-sp.ads, namet.adb, namet.ads, nlists.adb, nlists.ads, opt.adb, opt.ads, output.adb, output.ads, rident.ads, scans.adb, scans.ads, scil_ll.adb, scil_ll.ads, sem_aux.ads, sem_aux.adb, sfn_scan.adb, sinfo.adb, sinfo.ads, sinput.adb, sinput.ads, snames.adb-tmpl, snames.ads-tmpl, stand.ads, stringt.adb, stringt.ads, table.adb, table.ads, types.adb, types.ads, uintp.adb, uintp.ads, uname.adb, uname.ads, urealp.adb, urealp.ads, vast.adb, vast.ads, widechar.adb, widechar.ads: Update header.
2020-10-23[Ada] Take advantage of Long_Long_Long_Integer in From_StringArnaud Charlet3-8/+58
gcc/ada/ * libgnat/a-nbnbin.adb (From_String): Take advantage of Long_Long_Long_Integer. * libgnat/s-genbig.ads, libgnat/s-genbig.adb (To_Bignum): New function taking a Long_Long_Long_Integer.
2020-10-23[Ada] Iterative patch for accessibility cleanupJustin Squirek1-20/+85
gcc/ada/ * sem_util.adb (Accessibility_Call_Helper): In the selected component case, test if a prefix is a function call and whether the subprogram call is not being used in its entirety and use the Innermost_Master_Scope_Depth in that case. (Innermost_Master_Scope_Depth): Test against the node_par instead of its identifier to avoid misattributing unnamed blocks as not being from source. (Function_Call_Level): Add calculation for whether a subprogram call is initializing an object in its entirety. (Subprogram_Call_Level): Renamed to Function_Call_Level.
2020-10-23[Ada] Sync code for external properties with SPARK RMPiotr Trojanek1-35/+29
gcc/ada/ * sem_prag.adb (Check_External_Properties): Rewrite to match the SPARK RM description.