aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2021-07-07[Ada] Fix bugs in Value_Size clauses and refactorBob Duff6-142/+145
gcc/ada/ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Combine processing of Size and Value_Size clauses. Ensure that Value_Size is treated the same as Size, in the cases where both are allowed (i.e. the prefix denotes a first subtype). Misc cleanup. * einfo-utils.adb (Init_Size): Add assertions. (Size_Clause): Return a Value_Size clause if present, instead of just looking for a Size clause. * einfo.ads (Has_Size_Clause, Size_Clause): Change documentation to include Value_Size. * sem_ch13.ads, layout.ads, layout.adb: Comment modifications.
2021-07-07[Ada] Improve interactions between DSA and Put_Image routines for tagged typesSteve Baird1-23/+3
gcc/ada/ * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies): Add TSS_Put_Image to list of predefined primitives that need special treatment. (Build_General_Calling_Stubs, Build_Subprogram_Receiving_Stubs): Remove previous hack for dealing with TSS_Put_Image procedures.
2021-07-07[Ada] Timeout correction on Get_Socket_OptionDmitriy Anisimkov1-6/+10
gcc/ada/ * libgnat/g-socket.adb (Get_Socket_Option): Add 500ms only when Minus_500ms_Windows_Timeout is True. (Set_Socket_Option): Use "* 1000" instead of "/ 0.001" to convert to milliseconds.
2021-07-07[Ada] Unchecked_Convert_To: set ParentBob Duff2-5/+13
gcc/ada/ * tbuild.adb (Unchecked_Convert_To): Set the Parent of the new node to the Parent of the old node. * tbuild.ads (Unchecked_Convert_To): Document differences between Convert_To and Unchecked_Convert_To. The previous documentation claimed they are identical except for the uncheckedness of the conversion.
2021-07-07[Ada] Simplify handling of sure errors in GNATprove modeYannick Moy3-25/+0
gcc/ada/ * checks.adb (Apply_Scalar_Range_Check): Remove special case for GNATprove mode. * sem_res.adb (Resolve_Arithmetic_Op): Same. * sem_util.adb (Apply_Compile_Time_Constraint_Error): Same.
2021-07-07[Ada] Reduce scope of local variablesPiotr Trojanek1-4/+6
gcc/ada/ * sem_ch6.adb (Check_For_Primitive_Subprogram): Move declarations of local variables after nested subprogram bodies.
2021-07-07[Ada] Simplify code by reusing List_LengthPiotr Trojanek1-13/+1
gcc/ada/ * exp_disp.adb (CPP_Num_Prims): Reuse List_Length.
2021-07-07[Ada] Replace low-level membership tests with Is_Private_TypePiotr Trojanek3-5/+5
gcc/ada/ * exp_ch3.adb, exp_ch6.adb, sem_ch6.adb: Replace Ekind membership test in Private_Kind with a call to Is_Private_Type.
2021-07-07[Ada] Linker_Section_Pragma cleanupBob Duff1-3/+2
gcc/ada/ * gen_il-gen-gen_entities.adb: Remove Linker_Section_Pragma field from Record_Field_Kind. Minor comment improvement.
2021-07-07[Ada] Fix precondition of Cot for code analyzersYannick Moy1-1/+1
gcc/ada/ * libgnat/a-ngelfu.ads (Cot): Fix precondition.
2021-07-07[Ada] Replace chopped string copy with renamingPiotr Trojanek1-5/+3
gcc/ada/ * par.adb (Par): A local Name variable is now a renaming of a constant slice.
2021-07-07[Ada] Simplify handling of Generate_Code flag for compilation unitsPiotr Trojanek4-30/+12
gcc/ada/ * gnat1drv.adb (Gnat1drv): Remove flagging of main unit and its corresponding spec as requiring code generation; now the flags are set much earlier. * lib-load.adb (Load_Main_Source): Set Generate_Code flag on the main unit source. (Make_Instance_Unit): Copy Generate_Code flag from the main unit to instance units. * lib-writ.adb (Write_ALI): Remove redundant condition; Generate_Code flag is always set for the main unit. * par-load.adb (Load): Set Generate_Code flag on the main unit's corresponding spec, if any.
2021-07-07[Ada] Add socket options to control keepalive on TCP connectionDmitriy Anisimkov2-14/+62
gcc/ada/ * libgnat/g-socket.ads (Option_Name): Add Keep_Alive_Count, Keep_Alive_Idle, and Keep_Alive_Interval items to enumeration. (Option_Type): Add Keep_Alive_Count, Keep_Alive_Idle, and Keep_Alive_Interval alternatives to the case of discriminated record. * libgnat/g-socket.adb (Options): Add Keep_Alive_Count, Keep_Alive_Idle, and Keep_Alive_Interval to items enumerator to OS constant converter. (Set_Socket_Option): Process Keep_Alive_Count, Keep_Alive_Idle, and Keep_Alive_Interval socket options. (Get_Socket_Option): Idem.
2021-07-07[Ada] Tune discovery of No_Elaboration_Code restrictionPiotr Trojanek1-0/+1
gcc/ada/ * lib-writ.adb (Write_ALI): Exit from loop after seeing first unit that violates No_Elaboration_Code restriction.
2021-07-07[Ada] Simplify iteration over pending instantiationsPiotr Trojanek1-7/+2
gcc/ada/ * inline.adb (Instantiate_Bodies): Fix white in declaration. (Remove_Dead_Instance): Change iteration from WHILE to FOR.
2021-07-07[Ada] Transient scope cleanupBob Duff10-165/+93
gcc/ada/ * checks.adb, exp_attr.adb, exp_ch4.adb, exp_ch6.adb, exp_ch9.adb, exp_disp.adb, exp_util.adb, inline.adb, sem_res.adb: Change all calls to Make_Unchecked_Type_Conversion to call Unchecked_Convert_To instead. This involves removing New_Occurrence_Of on the first parameter, because Unchecked_Convert_To expects a type entity, rather than the name of one. Also, removed calls to Relocate_Node, because Unchecked_Convert_To takes care of that. * sinfo.ads: Change comment to be worded more firmly.
2021-07-07[Ada] Unsynchronized access to a Boolean in tasking stateSteve Baird1-2/+3
gcc/ada/ * libgnarl/s-tassta.adb (Free_Task): Acquire the Task_Lock before, rather than after, querying the task's Terminated flag. Add a corresponding Task_Unlock call.
2021-07-07aarch64: Remove a vestigial %K [PR101363]Martin Sebor1-1/+2
gcc/ChangeLog: PR target/101363 * config/aarch64/aarch64.c (aarch64_simd_lane_bounds): Remove a stray %K from error_at() missed in r12-2088.
2021-07-07testsuite: gcc.dg/debug/btf/btf-bitfields-3.c remove -fno-short-enums PR ↵Christophe Lyon1-1/+1
debug/101321 After r12-2094, -fno-short-enums is non longer necessary. 2021-07-07 Christophe Lyon <christophe.lyon@foss.st.com> PR debug/101321 gcc/testsuite/ * gcc.dg/debug/btf/btf-bitfields-3.c: Remove -fno-short-enums.
2021-07-07tree-optimization/34195 - testcase for fixed vectorizationRichard Biener1-0/+33
This adds a testcase for an old fixed PR. 2021-07-07 Richard Biener <rguenther@suse.de> PR tree-optimization/34195 * gcc.dg/vect/pr34195.c: New testcase.
2021-07-07tree-optimization/99728 - improve LIM for loops with aggregate copiesRichard Biener2-7/+102
This improves LIM by recording aggregate copies for disambiguation purposes instead of as UNANALYZABLE_MEM which will prevent any invariant or store motion across it. This allows four of the six references in the loop of the testcase to be promoted. 2021-07-07 Richard Biener <rguenther@suse.de> PR tree-optimization/99728 * tree-ssa-loop-im.c (gather_mem_refs_stmt): Record aggregate copies. (mem_refs_may_alias_p): Add assert we handled aggregate copies elsewhere. (sm_seq_valid_bb): Give up when running into aggregate copies. (ref_indep_loop_p): Handle aggregate copies as never being invariant themselves but allow other refs to be disambiguated against them. (can_sm_ref_p): Do not try to apply store-motion to aggregate copies. * g++.dg/opt/pr99728.C: New testcase.
2021-07-07Add avx512 tests for MADDSUB and FMSUBADD SLP vectorization patterns.liuhongt4-0/+182
gcc/testsuite/ChangeLog: * gcc.target/i386/avx512f-vect-fmaddsubXXXpd.c: New test. * gcc.target/i386/avx512f-vect-fmaddsubXXXps.c: New test. * gcc.target/i386/avx512f-vect-fmsubaddXXXpd.c: New test. * gcc.target/i386/avx512f-vect-fmsubaddXXXps.c: New test.
2021-07-07Daily bump.GCC Administrator8-1/+640
2021-07-06BTF testsuite: Remove explicit check on btm_typeIndu Bhagat1-7/+2
The value of btm_type is the BTF type ID of the referred type. The order in which the BTF types are added can change across platforms and also as the code evolves, hence changing the BTF type ID. As there is no direct and portable method of testing that a BTF type refers to another BTF type of a specific kind, remove the explicit check on btm_type. This patch adjusts the testcase without affecting the test coverage as other testcases already have similar constructs. It also fixes a subset of failures as seen on Darwin. 2021-07-06 Indu Bhagat <indu.bhagat@oracle.com> gcc/testsuite/ChangeLog: PR debug/101283 * gcc.dg/debug/btf/btf-bitfields-3.c: Remove the check on btm_type.
2021-07-06CTF testsuite: Remove explicit check on ctv_typeidxIndu Bhagat1-3/+4
The value of ctv_typeidx is the CTF type ID of the data type of the associated variable. The order in which the CTF types are added can change across platforms and also as the code evolves, hence changing the CTF type ID. As there is no direct and portable method of testing that the data type of a CTF variable is of a specific kind, remove the check on ctv_typeidx. This also fixes a subset of failures as seen on Darwin. 2021-07-06 Indu Bhagat <indu.bhagat@oracle.com> gcc/testsuite/ChangeLog: PR debug/101283 * gcc.dg/debug/ctf/ctf-attr-mode-1.c: Remove the check for ctv_typeidx.
2021-07-06Add test for [PR55881].Martin Sebor1-0/+34
PR c++/55881 gcc/testsuite/ChangeLog: * g++.dg/warn/uninit-pr55881.C: New test.
2021-07-06Add test for [PR86650].Martin Sebor1-0/+35
PR tree-optimization/86650 - -Warray-bounds missing inlining context gcc/testsuite/ChangeLog: PR tree-optimization/86650 * gcc.dg/Warray-bounds-76.c: New test.
2021-07-06dwarf2ctf: the unit of sou field location is bits [PR101283]Indu Bhagat2-3/+3
If the value of the DW_AT_data_member_location attribute is constant, the associated unit is bytes. This patch amends incorrect behaviour which was being exercised with -gdwarf-2. This caused some of the failures as noted in PR debug/101283 (specifically the BTF tests involving btm_offset). The testcase ctf-struct-array-2.c was erroneously checking for the value of ctm_offset in number of bytes. The patch fixes the calculation of the field location value for a struct member in dwarf2ctf and adjusts the testcase. This patch also fixes some of the failing tests as noted in PR debug/101283. 2021-07-06 Indu Bhagat <indu.bhagat@oracle.com> gcc/ChangeLog: PR debug/101283 * dwarf2ctf.c (ctf_get_AT_data_member_location): Multiply by 8 to get number of bits. gcc/testsuite/ChangeLog: PR debug/101283 * gcc.dg/debug/ctf/ctf-struct-array-2.c: Adjust the value in the testcase.
2021-07-06Remove support for %G and %K.Martin Sebor9-100/+11
gcc/c-family/ChangeLog: * c-format.c (gcc_tdiag_char_table): Remove support for %G and %K. (gcc_cdiag_char_table): Same. (gcc_cxxdiag_char_table): Same. gcc/c/ChangeLog: * c-objc-common.c (c_tree_printer): Remove support for %G and %K. gcc/cp/ChangeLog: * error.c (cp_printer): Remove support for %G and %K. gcc/ChangeLog: * gimple-pretty-print.c (percent_G_format): Remove. * tree-diagnostic.c (default_tree_printer): Remove calls. * tree-pretty-print.c (percent_K_format): Remove. * tree-pretty-print.h (percent_K_format): Remove. gcc/testsuite/ChangeLog: * gcc.dg/format/gcc_diag-10.c: Update expected warnings. * gcc.dg/plugin/diagnostic_plugin_test_inlining.c: Remove %G.
2021-07-06Improve warning suppression for inlined functions.Martin Sebor3-23/+37
gcc/ChangeLog: * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_builtin): Remove %K and use error_at. (aarch64_expand_fcmla_builtin): Same. (aarch64_expand_builtin_tme): Same. (aarch64_expand_builtin_memtag): Same. * config/arm/arm-builtins.c (arm_expand_acle_builtin): Same. (arm_expand_builtin): Same. * config/arm/arm.c (bounds_check): Same.
2021-07-06Improve warning suppression for inlined functions.Martin Sebor27-408/+852
Resolves: PR middle-end/98871 - Cannot silence -Wmaybe-uninitialized at declaration site PR middle-end/98512 - #pragma GCC diagnostic ignored ineffective in conjunction with alias attribute gcc/ChangeLog: * builtins.c (warn_string_no_nul): Remove %G. (maybe_warn_for_bound): Same. (warn_for_access): Same. (check_access): Same. (check_strncat_sizes): Same. (expand_builtin_strncat): Same. (expand_builtin_strncmp): Same. (expand_builtin): Same. (expand_builtin_object_size): Same. (warn_dealloc_offset): Same. (maybe_emit_free_warning): Same. * calls.c (maybe_warn_alloc_args_overflow): Same. (maybe_warn_nonstring_arg): Same. (maybe_warn_rdwr_sizes): Same. * expr.c (expand_expr_real_1): Remove %K. * gimple-fold.c (gimple_fold_builtin_strncpy): Remove %G. (gimple_fold_builtin_strncat): Same. * gimple-ssa-sprintf.c (format_directive): Same. (handle_printf_call): Same. * gimple-ssa-warn-alloca.c (pass_walloca::execute): Same. * gimple-ssa-warn-restrict.c (maybe_diag_overlap): Same. (maybe_diag_access_bounds): Same. Call gimple_location. (check_bounds_or_overlap): Same. * trans-mem.c (ipa_tm_scan_irr_block): Remove %K. Simplify. * tree-ssa-ccp.c (pass_post_ipa_warn::execute): Remove %G. * tree-ssa-strlen.c (maybe_warn_overflow): Same. (maybe_diag_stxncpy_trunc): Same. (handle_builtin_stxncpy_strncat): Same. (maybe_warn_pointless_strcmp): Same. * tree-ssa-uninit.c (maybe_warn_operand): Same. gcc/testsuite/ChangeLog: * gcc.dg/Wobjsize-1.c: Prune expected output. * gcc.dg/Warray-bounds-71.c: New test. * gcc.dg/Warray-bounds-71.h: New test header. * gcc.dg/Warray-bounds-72.c: New test. * gcc.dg/Warray-bounds-73.c: New test. * gcc.dg/Warray-bounds-74.c: New test. * gcc.dg/Warray-bounds-75.c: New test. * gcc.dg/Wfree-nonheap-object-4.c: Adjust expected output. * gcc.dg/Wfree-nonheap-object-5.c: New test. * gcc.dg/Wfree-nonheap-object-6.c: New test. * gcc.dg/pragma-diag-10.c: New test. * gcc.dg/pragma-diag-9.c: New test. * gcc.dg/uninit-suppress_3.c: New test. * gcc.dg/pr79214.c: Xfail tests. * gcc.dg/tree-ssa/builtin-sprintf-warn-27.c: New test. * gcc.dg/format/c90-printf-1.c: Adjust expected output.
2021-07-06i386: Add variable vec_set for 32bit vectors [PR97194]Uros Bizjak4-7/+77
To generate sane code a SSE4.1 variable PBLENDV instruction is needed. Also enable variable vec_set through vec_setm_operand predicate for TARGET_SSE4_1 instead of TARGET_AVX2. ix86_expand_vector_init_duplicate is able to emulate vpbroadcast{b,w} with pxor/pshufb. 2021-07-06 Uroš Bizjak <ubizjak@gmail.com> gcc/ PR target/97194 * config/i386/predicates.md (vec_setm_operand): Enable register_operand for TARGET_SSE4_1. * config/i386/mmx.md (vec_setv2hi): Use vec_setm_operand as operand 2 predicate. Call ix86_expand_vector_set_var for non-constant index operand. (vec_setv4qi): Use vec_setm_mmx_operand as operand 2 predicate. Call ix86_expand_vector_set_var for non-constant index operand. gcc/testsuite/ PR target/97194 * gcc.target/i386/sse4_1-vec-set-1a.c: New test. * gcc.target/i386/sse4_1-vec-set-2a.c: Ditto.
2021-07-06Use H8 nop moves as tst insnsJeff Law2-4/+25
gcc * config/h8300/jumpcall.md (*branch): When possible, generate the comparison in CCZN mode. * config/h8300/predicates.md (simple_memory_operand): Reject all auto-increment addressing modes.
2021-07-06[Ada] Initialize Current_Error_NodeBob Duff1-1/+1
gcc/ada/ * atree.ads (Current_Error_Node): Initialize to Empty.
2021-07-06[Ada] Enable Ada 2020 Put_Image and Image support for tagged typesSteve Baird4-37/+74
gcc/ada/ * exp_put_image.adb: Eliminate references to Debug_Flag_Underscore_Z. Change the meaning of the function Enable_Put_Image. Previously, a result of False for a tagged type would mean that the type does not get a Put_Image (PI) routine at all. Now, it means that the type gets a PI routine with very abbreviated functionality (just a call to Unknown_Put_Image). This resolves problems in mixing code compiled with and without the -gnat2022 switch. * exp_ch3.adb: Enable_Put_Image no longer participates in determining whether a tagged type gets a Put_Image procedure. A tagged type does not get a Put_Image procedure if the type Root_Buffer_Type is unavailable. This is needed to support cross targets where tagged types are supported but the type Root_Buffer_Type is not available. * exp_dist.adb: Add workarounds for some problems that arise when using the (obsolete?) Garlic implementation of the distributed systems annex with Ada 2022 constructs. * libgnat/a-sttebu.ads: Workaround a bootstrapping problem. Older compilers do not support raise expressions, so revise the the Pre'Class condition to meet this requirement without changing the condition's behavior at run time.
2021-07-06[Ada] Fix old typo in commentEric Botcazou1-2/+2
gcc/ada/ * repinfo-input.adb (JSON_Entity_Kind, Read_Variant_Part): Fix typo in comment.
2021-07-06[Ada] Implement missing constraint checks for default streaming operationsSteve Baird2-19/+95
gcc/ada/ * sem_ch5.adb (Analyze_Assignment): Add new nested function, Omit_Range_Check_For_Streaming, and make call to Apply_Scalar_Range_Check conditional on the result of this new function. * exp_attr.adb (Compile_Stream_Body_In_Scope): Eliminate Check parameter, update callers. The new Omit_Range_Check_For_Streaming parameter takes the place of the old use of calling Insert_Action with Suppress => All_Checks, which was insufficiently precise (it did not allow suppressing checks for one component but not for another). (Expand_N_Attribute_Reference): Eliminate another "Suppress => All_Checks" from an Insert_Action call, this one in generating the expansion of a T'Read attribute reference for a composite type T.
2021-07-06[Ada] Warn on statically known empty loop caused by constraintGhjuvan Lacambre1-0/+26
gcc/ada/ * sem_ch5.adb (Analyze_Loop_Parameter_Specification): Check for empty loops caused by constraints.
2021-07-06[Ada] Handle malformed command line on Win32Nicolas Roche1-1/+17
gcc/ada/ * rtinit.c (skip_quoted_string): Handle malformed command line with no closing double quote. (skip_argument): Handle case in which a null character is encountered by skip_quote_string.
2021-07-06[Ada] Simplify code by removing local constantPiotr Trojanek1-3/+1
gcc/ada/ * uname.adb (Add_Node_Name): Replace local constant whose initial expression was evaluated even when unnecessary with just that expression that is evaluated at most once and only when needed.
2021-07-06[Ada] Replace a question mark comment with assertionPiotr Trojanek2-6/+4
gcc/ada/ * lib.adb (Remove_Unit): Replace defensive code with an assertion. * par-load.adb (Load): Address a question mark in the comment.
2021-07-06[Ada] Simplify returning from Enclosing_Comp_Unit_NodePiotr Trojanek1-5/+1
gcc/ada/ * sem_util.adb (Enclosing_Comp_Unit_Node): When the loop exits the Current_Node is either an N_Compilation_Unit node or Empty, so simply return it without redundant checks.
2021-07-06[Ada] Simplify unit loading with membership testsPiotr Trojanek5-36/+22
gcc/ada/ * lib-load.adb (Load_Unit): Remove excessive whitespace. * lib.adb (Is_Internal_Unit, Is_Predefined_Unit): Likewise. * par-ch10.adb (P_Compilation_Unit): Simplify with membership test. * par-load.adb (Load): Likewise. * uname.adb (Get_Unit_Name): Likewise.
2021-07-06[Ada] Simplify dependency on SystemPiotr Trojanek1-3/+1
gcc/ada/ * lib-writ.adb (Ensure_System_Dependency): Simplify by reusing a constant name.
2021-07-06[Ada] Fix bug in casing on composite values with -gnatXSteve Baird1-3/+11
gcc/ada/ * exp_ch5.adb (Expand_N_Case_Statement.Expand_General_Case_Statement.Pattern_Match): When generating an equality test for a statically known discrete value, only generate the numeric value if the discrete type is not an enumeration type. If it is an enumeration type, then call Get_Enum_Lit_From_Pos instead.
2021-07-06[Ada] Return_when_statement not working for non identifier return valuesJustin Squirek1-73/+61
gcc/ada/ * par-ch6.adb (Get_Return_Kind): Removed. (Is_Extended): Created to identify simple and "when" return statements from extended return statements. (P_Return_Statement): Merged simple and "when" return statement processing.
2021-07-06[Ada] Regression on overloaded prefixed calls related to prefixed-call extensionGary Dismukes1-2/+6
gcc/ada/ * sem_ch4.adb (Try_One_Prefix_Interpretation): Augment test of "not Extensions_Allowed" with test for absence of Obj_Type's primitive operations Elist, as an additional condition for early return from this procedure.
2021-07-06[Ada] Reformatting, typo corrections, and minor rewording of a comment.Gary Dismukes1-3/+3
gcc/ada/ * exp_ch4.adb (Process_Transient_In_Expression): In one comment, fix two typos and reorder wording of one sentence, plus minor reformatting.
2021-07-06[Ada] Spurious initialization of element iterators in "for of" loopsJustin Squirek1-53/+15
gcc/ada/ * exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove legacy expansion of element iterators, and use expansion form used by unconstrained element types in the general case.
2021-07-06[Ada] Crash on use of 'Img on record type in expressionEd Schonberg1-0/+10
gcc/ada/ * exp_ch4.adb (Process_Transient_In_Expression): Ensure that Fin_Context, used to insert finalization code for the expression, is a list member: the value returned by Find_Hook_Context may be an expression node when the transient is part of a larger expression and it has a non-boolean type.