Skip to content
Snippets Groups Projects
  1. Jan 09, 2024
    • Javier Miranda's avatar
      ada: Fix unsupported dispatching constructor call · 12f06156
      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.
      12f06156
    • Eric Botcazou's avatar
      Fix internal error on function call returning extension of limited interface · 275de350
      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.
      275de350
    • Eric Botcazou's avatar
      Fix internal error on anonymous access type equality · 13f8c71a
      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.
      13f8c71a
    • Eric Botcazou's avatar
      Fix segfault during delay slot scheduling pass · 6ddc3fe2
      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.
      6ddc3fe2
    • GCC Administrator's avatar
      Daily bump. · d4905489
      GCC Administrator authored
      d4905489
  2. Jan 08, 2024
    • Jonathan Wakely's avatar
      libstdc++: Add additional tests for std::format with wide strings · bf025a0e
      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.
      bf025a0e
    • Jonathan Wakely's avatar
      libstdc++: Implement P2909R4 ("Dude, where's my char?") for C++20 · c5ef02e5
      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)
      c5ef02e5
    • Georg-Johann Lay's avatar
      AVR: PR target/112952: Fix attribute "address", "io" and "io_low" · 5d0d592c
      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)
      5d0d592c
    • GCC Administrator's avatar
      Daily bump. · 6bc8ea8e
      GCC Administrator authored
      6bc8ea8e
  3. Jan 07, 2024
  4. Jan 06, 2024
    • Jonathan Wakely's avatar
      libstdc++: Do not use __is_convertible unconditionally [PR113241] · 4c665136
      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)
      4c665136
    • Jonathan Wakely's avatar
      libstdc++: Fix std::char_traits<C>::move [PR113200] · 22601c1c
      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)
      22601c1c
    • GCC Administrator's avatar
      Daily bump. · 7eb3a328
      GCC Administrator authored
      7eb3a328
  5. Jan 05, 2024
  6. Jan 04, 2024
  7. Jan 03, 2024
    • Patrick Palka's avatar
      libstdc++: testsuite: Reduce max_size_type.cc exec time [PR113175] · af767e0b
      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)
      af767e0b
    • GCC Administrator's avatar
      Daily bump. · 4ddb2e0a
      GCC Administrator authored
      4ddb2e0a
  8. Jan 02, 2024
  9. Jan 01, 2024
  10. Dec 31, 2023
  11. Dec 30, 2023
  12. Dec 29, 2023
  13. Dec 28, 2023
  14. Dec 27, 2023
    • Harald Anlauf's avatar
      Fortran: fix argument passing to CONTIGUOUS,TARGET dummy [PR97592] · 019abe7a
      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)
      019abe7a
    • GCC Administrator's avatar
      Daily bump. · a15ca809
      GCC Administrator authored
      a15ca809
  15. Dec 26, 2023
  16. Dec 25, 2023
  17. Dec 24, 2023
  18. Dec 23, 2023
    • YunQiang Su's avatar
      MIPS: Don't add nan2008 option for -mtune=native · abd8cd13
      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.
      abd8cd13
    • YunQiang Su's avatar
      MIPS: Put the ret to the end of args of reconcat [PR112759] · 63df7990
      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.
      63df7990
    • GCC Administrator's avatar
      Daily bump. · 9792ffb2
      GCC Administrator authored
      9792ffb2
  19. Dec 22, 2023
  20. Dec 21, 2023
  21. Dec 20, 2023
    • Eric Botcazou's avatar
      ada: Fix internal error on call with parameter of predicated subtype · 0251e558
      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.
      0251e558
    • Patrick Palka's avatar
      c++: value dependence of by-ref lambda capture [PR108975] · c563e5d6
      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)
      c563e5d6
    • GCC Administrator's avatar
      Daily bump. · bdf719a8
      GCC Administrator authored
      bdf719a8
  22. Dec 19, 2023
  23. Dec 18, 2023
    • Jakub Jelinek's avatar
      tree-object-size: Robustify alloc_size attribute handling [PR113013] · 2ea5a22b
      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)
      2ea5a22b
Loading