aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-05-23ada: Fix resolution of mod operator of System.Storage_ElementsEric Botcazou2-8/+26
This operator is special because the left operand is of Address type while the right operand and the result are of Storage_Offset type (but we raise Constraint_Error if the right operand is not positive) and it needs to be resolved to the type of the left operand to implement the correct semantics. gcc/ada/ * exp_ch4.adb (Expand_N_Op_Mod): Adjust the detection of the special operator of System.Storage_Elements. Do not rewrite it into a rem. * sem_res.adb (Resolve_Intrinsic_Operator): Use the base type of the left operand for the special mod operator of System.Storage_Elements
2023-05-23ada: Remove unnecessary call to Detach.Vadim Godunko1-4/+0
Holder object is constant and protected from modification by tampering rules. gcc/ada/ * libgnat/a-coinho__shared.adb (Constant_Reference): Remove call of Detach (Query_Element): Likewise.
2023-05-23ada: Fix reference to Ada issue in commentRonan Desplanques1-1/+1
gcc/ada/ * sem_disp.adb: Fix reference to Ada issue in comment.
2023-05-23ada: Fix address arithmetic issues in the expanded codeEric Botcazou1-32/+37
This is most notably the addition of addresses in Expand_Interface_Thunk. There is also a small change to Expand_Dispatching_Call, which was directly accessing a class-wide interface object as a tag, thus giving rise later to unchecked conversions between either the root or the equivalent record type and access types. gcc/ada/ * exp_disp.adb (Expand_Dispatching_Call): In the abstract interface class-wide case, use 'Tag of the object as the controlling tag. (Expand_Interface_Thunk): Perform address arithmetic using operators of System.Storage_Elements.
2023-05-23ada: Fix address arithmetic issues in the runtimeEric Botcazou4-24/+26
This is most notably the addition of addresses in Interfaces.C.Pointers and System.Bitfield_Utils. There is also a change to System.Stream_Attributes, which was representing a thin pointer as a record, which is not problematic per se, but is in the end, because the expanded code performs an unchecked conversion from it to the access type instead of accessing the component. gcc/ada/ * libgnat/i-cpoint.adb: Add clauses for System.Storage_Elements. (Addr): Delete. (Offset): New subtype of Storage_Offset. (To_Offset): New instance of Unchecked_Conversion. (To_Pointer): Adjust. (To_Addr): Likewise. (To_Ptrdiff): Likewise. ("+"): Call To_Offset on the offset. ("-"): Likewise. * libgnat/s-bituti.adb: Add clauses for System.Storage_Elements. (Val_Bytes): Change type to Storage_Count. (Get_Val_2): Add qualification to second operand of mod operator. (Set_Val_2): Likewise. (Copy_Bitfield): Likewise. Change type of Src_Adjust & Dest_Adjust. * libgnat/s-stratt.ads (Thin_Pointer): Change to subtype of Address. * libgnat/s-statxd.adb (I_AD): Adjust. (I_AS): Likewise. (W_AS): Likewise.
2023-05-23ada: A discriminant of a variable is not a variableSteve Baird1-5/+2
gcc/ada/ * sem_util.adb (Is_Variable): Correctly return False for a selected component name of the form Some_Object.Some_Discriminant, even if Some_Object is a variable. We don't want to allow such a name as an actual parameter in a call if the corresponding formal parameter's mode is not "in".
2023-05-23ada: Add default value at initialization for CodePeerYannick Moy1-1/+2
Avoid spurious alarm by CodePeer analysis by adding default value for a variable initialization. gcc/ada/ * sem_util.adb (Check_Node): Add default init on local Id.
2023-05-23ada: Facilitate proof of Interfaces.C.To_AdaYannick Moy1-0/+1
Nightly runs of GNATprove fail on proof of the assertion following the loop. Add a loop invariant to facilitate that proof. gcc/ada/ * libgnat/i-c.adb (To_Ada): Add loop invariant.
2023-05-23ada: Remove the body of System.Storage_ElementsEric Botcazou8-137/+75
All the subprograms declared in the unit have convention Intrinsic and their current implementation makes some implicit assumptions that are not valid universally, so it is replaced by a direct expansion. This is mostly straightforward because Resolve_Intrinsic_Operator already contains the required circuitry, but a few adjustements are necessary. gcc/ada/ * exp_ch4.adb (Expand_N_Op_Mod): Deal with the special mod operator of System.Storage_Elements. * exp_intr.adb (Expand_To_Integer): New procedure. (Expand_Intrinsic_Call): Call Expand_To_Integer appropriately. (Expand_To_Address): Deal with an argument with modular type. * sem_ch3.adb (Derive_Subprogram): Also set convention Intrinsic on a derived intrinsic subprogram. * sem_res.adb (Resolve_Arithmetic_Op): Deal with intrinsic operators not coming from source exactly as those coming from source and also generate a reference in both cases. (Resolve_Op_Expon): Likewise. (Resolve_Intrinsic_Operator): Call Implementation_Base_Type to get a nonprivate base type. * snames.ads-tmpl (Name_To_Integer): New intrinsic name. * libgnat/s-stoele.ads: Replace pragma Convention with pragma Import throughout and remove pragma Inline_Always and Pure_Function. * libgnat/s-stoele.adb: Replace entire contents with pragma No_Body. * libgnat/s-atacco.adb: Adjust comment about pragma No_Body.
2023-05-23ada: Spurious errors on class-wide preconditions of private typesJavier Miranda2-14/+14
The compiler reports spurious errors processing the class-wide preconditions of a dispatching primitive of a private type T, when the class-wide precondition invokes another dispatching primitive of T that has the same name as a record component of T. gcc/ada/ * sem_prag.adb (Analyze_Pre_Post_Condition_In_Decl_Part): Remove call to preanalyze class-wide conditions since here it is too early; they must be preanalyzed when full views of private types have been analyzed. * sem_ch7.adb (Analyze_Package_Specification): Preanalyze class-wide conditions of dispatching primitives defined in nested packages.
2023-05-23ada: Turn assertions into defensive code in error locationsPiotr Trojanek1-28/+61
We pretty-print numeric literals that do not come from source by relying on their Sloc. This generally works well, but sporadically the Sloc is set wrongly. We might want to trace and fix such occurrences, but for now it is simpler to replace an otherwise reasonable assertions with defensive code. gcc/ada/ * errout.adb (Last_Sloc): Refactor a heavily repeated "S := S + 1" statement into a subprogram; replace assertions with defensive code; fix few more off-by-one errors.
2023-05-23ada: Add mention of what LSP stands forRonan Desplanques1-1/+2
There are multiple possible interpretations of "LSP". For example, "Language Server Protocol". This patch clarifies that the occurrences of "LSP" in GNAT's source code refer to the Liskov Substitution Principle. gcc/ada/ * einfo.ads: Mention full name of LSP.
2023-05-23ada: Fix endings of pretty-printed numeric literalsPiotr Trojanek1-17/+113
When looking for the end of an numeric literal we consumed '+' and '-' characters, because they might appear in the exponent part. This was too aggressive when they separated the number from the subsequent operand, like in "123+456". Now we skip past numeric literals by strictly following their grammar and only consume '+' and '-' when they belong to the exponent. gcc/ada/ * errout.adb (Last_Sloc): Rewrite skipping past numeric literals.
2023-05-23ada: Fix internal error on quantified expression with predicated typeEric Botcazou3-14/+40
The problem is that the special function created by the compiler to check the predicate does not inherit the public status of the type, because it is generated as part of the freezing of the quantified expression, which occurs from within a couple of intermediate internal scopes. gcc/ada/ * sem_ch13.adb (Build_Predicate_Function_Declaration): Adjust the commentary to the current implementation. * sem_util.ads (Current_Scope_No_Loops): Move around. (Current_Scope_No_Loops_No_Blocks): New declaration. (Add_Block_Identifier): Fix formatting. * sem_util.adb (Add_Block_Identifier): Likewise. (Current_Scope_No_Loops_No_Blocks): New function. (Set_Public_Status): Call Current_Scope_No_Loops_No_Blocks instead of Current_Scope to get the current scope.
2023-05-23ada: Fix bogus error on predicated limited record declared in protected typeEric Botcazou2-22/+10
This happens when the limited record is initialized with a function call because of a couple of issues: incorrect tree sharing when building the predicate check and too late freezing for a compiler-generated subtype. It turns out that building the predicate check manually is redundant here, since predicate checks are automatically generated during the expansion of assignment statements, and the late freezing can be easily fixed. gcc/ada/ * exp_ch3.adb (Build_Record_Init_Proc.Build_Assignment): Do not manually generate a predicate check. Call Unqualify before doing pattern matching on the expression. * sem_ch3.adb (Analyze_Object_Declaration): Also freeze the actual subtype when it is built in the definite case.
2023-05-23ada: Sync different variants of interrupt handler registrationPiotr Trojanek4-70/+56
This patch propagates the apparently cleanest solutions between various variants of the runtime units for interrupt handler registration. In particular, the unnecessary default expressions for list cells with interrupt handler addresses are removed, the list is changed from doubly-linked to singly-linked, and assertion preventing registration of null addresses now appears in all runtimes. Effectively, it is just a code cleanup and minor optimization; behavior of the runtime unit is unaffected. gcc/ada/ * libgnarl/s-interr.adb (Registered_Handler): Remove default expression. (Registered_Handlers): Switch to singly-linked list. (Bind_Interrupt_To_Entry): Sync whitespace with other unit variants. (Is_Registered): Use singly-linked list. (Register_Interrupt_Handler): Use singly-linked list and initialized allocator; sync assertion with other unit variants. * libgnarl/s-interr__sigaction.adb: Likewise. * libgnarl/s-interr__vxworks.adb: Likewise. * libgnarl/s-interr__hwint.adb: Likewise. (Is_Registered): Remove repeated declaration.
2023-05-23ada: Revert to old pretty-printing of internal entities for CodePeerPiotr Trojanek1-3/+19
Add some defensive code to get pretty-printed CodePeer outputs for ACATS back to shape. At least some of this code appears to be redundant and perhaps unnecessary, but we can this up later. Expression pretty-printer should not be called with N_Defining_Identifier nodes at all, since they are not expressions. However, for those that come not from source, CodePeer expects that the Ident_Image routine will convert the internal names like "xL" to their corresponding human-readable representation like "x'Accesibility_Level". gcc/ada/ * pprint.adb (Expression_Image): Restore some of the old pretty-printing for CodePeer.
2023-05-23ada: Ignore accessibility actuals in expression pretty-printerPiotr Trojanek1-0/+18
Extra actual parameters for accessibility checks are confusing for the expression pretty-printer that is used by CodePeer. It seems that nodes created for the accessibility checks should use the Sloc of the source expression of accessibility checks, not the target. However, this is problematic to achieve with the current implementation of accessibility checks, so with this patch we will simply ignore the accessibility actuals when computing Slocs for expression pretty-printing. gcc/ada/ * errout.adb (First_And_Last_Nodes): Ignore accessibility parameters.
2023-05-23ada: Remove special-case for parentheses in expansion for GNATprovePiotr Trojanek1-8/+0
When expanding of inequality operators for GNAT we were adding extra parens, supposedly to "fix Sprint output" (source print); for GNATprove we didn't, as these extra parens were leading to wrong columns for check messages. Adding these extra parens couldn't be a right, because Sprint should produce reasonable output regardless of the parens, especially since we don't care about parens when creating AST in expansion. Avoiding them for GNATprove couldn't be right either, because source printing should work regardless of the GNAT/GNATprove mode. The proper fix for GNAT is rather to not add parens at all and tune source printing, if necessary. The proper fix for GNATprove is not have them either, as it confuses the heuristic in First_Sloc, which is then used by Compute_Sloc. gcc/ada/ * exp_ch4.adb (Expand_N_Op_Ne): Simply don't add extra parens.
2023-05-23ada: Transfer fix for pretty-printed parentheses from GNATprove to GNATPiotr Trojanek1-1/+69
Expressions with parentheses are notoriously problematic to pretty-print. In GNATprove we had a post-processing fix for them, but it is better to have this fix in the GNAT frontend repository and apply it for CodePeer as well. gcc/ada/ * pprint.adb (Expression_Image): Move Count_Parentheses and Fix_Parentheses routines from GNATprove and apply them before returning the slice of a source code buffer.
2023-05-23ada: Fix expression pretty-printer for SPARK counterexamplesPiotr Trojanek3-335/+146
The expression pretty-printer that is used for SPARK counterexamples was essentially duplicating the logic of First_Node/Last_Node and First_Sloc/Last_Sloc routines. Now it simply reuses those routines. gcc/ada/ * errout.adb (Paren_Required): New subsidiary routine for better handling of parentheses in First_Node/Last_Node. (First_Sloc, Last_Sloc): Use Get_Source_File_Index to correctly handle generic instances and inlined subprograms; tune handling of parentheses; improve handling of literals. * pprint.adb (Expression_Image): Simplify using First_Sloc/Last_Sloc. * sem_ch6.adb (Analyze_Expression_Function): Remove parenthesis when relocating expression from expression function to simple return statement.
2023-05-23ada: Suppress warning about Subprogram_Variant failing at run timePiotr Trojanek1-0/+7
Warning about check failing at run time is likely spurious for mutually recursive subprograms with multiple variant clauses. These will be non-trivial to detect, so we simply suppress the warning altogether for all subprogram variants. gcc/ada/ * exp_prag.adb (Expand_Pragma_Check): Suppress warning for checks of subprogram variants.
2023-05-23ada: Small code cleanupEric Botcazou1-13/+8
This just merges two conditional blocks depending on the same condition. gcc/ada/ * frontend.adb (Frontend): Merge two conditional blocks and adjust.
2023-05-23ada: Minor fix typo in commentPiotr Trojanek1-1/+1
Spotted while reviewing a patch with a similar typo. gcc/ada/ * libgnat/s-mmap.adb (Mapped_Region_Record): Fix typo in comment.
2023-05-23ada: Remove duplicate commentRonan Desplanques1-4/+0
gcc/ada/ * sem_ch7.adb: Remove duplicate comment.
2023-05-23ada: Crash on dispatching primitive referencing limited-with typeJavier Miranda1-0/+158
The compiler crashes processing a compilation unit has limited-with context clauses, and the profile of some dispatching primitive references a type visible through a limited-with clause, and the dispatching primitive has class-wide preconditions. gcc/ada/ * sem_ch10.adb (Analyze_Required_Limited_With_Units): New subprogram. (Depends_On_Limited_Views): New subprogram. (Has_Limited_With_Clauses): New subprogram. (Analyze_Compilation_Unit): Call the new subprogram that performs the full analysis of required limited-with units.
2023-05-23libstdc++: Add missing constexpr to simdMatthias Kretz6-250/+418
The constexpr API is only available with -std=gnu++XX (and proposed for C++26). The proposal is to have the complete simd API usable in constant expressions. This patch resolves several issues with using simd in constant expressions. Issues why constant_evaluated branches are necessary: * subscripting vector builtins is not allowed in constant expressions * if the implementation needs/uses memcpy * if the implementation would otherwise call SIMD intrinsics/builtins Signed-off-by: Matthias Kretz <m.kretz@gsi.de> libstdc++-v3/ChangeLog: PR libstdc++/109261 * include/experimental/bits/simd.h (_SimdWrapper::_M_set): Avoid vector builtin subscripting in constant expressions. (resizing_simd_cast): Avoid memcpy if constant_evaluated. (const_where_expression, where_expression, where) (__extract_part, simd_mask, _SimdIntOperators, simd): Add either _GLIBCXX_SIMD_CONSTEXPR (on public APIs), or constexpr (on internal APIs). * include/experimental/bits/simd_builtin.h (__vector_permute) (__vector_shuffle, __extract_part, _GnuTraits::_SimdCastType1) (_GnuTraits::_SimdCastType2, _SimdImplBuiltin) (_MaskImplBuiltin::_S_store): Add constexpr. (_CommonImplBuiltin::_S_store_bool_array) (_SimdImplBuiltin::_S_load, _SimdImplBuiltin::_S_store) (_SimdImplBuiltin::_S_reduce, _MaskImplBuiltin::_S_load): Add constant_evaluated case. * include/experimental/bits/simd_fixed_size.h (_S_masked_load): Reword comment. (__tuple_element_meta, __make_meta, _SimdTuple::_M_apply_r) (_SimdTuple::_M_subscript_read, _SimdTuple::_M_subscript_write) (__make_simd_tuple, __optimize_simd_tuple, __extract_part) (__autocvt_to_simd, _Fixed::__traits::_SimdBase) (_Fixed::__traits::_SimdCastType, _SimdImplFixedSize): Add constexpr. (_SimdTuple::operator[], _M_set): Add constexpr and add constant_evaluated case. (_MaskImplFixedSize::_S_load): Add constant_evaluated case. * include/experimental/bits/simd_scalar.h: Add constexpr. * include/experimental/bits/simd_x86.h (_CommonImplX86): Add constexpr and add constant_evaluated case. (_SimdImplX86::_S_equal_to, _S_not_equal_to, _S_less) (_S_less_equal): Value-initialize to satisfy constexpr evaluation. (_MaskImplX86::_S_load): Add constant_evaluated case. (_MaskImplX86::_S_store): Add constexpr and constant_evaluated case. Value-initialize local variables. (_MaskImplX86::_S_logical_and, _S_logical_or, _S_bit_not) (_S_bit_and, _S_bit_or, _S_bit_xor): Add constant_evaluated case. * testsuite/experimental/simd/pr109261_constexpr_simd.cc: New test.
2023-05-23Use delete[] in int_range destructor [PR109920]Aldy Hernandez1-1/+1
gcc/ChangeLog: PR tree-optimization/109920 * value-range.h (RESIZABLE>::~int_range): Use delete[].
2023-05-23Fortran: Fix assumed length chars and len inquiry [PR103716]Paul Thomas3-1/+20
2023-05-23 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/103716 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an element should be done for all characters without a len expr, not just deferred lens, and for integer expressions. * trans-expr.cc (conv_inquiry): For len and kind inquiry refs, set the se string_length to NULL_TREE. gcc/testsuite/ PR fortran/103716 * gfortran.dg/pr103716.f90 : New test.
2023-05-23Fortran: Allow declaration of finalizable DT in a submodule [PR97122]Paul Thomas2-33/+48
2023-05-23 Paul Thomas <pault@gcc.gnu.org> Steven G. Kargl <kargl@gcc.gnu.org> gcc/fortran PR fortran/97122 * decl.cc (variable_decl): Clean up white space issues. (gfc_match_final_decl): Declaration of finalizable derived type is allowed in a submodule. gcc/testsuite/ PR fortran/97122 * gfortran.dg/finalize_8.f03 : Replace testcase that checks declaration of finalizable derived types in submodules works.
2023-05-23Daily bump.GCC Administrator6-1/+458
2023-05-22libobjc: Add local macros to support encode generation [P109913].Iain Sandoe1-0/+5
r14-976-g9907413a3a6aa3 alters code to use the preferred _P-style macros rather than direct comparisons of (for example) tree codes. In the context of libobjc this does not work, since we do not include the relevant headers; the encoding implementation contains a local emulation of the target type layouts. The fix here provides relevant macros local to the use. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR libobjc/109913 libobjc/ChangeLog: * encoding.c (RECORD_OR_UNION_TYPE_P, VECTOR_TYPE_P): New. Co-authored-by: Andrew Pinski <apinski@marvell.com>
2023-05-22i386: Adjust emulated integer vector mode shift costsUros Bizjak2-36/+66
Returned integer vector mode costs of emulated instructions in ix86_shift_rotate_cost are wrong and do not reflect generated instruction sequences. Rewrite handling of different integer vector modes and different target ABIs to return real instruction counts in order to calcuate better costs of various emulated modes. Also add the cost of a memory read, when the instruction in the sequence reads memory. gcc/ChangeLog: * config/i386/i386.cc (ix86_shift_rotate_cost): Correct calcuation of integer vector mode costs to reflect generated instruction sequences of different integer vector modes and different target ABIs. Remove "speed" function argument. (ix86_rtx_costs): Update call for removed function argument. (ix86_vector_costs::add_stmt_cost): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/sse2-shiftqihi-constant-1.c: Remove XFAILs.
2023-05-22Implement some miscellaneous zero accessors for Value_Range.Aldy Hernandez1-0/+3
This adds some missing accessors to the type agnostic Value_Range class. They'll be used in the upcoming IPA work. gcc/ChangeLog: * value-range.h (class Value_Range): Implement set_zero, set_nonzero, and nonzero_p.
2023-05-22testsuite/52641: Fix more of implicit int=32 assumption fallout.Georg-Johann Lay31-24/+68
gcc/testsuite/ PR testsuite/52641 * gcc.c-torture/compile/pr108892.c: Require int32. * gcc.c-torture/compile/pr98199.c: Require int32plus. * gcc.dg/analyzer/call-summaries-pr107072.c: Same. * gcc.dg/analyzer/null-deref-pr105755.c: Same. * gcc.dg/tree-ssa/pr102232.c: Same. * gcc.dg/tree-ssa/pr105860.c: Same. * gcc.dg/tree-ssa/pr96730.c: Same. * gcc.dg/tree-ssa/pr96779-disabled.c: Same. * gcc.dg/tree-ssa/pr96779.c: Same. * gcc.dg/tree-ssa/pr98513.c: Same. * gcc.dg/tree-ssa/ssa-sink-18.c * gcc.dg/analyzer/coreutils-cksum-pr108664.c: Require int32plus, size24plus. * gcc.dg/analyzer/doom-s_sound-pr108867.c: Require size32plus. * gcc.dg/analyzer/malloc-CWE-590-examples.c: Same. * gcc.dg/debug/btf/btf-bitfields-4.c: Same. * gcc.dg/tree-ssa/pr93435.c: Same. * gcc.dg/analyzer/null-deref-pr102671-1.c: Require ptr_eq_long: * gcc.dg/analyzer/null-deref-pr102671-2.c: Same. * gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c: Same. * gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c: Same. * gcc.dg/tree-ssa/pr103345.c: Use uint32_t. * gcc.dg/tree-ssa/ssa-ccp-41.c [sizeof(int)==2]: Same. * gcc.dg/tree-ssa/pr109031-1.c: Use uint16_t, uint32_t. * gcc.dg/tree-ssa/pr109031-2.c: Same. * gcc.dg/Warray-bounds-49.c (dg-warning): Discriminate int != short. * gcc.dg/Warray-bounds-52.c (dg-warning): Discriminate avr. * gcc.dg/Warray-bounds-33.c: Skip target avr. * gcc.dg/analyzer/fd-access-mode-target-headers.c: Same. * gcc.dg/analyzer/flex-with-call-summaries.c: Same. * gcc.dg/analyzer/isatty-1.c: Same. * gcc.dg/analyzer/pipe-glibc.c: Same.
2023-05-22libstdc++: Resolve -Wunused-variable warnings in stdx::simd and testsMatthias Kretz6-5/+17
Signed-off-by: Matthias Kretz <m.kretz@gsi.de> libstdc++-v3/ChangeLog: * include/experimental/bits/simd_builtin.h (_S_fpclassify): Move __infn into #ifdef'ed block. * testsuite/experimental/simd/tests/fpclassify.cc: Declare constants only when used. * testsuite/experimental/simd/tests/frexp.cc: Likewise. * testsuite/experimental/simd/tests/logarithm.cc: Likewise. * testsuite/experimental/simd/tests/trunc_ceil_floor.cc: Likewise. * testsuite/experimental/simd/tests/ldexp_scalbn_scalbln_modf.cc: Move totest and expect1 into #ifdef'ed block.
2023-05-22testsuite/52641: Fix tests that fail for 16-bit int / pointer targets.Georg-Johann Lay15-2/+18
gcc/testsuite/ PR testsuite/52641 * c-c++-common/pr19807-2.c: Use __SIZEOF_INT__ instead of 4. * gcc.c-torture/compile/pr103813.c: Require size32plus. * gcc.c-torture/execute/pr108498-2.c: Same. * gcc.c-torture/compile/pr96426.c: Condition on __SIZEOF_LONG_LONG__ == __SIZEOF_DOUBLE__. * gcc.c-torture/execute/pr103417.c: Require int32plus. * gcc.dg/pr104198.c: Same. * gcc.dg/pr21137.c: Same. * gcc.dg/pr88905.c: Same. * gcc.dg/pr90838.c: Same. * gcc.dg/pr97317.c: Same. * gcc.dg/pr100292.c: Require int32. * gcc.dg/pr101008.c: Same. * gcc.dg/pr96542.c: Same. * gcc.dg/pr96674.c: Same. * gcc.dg/pr97750.c: Require ptr_eq_long.
2023-05-22i386: Account for the memory read in V*QImode multiplication sequencesUros Bizjak1-8/+23
Add the cost of a memory read to the cost of V*QImode vector mult sequences. gcc/ChangeLog: * config/i386/i386.cc (ix86_multiplication_cost): Add the cost of a memory read to the cost of V?QImode sequences.
2023-05-22Skip some tests that won't work for target AVR.Georg-Johann Lay21-1/+22
gcc/testsuite/ * lib/target-supports.exp (check_effective_target_lra) [avr]: Return 0. * gcc.dg/pr19402-2.c: Skip for avr. * gcc.dg/pr86124.c: Same. * gcc.dg/pr94291.c: Same. * gcc.dg/torture/builtin-complex-1.c: Same. * gcc.dg/torture/fp-int-convert-float32x-timode.c: Same. * gcc.dg/torture/fp-int-convert-float32x.c: Same. * gcc.dg/torture/fp-int-convert-float64-timode.c: Same. * gcc.dg/torture/fp-int-convert-float64.c: Same. * gcc.dg/torture/fp-int-convert-long-double.c: Same. * gcc.dg/torture/fp-int-convert-timode.c: Same. * c-c++-common/torture/builtin-convertvector-1.c: Same. * c-c++-common/torture/complex-sign-add.c: Same. * c-c++-common/torture/complex-sign-mixed-add.c: Same. * c-c++-common/torture/complex-sign-mixed-div.c: Same. * c-c++-common/torture/complex-sign-mixed-mul.c: Same. * c-c++-common/torture/complex-sign-mixed-sub.c: Same. * c-c++-common/torture/complex-sign-mul-minus-one.c: Same. * c-c++-common/torture/complex-sign-mul-one.c: Same. * c-c++-common/torture/complex-sign-mul.c: Same. * c-c++-common/torture/complex-sign-sub.c: Same.
2023-05-22RISC-V: Add "m_" prefix for private memberJuzhe-Zhong1-12/+12
Since the current framework is hard to maintain and hard to be used in the future possible auto-vectorization patterns. We will need to keep adding more helpers and arguments during the auto-vectorization supporting. We should refactor the framework now for the future use since the we don't support too much auto-vectorization patterns for now. Start with this simple patch, this patch is adding "m_" prefix for private the members. gcc/ChangeLog: * config/riscv/riscv-v.cc: Add "m_" prefix. Signed-off-by: Juzhe-Zhong <juzhe.zhong@rivai.ai>
2023-05-22RISC-V: Fix typo of multiple_rgroup-2.hJuzhe-Zhong1-1/+1
Just notice this following fail in the regression: FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-2.c (test for excess errors) FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-2.c (test for excess errors) Signed-off-by: Juzhe-Zhong <juzhe.zhong@rivai.ai> gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-2.h: Fix typo
2023-05-22ada: Reuse idiomatic procedure in CStandRonan Desplanques1-2/+1
This change replaces a call to Set_Name_Entity_Id with a call to the higher-level Set_Current_Entity. gcc/ada/ * cstand.adb: Use more idiomatic procedure.
2023-05-22ada: Avoid repeated calls when looking for first/last slocs of a nodePiotr Trojanek1-16/+18
gcc/ada/ * errout.adb (First_Loc): Avoid repeated calls. (Last_Loc): Likewise.
2023-05-22ada: Small cleanup in support for protected subprogramsEric Botcazou2-59/+49
This moves the propagation of the Uses_Sec_Stack flag, from the original to the rewritten subprogram, to the point where the latter is expanded, along with the propagation of the Has_Nested_Subprogram flag, as well as addresses a ??? comment in the same block of code. No functional changes. gcc/ada/ * inline.adb (Cleanup_Scopes): Do not propagate the Uses_Sec_Stack flag from original to rewritten protected subprograms here... * exp_ch9.adb (Expand_N_Protected_Body) <N_Subprogram_Body>: ...but here instead. Add local variables and remove a useless test.
2023-05-22ada: Use idiomatic construct in Expand_N_Package_BodyEric Botcazou1-10/+1
gcc/ada/ * exp_ch7.adb (Expand_N_Package_Body): Call Defining_Entity to get the entity of the body.
2023-05-22ada: Fix source location for crashes in expanded Loop_Entry attributesPiotr Trojanek1-6/+4
Historically, Loop_Entry attributes were expanded while expanding their corresponding loops, so it was easier to use location of these loops for expanded code. Now, these attributes are expanded where they appear, so we can easily use the location of the attribute reference for expanded code. This matters when there is a crash in the expanded code, e.g. because of a stack overflow in the declaration of an constant object that captures the Loop_Entry prefix. Now backtrace will point to the source location of the attribute, which is more helpful than the location of the loop. gcc/ada/ * exp_attr.adb (Expand_Loop_Entry_Attribute): Use location of the attribute reference, not of the loop statement.
2023-05-22ada: Add missing word in commentRonan Desplanques1-1/+1
gcc/ada/ * par-ch3.adb: Add missing word in comment.
2023-05-22ada: Incorrect constant folding in postcondition involving 'OldJustin Squirek1-1/+12
The following patch fixes an issue in the compiler whereby certain flavors of access comparisons may be incorrectly constant-folded out of contract expressions - notably in postcondition expressions featuring a reference to 'Old. gcc/ada/ * checks.adb (Install_Null_Excluding_Check): Avoid non-null optimizations when assertions are enabled.
2023-05-22ada: Fix crash caused by incorrect expansion of iterated componentMarc Poulhiès2-2/+13
The way iterated component are expanded could lead to inconsistent tree. This change fixes 2 issues: - in an early step during Pre_Analyze, the loop variable still has Any_Type and the compiler must not emit an error. A later full Analyze is supposed to correctly set the Etype, and only then should the compiler emit an error if Any_Type is still used. - when expanding into a loop with assignments statement, the expression is analyzed in an early context (where the loop variable still has Any_Type Etype) and then copied. The compiler would crash because this Any_Type is never changed because the expression node has its Analyzed flag set. Resetting the flag ensures the later Analyze call also analyzes these nodes and set Etype correctly. gcc/ada/ * exp_aggr.adb (Process_Transient_Component): Reset Analyzed flag for the copy of the initialization expression. * sem_attr.adb (Validate_Non_Static_Attribute_Function_Call): Skip error emission during Pre_Analyze.
2023-05-22ada: Fix missing finalization in separate package bodyEric Botcazou1-22/+37
This directly comes from a loophole in the implementation. gcc/ada/ * exp_ch7.adb (Process_Package_Body): New procedure taken from... (Build_Finalizer.Process_Declarations): ...here. Call the above procedure to deal with both package bodies and package body stubs.