aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-07-08[Ada] Extend optimization to True/False prefixed with StandardPiotr Trojanek1-6/+6
gcc/ada/ * exp_ch5.adb (Expand_N_If_Statement): Detect True/False prefixed with Standard.
2020-07-08[Ada] Check predicates for subtypes of private typesBob Duff2-5/+17
gcc/ada/ * sem_ch13.adb (Analyze_Aspect_Specifications): Add freeze node for the Underlying_Full_View if it exists. The freeze node is what triggers the generation of the predicate function. * freeze.adb: Minor reformatting.
2020-07-08[Ada] Small tweak to Narrow_Large_Operation procedureEric Botcazou1-3/+5
gcc/ada/ * exp_ch4.adb (Narrow_Large_Operation): Use the base type instead of the first subtype of standard integer types as narrower type.
2020-07-08expr: Fix REDUCE_BIT_FIELD for constants [PR95694]Richard Sandiford2-7/+31
This is yet another PR caused by constant integer rtxes not storing a mode. We were calling REDUCE_BIT_FIELD on a constant integer that didn't fit in poly_int64, and then tripped the as_a<scalar_int_mode> assert on VOIDmode. AFAICT REDUCE_BIT_FIELD is always passed rtxes that have TYPE_MODE (rather than some other mode) and it just fills in the redundant sign bits of that TYPE_MODE value. So it should be safe to get the mode from the type instead of the rtx. The patch does that and asserts that the modes agree, where information is available. That on its own is enough to fix the bug, but we might as well extend the folding case to all constant integers, not just those that fit poly_int64. gcc/ PR middle-end/95694 * expr.c (expand_expr_real_2): Get the mode from the type rather than the rtx, and assert that it is consistent with the mode of the rtx (where known). Optimize all constant integers, not just those that can be represented in poly_int64. gcc/testsuite/ PR middle-end/95694 * gcc.dg/pr95694.c: New test.
2020-07-08c++: Better diagnostic for decltype(auto) in C++11 [PR96103]Marek Polacek2-7/+26
If you try to use decltype(auto) in C++11, we emit obscure error: expected primary-expression before 'auto' giving the user no hint as to what's wrong. This patch improves that diagnostic. Since we've been giving an error, I'm also using error(). gcc/cp/ChangeLog: PR c++/96103 * parser.c (cp_parser_decltype): Print error about using decltype(auto) in C++11. Check that the token following "auto" is ")". gcc/testsuite/ChangeLog: PR c++/96103 * g++.dg/cpp0x/decltype77.C: New test.
2020-07-08rs6000: Add len_load/len_store optab supportKewen Lin1-0/+28
Define rs6000 specific len_load/len_store for the LEN_LOAD/LEN_STORE internal function's expansion. As the doc description of the len_load/len_store optab shows, we should use V16QI to wrap those available vector modes. gcc/ChangeLog: * config/rs6000/vsx.md (len_load_v16qi): New define_expand. (len_store_v16qi): Likewise.
2020-07-08IFN/optabs: Support vector load/store with lengthKewen Lin4-6/+63
This patch is to add the internal function and optabs support for vector load/store with length. For the vector load/store with length optab, the length item would be measured in lanes by default. For the targets which support length measured in bytes like Power, they should only define VnQI modes to wrap the other same size vector modes. If the length is larger than total lane/byte count of the given mode, the behavior is undefined. For the remaining lanes/bytes which isn't specified by length, they would be taken as undefined value. gcc/ChangeLog: * doc/md.texi (len_load_@var{m}): Document. (len_store_@var{m}): Likewise. * internal-fn.c (len_load_direct): New macro. (len_store_direct): Likewise. (expand_len_load_optab_fn): Likewise. (expand_len_store_optab_fn): Likewise. (direct_len_load_optab_supported_p): Likewise. (direct_len_store_optab_supported_p): Likewise. (expand_mask_load_optab_fn): New macro. Original renamed to ... (expand_partial_load_optab_fn): ... here. Add handlings for len_load_optab. (expand_mask_store_optab_fn): New macro. Original renamed to ... (expand_partial_store_optab_fn): ... here. Add handlings for len_store_optab. (internal_load_fn_p): Handle IFN_LEN_LOAD. (internal_store_fn_p): Handle IFN_LEN_STORE. (internal_fn_stored_value_index): Handle IFN_LEN_STORE. * internal-fn.def (LEN_LOAD): New internal function. (LEN_STORE): Likewise. * optabs.def (len_load_optab, len_store_optab): New optab.
2020-07-08libstdc++: Fix [multi]map/[multi]set move constructors noexcept qualificationFrançois Dumont5-5/+127
Container move constructors shall not consider their allocator move constructor qualification. libstdc++-v3/ChangeLog: * include/bits/stl_tree.h (_Rb_tree_impl(_Rb_tree_impl&&)): Add noexcept qualification based only on _Compare one. * testsuite/23_containers/map/cons/noexcept_move_construct.cc: Add static asserts. * testsuite/23_containers/multimap/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/multiset/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/set/cons/noexcept_move_construct.cc: Likewise.
2020-07-07libbacktrace: test linker support for DWARF 5Ian Lance Taylor2-4/+12
On AIX, the compiler supports DWARF 5 but the linker does not. 2020-07-07 Clement Chigot <clement.chigot@atos.net> * configure.ac: Test linker support for DWARF5 * configure: Regenerate
2020-07-08Daily bump.GCC Administrator10-1/+354
2020-07-07c++: Add new test [PR92427]Marek Polacek1-0/+15
Fixed in r10-5578. PR c++/92427 * g++.dg/ext/flexary37.C: New test.
2020-07-07libstdc++: Whitespace changes to remove spaces before tabsJonathan Wakely1-2/+2
libstdc++-v3/ChangeLog: * include/std/limits: Whitespace changes.
2020-07-07libstdc++: Replace __int_limits with __numeric_traits_integerJonathan Wakely11-133/+67
I recently added std::__detail::__int_limits as a lightweight alternative to std::numeric_limits, forgetting that the values it provides (digits, min and max) are already provided by __gnu_cxx::__numeric_traits. This change adds __int_traits as an alias for __numeric_traits_integer. This avoids instantiating __numeric_traits to decide whether to use __numeric_traits_integer or __numeric_traits_floating. Then all uses of __int_limits can be replaced with __int_traits, and __int_limits can be removed. libstdc++-v3/ChangeLog: * include/Makefile.am: Remove bits/int_limits.h. * include/Makefile.in: Regenerate. * include/bits/int_limits.h: Removed. * include/bits/parse_numbers.h (_Select_int_base): Replace __int_limits with __int_traits. * include/bits/range_access.h (_SSize::operator()): Likewise. * include/ext/numeric_traits.h (__numeric_traits_integer): Add static assertion. (__int_traits): New alias template. * include/std/bit (__rotl, __rotr, __countl_zero, __countl_one) (__countr_zero, __countr_one, __popcount, __bit_ceil) (__bit_floor, __bit_width) Replace __int_limits with __int_traits. * include/std/charconv (__to_chars_8, __from_chars_binary) (__from_chars_alpha_to_num, from_chars): Likewise. * include/std/memory_resource (polymorphic_allocator::allocate) (polymorphic_allocator::allocate_object): Likewise. * include/std/string_view (basic_string_view::_S_compare): Likewise. * include/std/utility (cmp_equal, cmp_less, in_range): Likewise.
2020-07-07libstdc++: Whitespace changes to keep lines below 80 columnsJonathan Wakely1-144/+148
Also remove leading spaces that are followed by tabs. libstdc++-v3/ChangeLog: * include/std/limits: Whitespace changes.
2020-07-07c++: wrong pretty printing of nested type [PR95303]Patrick Palka2-6/+43
In the testcase below, we pretty print the nested type A<int>::B as A<int>::B<int> because we don't check whether B is itself a class template before printing the innermost set of template arguments from B's TEMPLATE_INFO (which in this case belong to A). This patch fixes this by checking PRIMARY_TEMPLATE_P beforehand. gcc/cp/ChangeLog: PR c++/95303 * cxx-pretty-print.c (pp_cxx_unqualified_id): Check PRIMARY_TEMPLATE_P before printing the innermost template arguments. gcc/testsuite/ChangeLog: PR c++/95303 * g++.dg/concepts/diagnostic14.C: New test.
2020-07-07rs6000: fix power10_hw testAaron Sawdey1-1/+3
The code snippet for this test was returning 1 if power10 instructions executed correctly. It should return 0 if the test passes. * lib/target-supports.exp (check_power10_hw_available): Return 0 for passing test.
2020-07-07testsuite: missed testcaseNathan Sidwell1-0/+6
I discovered I'd missed applying a testcase when fixing up the EOF token location a while back. gcc/testsuite/ * c-c++-common/cpp/pragma-eof.c: New
2020-07-07preprocessor: Better line info for <builtin> & <command-line>Nathan Sidwell12-38/+116
With C++ module header units it becomes important to distinguish between macros defined in forced headers (& commandline & builtins) from those defined in the header file being processed. We weren't making that easy because we treated the builtins and command-line locations somewhat file-like, with incrementing line numbers, and showing them as included from line 1 of the main file. This patch does 3 things: 0) extend the idiom that 'line 0' of a file means 'the file as a whole' 1) builtins and command-line macros are shown as-if included from line zero. 2) when emitting preprocessed output we keep resetting the line number so that re-reading that preprocessed output will get the same set of locations for the command line etc. For instance the new c-c++-common/cpp/line-2.c test, now emits In file included from <command-line>: ./line-2.h:4:2: error: #error wrong 4 | #error wrong | ^~~~~ line-2.c:3:11: error: macro "bill" passed 1 arguments, but takes just 0 3 | int bill(1); | ^ In file included from <command-line>: ./line-2.h:3: note: macro "bill" defined here 3 | #define bill() 2 | Before it told you about including from <command-line>:31. the preprocessed output looks like: ... (There's a new optimization in do_line_marker to stop each of these line markers causing a new line map. We can simply rewind the location, and keep using the same line map.) libcpp/ * directives.c (do_linemarker): Optimize rewinding to line zero. * files.c (_cpp_stack_file): Start on line zero when about to inject headers. (cpp_push_include, cpp_push_default_include): Use highest_line as the location. * include/cpplib.h (cpp_read_main_file): Add injecting parm. * init.c (cpp_read_main_file): Likewise, inform _cpp_stack_file. * internal.h (enum include_type): Add IT_MAIN_INJECT. gcc/c-family/ * c-opts.c (c_common_post_options): Add 'injecting' arg to cpp_read_main_file. (c_finish_options): Add linemap_line_start calls for builtin and cmd maps. Force token position to line_table's highest line. * c-ppoutput.c (print_line_1): Refactor, print line zero. (cb_define): Always increment source line. gcc/testsuite/ * c-c++-common/cpp/line-2.c: New. * c-c++-common/cpp/line-2.h: New. * c-c++-common/cpp/line-3.c: New. * c-c++-common/cpp/line-4.c: New. * c-c++-common/cpp/line-4.h: New.
2020-07-07Avoid printing informational notes when -Wmismatched-tags is suppressed in ↵Martin Sebor3-29/+65
system headers (PR c++/96063) Related: PR c++/96063 - mismatched-tags warnings in stdlib headers gcc/cp/ChangeLog: PR c++/96063 * parser.c (class_decl_loc_t::diag_mismatched_tags): Print notes only if warning_at returns nonzero. gcc/testsuite/ChangeLog: PR c++/96063 * g++.dg/warn/Wmismatched-tags-7.C: New test. * g++.dg/warn/Wmismatched-tags-8.C: New test.
2020-07-07Aarch64: Change costs for TX2 to expose more vectorization opportunitiesAnton Youdkevitch1-9/+9
Make the costs such that they do not exaclty reflect the actual instructions costs from the manual but make the codegen emit the code we want it to. gcc/ChangeLog: * config/aarch64/aarch64.c (thunderx2t99_regmove_cost, thunderx2t99_vector_cost): Likewise.
2020-07-07fix detection of negative step DR groupsRichard Biener4-5/+126
This fixes a condition that caused all negative step DR groups to be detected as single element interleaving. Such groups are rejected by interleaving vectorization but miscompiled by SLP which is fixed by forcing VMAT_STRIDED_SLP for now. 2020-07-07 Richard Biener <rguenther@suse.de> * tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Fix group overlap condition to allow negative step DR groups. * tree-vect-stmts.c (get_group_load_store_type): For multi element SLP groups force VMAT_STRIDED_SLP when the step is negative. * gcc.dg/vect/slp-47.c: New testcase. * gcc.dg/vect/slp-48.c: Likewise.
2020-07-07[Ada] Small adjustment in the handling of alignment for arraysEric Botcazou2-20/+21
gcc/ada/ * freeze.adb (Freeze_Array_Type): Use Ctyp more consistently. Move code setting the alignment in the non-packed case to... * layout.adb (Layout_Type): ...here.
2020-07-07[Ada] Avoid crash on node extensionBob Duff1-0/+9
gcc/ada/ * treepr.adb (Print_Node): Add code to test Is_Extension.
2020-07-07[Ada] Assert failure on invalid Variable_IndexingArnaud Charlet1-0/+7
gcc/ada/ * sem_ch4.adb (Try_Container_Indexing): Add ??? comment. Protect against malformed tree in case of errors.
2020-07-07[Ada] Use Is_Generic_Subprogram where possiblePiotr Trojanek4-10/+5
gcc/ada/ * einfo.adb, sem_ch10.adb, sem_ch12.adb, sem_ch8.adb: Use Is_Generic_Subprogram.
2020-07-07[Ada] Fix typo in code to get a better error messagePiotr Trojanek1-4/+3
gcc/ada/ * sem_ch8.adb (Analyze_Use_Package): Replace low-level, error-prone Ekind_In tests with high-level Is_Generic_Subprogram and Is_Subprogram.
2020-07-07[Ada] ACATS 4.1J - B854003 - Subtype conformance check missed #2Arnaud Charlet1-13/+51
gcc/ada/ * sem_ch6.adb (Check_Formal_Subprogram_Conformance): New subprogram to handle checking without systematically emitting an error. (Check_Conformance): Update call to Check_Formal_Subprogram_Conformance and fix handling of Conforms and Errmsg parameters.
2020-07-07[Ada] ACATS 4.1K - C452003Arnaud Charlet8-192/+75
gcc/ada/ * exp_ch4.adb (Tagged_Membership): Generate a call to CW_Membership instead of using Build_CW_Membership. (Expand_N_In): Remove wrong handling of null access types and corresponding comment. * exp_intr.adb (Expand_Dispatching_Constructor_Call): Generate a call to CW_Membership instead of using Build_CW_Membership. * rtsfind.ads: Add CW_Membership. * exp_atag.ads, exp_atag.adb (Build_CW_Membership): Removed. * einfo.ads: Fix typo. * libgnat/a-tags.ads, libgnat/a-tags.adb (CW_Membership): Moved back to spec.
2020-07-07[Ada] Errors in handling of access_to_subprogram contractsEd Schonberg2-13/+20
gcc/ada/ * exp_ch3.adb (Build_Access_Subprogram_Wrapper_Body): Create proper subprogram specification for body, using names in the subprogram declaration but distinct entities. * exp_ch6.adb (Expand_Call): If this is an indirect call involving a subprogram wrapper, insert pointer parameter in list of actuals with a parameter association, not as a positional parameter.
2020-07-07[Ada] Hang on conditional expression as actualJustin Squirek1-1/+9
gcc/ada/ * exp_ch6.adb (Expand_Branch): Verify the original node is a conditional expression before recursing further. (Insert_Level_Assign): Transform assertion into an explicit raise.
2020-07-07[Ada] Simplify statically known Max_Size_In_Storage_Elements attribute in ↵Steve Baird1-3/+13
more cases gcc/ada/ * sem_attr.adb (Eval_Attribute): Generalize static evaluation of Size attribute references to also handle Max_Size_In_Storage_Elements references.
2020-07-07[Ada] Ada2020: AI12-0198 potentially unevaluated components of arraysJavier Miranda1-2/+1
gcc/ada/ * sem_util.adb (Is_Potentially_Unevaluated): Code cleanup.
2020-07-07[Ada] Move generation of range checks for entry families to expanderEric Botcazou6-23/+46
gcc/ada/ * checks.ads (Expander Routines): Update the description of the Do_Range_Check mechanism. * checks.adb (Selected_Range_Checks): Fix typo. * exp_ch9.adb: Add with and use clause for Checks. (Actual_Index_Expression): Generate a range check if requested. (Entry_Index_Expression): Likewise. * sem_attr.adb (Resolve_Attribute) <Attribute_Count>: Call Apply_Scalar_Range_Check instead of Apply_Range_Check. * sem_ch9.adb (Analyze_Accept_Statement): Likewise. * sem_res.adb (Resolve_Entry): Likewise, after having set the actual index type on the prefix of the indexed component. (Resolve_Indexed_Component): Remove useless conditional construct.
2020-07-07[Ada] Freeze aspect expression relocated to pragma PreconditionPiotr Trojanek1-2/+6
gcc/ada/ * contracts.adb (Analyze_Entry_Or_Subprogram_Contract, Process_Preconditions_For): Freeze expression that has been relocated to pragma Precondition, not the expression which is still in the aspect.
2020-07-07[Ada] ACATS 4.1H - BC60005 - null exclusion matching for formal subprogramsArnaud Charlet4-91/+45
gcc/ada/ * sem_ch6.adb (Check_Conformance): Remove unnecessary (and wrong) code. * sem_ch8.adb (Check_Null_Exclusion): Post error at proper location. Introduce new helper Null_Exclusion_Mismatch and fix implementation wrt formal subprograms used in generic bodies. (Analyze_Subprogram_Renaming): Fix missing setting of Error_Msg_Sloc. (Analyze_Object_Renaming): Replace "in Anonymous_Access_Kind" by Is_Anonymous_Access_Type. * sem_util.adb (Has_Null_Exclusion): Fix handling of N_Parameter_Specification. * sem_ch12.adb (Instantiate_Object): Replace "in Anonymous_Access_Kind" by Is_Anonymous_Access_Type.
2020-07-07[Ada] Handle explicit dereferences in expression functionsEd Schonberg1-0/+9
gcc/ada/ * freeze.adb (Freeze_Expr_Types): Freeze the designated type of the explicit dereference.
2020-07-07[Ada] Ada2020: AI12-0198 potentially unevaluated components of arraysJavier Miranda1-0/+3
gcc/ada/ * sem_util.adb (Is_Potentially_Unevaluated): Protect reading attribute Etype.
2020-07-07[Ada] Use pragma Unsuppress in Time_IOBob Duff1-13/+12
gcc/ada/ * libgnat/g-catiio.adb (Value, Parse_ISO_8601): Unsuppress checks, and don't rely on 'Valid.
2020-07-07[Ada] Add support for XDR streaming in the default runtimeArnaud Charlet3-4/+17
gcc/ada/ * Makefile.rtl: Remove dead code. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Document gnatbind -xdr switch. * gnat_ugn.texi: Regenerate.
2020-07-07[Ada] Fix documentation of -gnatVa switchPiotr Trojanek2-2/+2
gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Validity Checking): Add "p" to the list of switches enabled by -gnatVa. * gnat_ugn.texi: Regenerate.
2020-07-07[Ada] Ensure No_Specification_Of_Aspect forbids pragmas and repr. clausesGhjuvan Lacambre4-4/+26
gcc/ada/ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Add call to Check_Restriction_No_Specification_Of_Aspect. * sem_prag.adb (Analyze_Pragma): Likewise. * restrict.ads (Check_Restriction_No_Specification_Of_Aspect): Mention possible new node kinds in documentation. * restrict.adb (Check_Restriction_No_Specification_Of_Aspect): Retrieve aspect id from different fields if given node is an N_Pragma or an N_Attribute_Definition_Clause.
2020-07-07[Ada] Checking type invariants on in params of procedures, not functions ↵Gary Dismukes2-68/+82
(AI12-0044) gcc/ada/ * contracts.adb (Add_Invariant_And_Predicate_Checks): Relax the condition for doing invariant checks so that in-mode parameters of procedures are also checked (required by AI05-0289, and restricted to procedures by AI12-0044). This is done in a procedure's nested postconditions procedure. * exp_ch6.adb (Expand_Actuals): Also perform postcall invariant checks for in parameters of procedures (but not functions). Moved invariant-checking code to end of Expand_Actuals (including the nested function Is_Public_Subp).
2020-07-07[Ada] Change local object from variable to constantPiotr Trojanek1-6/+4
gcc/ada/ * sem_aggr.adb (Resolve_Delta_Array_Aggregate): Make Index_Type a constant.
2020-07-07[Ada] Fix expansion of delta aggregates with slicesPiotr Trojanek1-1/+1
gcc/ada/ * exp_aggr.adb (Expand_N_Delta_Aggregate): Use type of the delta base expression for the anonymous object of the delta aggregate.
2020-07-07[Ada] Ada2020: AI12-0198 potentially unevaluated components of arraysJavier Miranda2-194/+239
gcc/ada/ * sem_util.ads (Interval_Lists): Reordering routine. * sem_util.adb (Interval_Lists): Reordering routines to keep them alphabetically ordered.
2020-07-07[Ada] Remove extra checks for non-static context from resolving 'UpdatePiotr Trojanek1-3/+0
gcc/ada/ * sem_attr.adb (Resolve_Attribute): Do not call Check_Non_Static_Context.
2020-07-07[Ada] Spurious elaboration warnings with -gnatc and null proceduresArnaud Charlet1-5/+14
gcc/ada/ * sem_elab.adb (Is_Guaranteed_ABE): Take into account null procedures.
2020-07-07[Ada] Minor cleanup with Is_AssignablePiotr Trojanek1-3/+1
gcc/ada/ * sem_ch5.adb (Analyze_Assignment): Reuse Is_Assignable.
2020-07-07[Ada] Set range checks for for 'Update on arrays in GNATprove expansionPiotr Trojanek2-32/+76
gcc/ada/ * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Add scalar range checks for 'Update on arrays just like for 'Update on records. * sem_attr.adb (Analyze_Array_Component_Update): Do not set range checks for single-dimensional arrays. (Resolve_Attribute): Do not set range checks for both single- and multi- dimensional arrays.
2020-07-07[Ada] Style fixes in the description of Analysis-Resolution-ExpansionPiotr Trojanek1-4/+4
gcc/ada/ * sem.ads (Sem): Fix description.