- Jan 09, 2024
-
-
Javier Miranda authored
Add dummy build-in-place parameters when a BIP function does not require the BIP parameters but it is a dispatching operation that inherited them. gcc/ada/ * einfo-utils.adb (Underlying_Type): Protect recursion call against non-available attribute Etype. * einfo.ads (Protected_Subprogram): Fix typo in documentation. * exp_ch3.adb (BIP_Function_Call_Id): New subprogram. (Expand_N_Object_Declaration): Improve code that evaluates if the object is initialized with a BIP function call. * exp_ch6.adb (Is_True_Build_In_Place_Function_Call): New subprogram. (Add_Task_Actuals_To_Build_In_Place_Call): Add dummy actuals if the function does not require the BIP task actuals but it is a dispatching operation that inherited them. (Build_In_Place_Formal): Improve code to avoid never-ending loop if the BIP formal is not found. (Add_Dummy_Build_In_Place_Actuals): New subprogram. (Expand_Call_Helper): Add calls to Add_Dummy_Build_In_Place_Actuals. (Expand_N_Extended_Return_Statement): Adjust assertion. (Expand_Simple_Function_Return): Adjust assertion. (Make_Build_In_Place_Call_In_Allocator): No action needed if the called function inherited the BIP extra formals but it is not a true BIP function. (Make_Build_In_Place_Call_In_Assignment): Ditto. * exp_intr.adb (Expand_Dispatching_Constructor_Call): Remove code reporting unsupported case (since this patch adds support for it). * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Adding assertion to ensure matching of BIP formals when setting the Protected_Formal field of a protected subprogram to reference the corresponding extra formal of the subprogram that implements it. (Might_Need_BIP_Task_Actuals): New subprogram. (Create_Extra_Formals): Improve code adding inherited extra formals.
-
Eric Botcazou authored
This is a regression present on the mainline and 13 branch, in the form of a series of internal errors (3) on a function call returning the extension of a limited interface. This is only a partial fix for the first two assertion failures; the third one is the most problematic and will be dealt with separately. The first issue is in Instantiate_Type, where we use Base_Type in a specific case to compute the ancestor of a derived type, which will later trigger the assertion on line 16960 of sem_ch3.adb since Parent_Base and Generic_Actual are the same node. This is changed to use Etype like in other cases around. The second issue is an unprotected use of Designated_Type on type T in Analyze_Explicit_Dereference, while another use in an equivalent context is guarded by Is_Access_Type a few lines above. gcc/ada PR ada/112781 * sem_ch12.adb (Instantiate_Type): Use Etype instead of Base_Type consistently to retrieve the ancestor for a derived type. * sem_ch4.adb (Analyze_Explicit_Dereference): Test Is_Access_Type consistently before accessing Designated_Type.
-
Eric Botcazou authored
This is a small regression present on the mainline and 13 branch, in the form of an internal error in gigi on anonymous access type equality. We now need to also accept them for anonymous access types that point to compatible object subtypes in the language sense. gcc/ada/ * gcc-interface/utils2.cc (build_binary_op) <EQ_EXPR>: Relax assertion for regular pointer types. gcc/testsuite/ * gnat.dg/specs/anon4.ads: New test.
-
Eric Botcazou authored
This is a small regression present on the mainline and 13 branch, although the underlying problem has probably been there for ages, in the form of a segfault during the delay slot scheduling pass, for a function that falls through to exit without any instruction generated for the end of function. gcc/ PR rtl-optimization/113140 * reorg.cc (fill_slots_from_thread): If we are to branch after the last instruction of the function, create an end label. gcc/testsuite/ * g++.dg/opt/delay-slot-2.C: New test.
-
GCC Administrator authored
-
- Jan 08, 2024
-
-
Jonathan Wakely authored
Backport the extra tests from r14-3300-g023a62b77f999b. libstdc++-v3/ChangeLog: * testsuite/std/format/functions/format.cc: Add more checks for wstring formatting of arithmetic types.
-
Jonathan Wakely authored
This change ensures that char and wchar_t arguments are formatted consistently when using integer presentation types. This avoids non-portable std::format output that depends on whether char and wchar_t happen to be signed or unsigned on the target. Formatting '\xff' as an integer will now always format 255 and not sometimes -1. This was approved in Kona 2023 as a DR for C++20 so the change is implemented unconditionally. Also make character formatters check for _Pres_c explicitly and call _M_format_character directly. This avoid the overhead of calling format and _S_to_character and then calling _M_format_character anyway. libstdc++-v3/ChangeLog: * include/std/format (formatter<C, C>::format): Check for _Pres_c and call _M_format_character directly. Cast C to its unsigned equivalent for formatting as an integer. (formatter<char, wchar_t>::format): Likewise. (basic_format_arg(T&)): Store char arguments as unsigned char for formatting to a wide string. (__cpp_lib_format_uchar): Define. * include/std/version (__cpp_lib_format_uchar): Define. * testsuite/std/format/functions/format.cc: Adjust test. Check formatting of characters using all integer presentation types. (cherry picked from commit 74a0dab1)
-
Georg-Johann Lay authored
so they work with all combinations of -f[no-]data-sections -f[no-]common. The patch also improves some diagnostics and adds additional checks, for example these attributes must only be applied to variables in static storage. gcc/ PR target/112952 * config/avr/avr.cc (avr_handle_addr_attribute): Also print valid range when diagnosing attribute "io" and "io_low" are out of range. (avr_eval_addr_attrib): Don't ICE on empty address at that place. (avr_insert_attributes): Reject if attribute "address", "io" or "io_low" in contexts other than static storage. (avr_asm_output_aligned_decl_common): Move output of decls with attribute "address", "io", and "io_low" to... (avr_output_addr_attrib): ...this new function. (avr_asm_asm_output_aligned_bss): Remove output for decls with attribute "address", "io", and "io_low". (avr_encode_section_info): Rectify handling of decls with attribute "address", "io", and "io_low". gcc/testsuite/ PR target/112952 * gcc.target/avr/attribute-io.h: New file. * gcc.target/avr/pr112952-0.c: New test. * gcc.target/avr/pr112952-1.c: New test. * gcc.target/avr/pr112952-2.c: New test. * gcc.target/avr/pr112952-3.c: New test. (cherry picked from commit c131b1d5)
-
GCC Administrator authored
-
- Jan 07, 2024
-
-
GCC Administrator authored
-
- Jan 06, 2024
-
-
Jonathan Wakely authored
The new __is_convertible built-in should only be used after checking that it's supported. libstdc++-v3/ChangeLog: PR libstdc++/113241 * include/std/type_traits (is_convertible_v): Guard use of built-in with preprocessor check. (cherry picked from commit 57fa5b60)
-
Jonathan Wakely authored
The current constexpr implementation of std::char_traits<C>::move relies on being able to compare the pointer parameters, which is not allowed for unrelated pointers. We can use __builtin_constant_p to determine whether it's safe to compare the pointers directly. If not, then we know the ranges must be disjoint and so we can use char_traits<C>::copy to copy forwards from the first character to the last. If the pointers can be compared directly, then we can simplify the condition for copying backwards to just two pointer comparisons. libstdc++-v3/ChangeLog: PR libstdc++/113200 * include/bits/char_traits.h (__gnu_cxx::char_traits::move): Use __builtin_constant_p to check for unrelated pointers that cannot be compared during constant evaluation. * testsuite/21_strings/char_traits/requirements/113200.cc: New test. (cherry picked from commit 15cc2918)
-
GCC Administrator authored
-
- Jan 05, 2024
-
-
GCC Administrator authored
-
- Jan 04, 2024
-
-
GCC Administrator authored
-
- Jan 03, 2024
-
-
Patrick Palka authored
The adjustment to max_size_type.cc in r14-205-g83470a5cd4c3d2 inadvertently increased the execution time of this test by over 5x due to making the two main loops actually run in the signed_p case instead of being dead code. To compensate, this patch cuts the relevant loops' range [-1000,1000] by 10x as proposed in the PR. This shouldn't significantly weaken the test since the same important edge cases are still checked in the smaller range and/or elsewhere. On my machine this reduces the test's execution time by roughly 10x (and 1.6x relative to before r14-205). PR testsuite/113175 libstdc++-v3/ChangeLog: * testsuite/std/ranges/iota/max_size_type.cc (test02): Reduce 'limit' to 100 from 1000 and adjust 'log2_limit' accordingly. (test03): Likewise. (cherry picked from commit a138b996)
-
GCC Administrator authored
-
- Jan 02, 2024
-
-
GCC Administrator authored
-
- Jan 01, 2024
-
-
GCC Administrator authored
-
- Dec 31, 2023
-
-
GCC Administrator authored
-
- Dec 30, 2023
-
-
GCC Administrator authored
-
- Dec 29, 2023
-
-
GCC Administrator authored
-
- Dec 28, 2023
-
-
GCC Administrator authored
-
- Dec 27, 2023
-
-
Harald Anlauf authored
gcc/fortran/ChangeLog: PR fortran/97592 * trans-expr.cc (gfc_conv_procedure_call): For a contiguous dummy with the TARGET attribute, the effective argument may still be contiguous even if the actual argument is not simply-contiguous. Allow packing to be decided at runtime by _gfortran_internal_pack. gcc/testsuite/ChangeLog: PR fortran/97592 * gfortran.dg/contiguous_15.f90: New test. (cherry picked from commit 5060825a)
-
GCC Administrator authored
-
- Dec 26, 2023
-
-
GCC Administrator authored
-
- Dec 25, 2023
-
-
GCC Administrator authored
-
- Dec 24, 2023
-
-
GCC Administrator authored
-
- Dec 23, 2023
-
-
YunQiang Su authored
Users may wish just use -mtune=native for performance tuning only. Let's don't make trouble for its case. gcc/ * config/mips/driver-native.cc (host_detect_local_cpu): don't add nan2008 option for -mtune=native.
-
YunQiang Su authored
The function `reconcat` cannot append string(s) to NULL, as the concat process will stop at the first NULL. Let's always put the `ret` to the end, as it may be NULL. We keep use reconcat here, due to that reconcat can make it easier if we add more hardware features detecting, for example by hwcap. gcc/ PR target/112759 * config/mips/driver-native.cc (host_detect_local_cpu): Put the ret to the end of args of reconcat.
-
GCC Administrator authored
-
- Dec 22, 2023
-
-
GCC Administrator authored
-
- Dec 21, 2023
-
-
GCC Administrator authored
-
- Dec 20, 2023
-
-
Eric Botcazou authored
The problem is that the predicated subtype does not inherit all the required attributes of a string subtype with a static predicate. gcc/ada/ * sem_ch3.adb (Analyze_Subtype_Declaration): Remove a short-circuit for subtypes without aspects when it comes to predicates. * sem_util.adb (Inherit_Predicate_Flags): Deal with private subtypes whose full view is an Itype.
-
Patrick Palka authored
We are still ICEing on the generic lambda version of the testcase from this PR, even after r13-6743-g6f90de97634d6f, due to the by-ref capture of the constant local variable 'dim' being considered value-dependent when regenerating the lambda (at which point processing_template_decl is set since the lambda is generic), which prevents us from constant folding its uses. Later during prune_lambda_captures we end up not thoroughly walking the body of the lambda and overlook the (non-folded) uses of 'dim' within the array bound and using-decls. We could fix this by making prune_lambda_captures walk the body of the lambda more thoroughly so that it finds these uses of 'dim', but ideally we should be able to constant fold all uses of 'dim' ahead of time and prune the implicit capture after all. To that end this patch makes value_dependent_expression_p return false for such by-ref captures of constant local variables, allowing their uses to get constant folded ahead of time. It seems we just need to disable the predicate's conservative early exit for reference variables (added by r5-5022-g51d72abe5ea04e) when DECL_HAS_VALUE_EXPR_P. This effectively makes us treat by-value and by-ref captures more consistently when it comes to value dependence. PR c++/108975 gcc/cp/ChangeLog: * pt.cc (value_dependent_expression_p) <case VAR_DECL>: Suppress conservative early exit for reference variables when DECL_HAS_VALUE_EXPR_P. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/lambda/lambda-const11a.C: New test. (cherry picked from commit 3d674e29)
-
GCC Administrator authored
-
- Dec 19, 2023
-
-
Richard Biener authored
PR sanitizer/111736 * asan.cc (asan_protect_global): Do not protect globals in non-generic address-space. (cherry picked from commit 7e404978)
-
Jakub Jelinek authored
Apparently when looking for "signbit<mode>2" vector expanders, I've only looked at sse.md and forgot mmx.md, which has another one and the following patch still ICEd. 2023-12-19 Jakub Jelinek <jakub@redhat.com> PR target/112816 * config/i386/mmx.md (signbitv2sf2): Force operands[1] into a REG. * gcc.target/i386/sse2-pr112816-2.c: New test. (cherry picked from commit 80e1375e)
-
GCC Administrator authored
-
- Dec 18, 2023
-
-
Jakub Jelinek authored
The following testcase ICEs because we aren't careful enough with alloc_size attribute. We do check that such an argument exists (although wouldn't handle correctly functions with more than INT_MAX arguments), but didn't check that it is scalar integer, the ICE is trying to fold_convert a structure to sizetype. Given that the attribute can also appear on non-prototyped functions where the arguments aren't known, I don't see how the FE could diagnose that and because we already handle the case where argument doesn't exist, I think we should also verify the argument is scalar integer convertible to sizetype. Furthermore, given this is not just in diagnostics but used for code generation, I think it is better to punt on arguments with larger precision then sizetype, the upper bits are then truncated. The patch also fixes some formatting issues and avoids duplication of the fold_convert, plus removes unnecessary check for if (arg1 >= 0), that is always the case after if (arg1 < 0) return ...; 2023-12-18 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/113013 * tree-object-size.cc (alloc_object_size): Return size_unknown if corresponding argument(s) don't have integral type or have integral type with higher precision than sizetype. Don't check arg1 >= 0 uselessly. Compare argument indexes against gimple_call_num_args in unsigned type rather than int. Formatting fixes. * gcc.dg/pr113013.c: New test. (cherry picked from commit 5347263b)
-