]> gcc.gnu.org Git - gcc.git/log
gcc.git
21 months agoc++: cast to array of unknown bound [PR93259]
Jason Merrill [Mon, 12 Sep 2022 18:14:24 +0000 (14:14 -0400)]
c++: cast to array of unknown bound [PR93259]

We already know to treat a variable of array-of-unknown-bound type as
dependent, we should do the same for arr{}.

PR c++/93259

gcc/cp/ChangeLog:

* pt.cc (type_dependent_expression_p): Treat a compound
literal of array-of-unknown-bound type like a variable.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/initlist-array17.C: New test.

21 months agoc++: auto member function and auto variable [PR106893]
Jason Merrill [Mon, 12 Sep 2022 17:47:34 +0000 (13:47 -0400)]
c++: auto member function and auto variable [PR106893]

As with PR105623, we need to call mark_single_function sooner to
resolve the type of a BASELINK.

PR c++/106893
PR c++/90451

gcc/cp/ChangeLog:

* decl.cc (cp_finish_decl): Call mark_single_function.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1y/auto-fn65.C: New test.

21 months agolibstdc++: Add already-accepted <ranges> testcase [PR106320]
Patrick Palka [Mon, 12 Sep 2022 19:05:04 +0000 (15:05 -0400)]
libstdc++: Add already-accepted <ranges> testcase [PR106320]

Although PR106320 affected only the 10 and 11 branches, and the testcase
from there is already correctly accepted on trunk and the 12 branch, we
still should add the testcase to trunk/12 too for inter-branch consistency.

PR libstdc++/106320

libstdc++-v3/ChangeLog:

* testsuite/std/ranges/adaptors/join.cc (test13): New test.

(cherry picked from commit db19cfdac8ede93172aecc58612171c239c993ad)

21 months agoDaily bump.
GCC Administrator [Mon, 12 Sep 2022 00:21:14 +0000 (00:21 +0000)]
Daily bump.

21 months agoDaily bump.
GCC Administrator [Sun, 11 Sep 2022 00:21:06 +0000 (00:21 +0000)]
Daily bump.

21 months agoDaily bump.
GCC Administrator [Sat, 10 Sep 2022 00:21:31 +0000 (00:21 +0000)]
Daily bump.

21 months agotree-optimization/106860 - fix profile scaling in split_loop
Richard Biener [Wed, 7 Sep 2022 08:44:33 +0000 (10:44 +0200)]
tree-optimization/106860 - fix profile scaling in split_loop

The following fixes a mistake in loop splitting which assumes loop
latches have a single predecessor and that edge is from the exit
test.  Instead work from the single exit edge we have to find the
edge towards the latch.

PR tree-optimization/106860
* tree-ssa-loop-split.cc (split_loop): Find the exit to
latch edge from the loop exit edge instead of from the
latch.  Verify we're going to find it.

* g++.dg/opt/pr106860.C: New testcase.

(cherry picked from commit 0386609923577e07354ee63754795b2f729e7e00)

21 months agotree-optimization/106841 - gather and hybrid SLP
Richard Biener [Tue, 6 Sep 2022 08:08:44 +0000 (10:08 +0200)]
tree-optimization/106841 - gather and hybrid SLP

Hybrid SLP detection currently fails to consider a not direct
offset operand of a scatter/gather operation.  The following fixes
this.

PR tree-optimization/106841
* tree-vect-slp.cc (vect_detect_hybrid_slp): Also process
scatter/gather offset.

* g++.dg/vect/pr106841.cc: New testcase.

(cherry picked from commit e33e61d417eb5e981bb7d709f8681a2f55ed518a)

21 months agotree-optimization/106809 - compile time hog in VN
Richard Biener [Fri, 2 Sep 2022 11:36:13 +0000 (13:36 +0200)]
tree-optimization/106809 - compile time hog in VN

The dominated_by_p_w_unex function is prone to high compile time.
With GCC 12 we introduced a VN run for uninit diagnostics which now
runs into a degenerate case with bison generated code.  Fortunately
this case is easy to fix with a simple extra check - a more
general fix needs more work.

PR tree-optimization/106809
* tree-ssa-sccvn.cc (dominaged_by_p_w_unex): Check we have
more than one successor before doing extra work.

* gcc.dg/torture/pr106809.c: New testcase.

(cherry picked from commit be1b42de9c151d46c89f9a8f82d4c5839a19ea94)

21 months agoDaily bump.
GCC Administrator [Fri, 9 Sep 2022 00:22:17 +0000 (00:22 +0000)]
Daily bump.

21 months agoRTEMS: Add -mvrsave multilibs
Sebastian Huber [Thu, 1 Sep 2022 08:22:47 +0000 (10:22 +0200)]
RTEMS: Add -mvrsave multilibs

gcc/ChangeLog:

* config/rs6000/rtems.h (CPP_OS_DEFAULT_SPEC): Define __PPC_VRSAVE__ if
-mvrsave is present.
* config/rs6000/t-rtems: Add -mvrsave multilib variants for
-mcpu=e6500.

21 months agoDaily bump.
GCC Administrator [Thu, 8 Sep 2022 00:22:43 +0000 (00:22 +0000)]
Daily bump.

21 months agolibstdc++: Fix for explicit copy ctors in <thread> and <future> [PR106695]
Jonathan Wakely [Mon, 22 Aug 2022 14:42:17 +0000 (15:42 +0100)]
libstdc++: Fix for explicit copy ctors in <thread> and <future> [PR106695]

When I changed std::thread and std::async to avoid unnecessary move
construction of temporaries, I introduced a regression where types with
an explicit copy constructor could not be passed to std::thread or
std::async. The fix is to add a constructor instead of using aggregate
initialization of an unnamed temporary.

libstdc++-v3/ChangeLog:

PR libstdc++/106695
* include/bits/std_thread.h (thread::_State_impl): Forward
individual arguments to _Invoker constructor.
(thread::_Invoker): Add constructor. Delete copies.
* include/std/future (__future_base::_Deferred_state): Forward
individual arguments to _Invoker constructor.
(__future_base::_Async_state_impl): Likewise.
* testsuite/30_threads/async/106695.cc: New test.
* testsuite/30_threads/thread/106695.cc: New test.

(cherry picked from commit 5abe0657553580bd1b7488dd84d55138a8d9f23c)

21 months agolibstdc++: Check for overflow in regex back-reference [PR106607]
Jonathan Wakely [Mon, 22 Aug 2022 14:16:16 +0000 (15:16 +0100)]
libstdc++: Check for overflow in regex back-reference [PR106607]

Currently we fail to notice integer overflow when parsing a
back-reference expression, or when converting the parsed result from
long to int. This changes the result to be int, so no conversion is
needed, and uses the overflow-checking built-ins to detect an
out-of-range back-reference.

libstdc++-v3/ChangeLog:

PR libstdc++/106607
* include/bits/regex_compiler.tcc (_Compiler::_M_cur_int_value):
Use built-ins to check for integer overflow in back-reference
number.
* testsuite/28_regex/basic_regex/106607.cc: New test.

(cherry picked from commit 1b09eea33f2bf9d1eae73b25cc25efb05ea1dc3f)

21 months agoDaily bump.
GCC Administrator [Wed, 7 Sep 2022 00:21:15 +0000 (00:21 +0000)]
Daily bump.

21 months agoDaily bump.
GCC Administrator [Tue, 6 Sep 2022 00:20:21 +0000 (00:20 +0000)]
Daily bump.

21 months agoFortran: Fix ICE with -fcheck=pointer [PR100136]
José Rui Faustino de Sousa [Sun, 4 Sep 2022 19:53:09 +0000 (21:53 +0200)]
Fortran: Fix ICE with -fcheck=pointer [PR100136]

gcc/fortran/ChangeLog:

PR fortran/100136
* trans-expr.cc (gfc_conv_procedure_call): Add handling of pointer
expressions.

gcc/testsuite/ChangeLog:

PR fortran/100136
* gfortran.dg/PR100136.f90: New test.

(cherry picked from commit 20d30e737ad79dc36817e59f1676aa8bc0c6b325)

21 months agoDaily bump.
GCC Administrator [Mon, 5 Sep 2022 00:20:45 +0000 (00:20 +0000)]
Daily bump.

21 months agoDaily bump.
GCC Administrator [Sun, 4 Sep 2022 00:20:49 +0000 (00:20 +0000)]
Daily bump.

21 months agors6000: Don't ICE when we disassemble an MMA variable [PR101322]
Peter Bergner [Thu, 1 Sep 2022 02:14:36 +0000 (21:14 -0500)]
rs6000: Don't ICE when we disassemble an MMA variable [PR101322]

When we expand an MMA disassemble built-in with C++ using a pointer that
is cast to a valid MMA type, the type isn't passed down to the expand
machinery and we end up using the base type of the pointer which leads to
an ICE.  This patch enforces we always use the correct MMA type regardless
of the pointer type being used.

2022-08-31  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR target/101322
* config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_mma_builtin):
Enforce the use of a valid MMA pointer type.

gcc/testsuite/
PR target/101322
* g++.target/powerpc/pr101322.C: New test.

(cherry picked from commit 2985049049f12b0aa3366ca244d387820385b9e8)

21 months agoDaily bump.
GCC Administrator [Sat, 3 Sep 2022 00:20:51 +0000 (00:20 +0000)]
Daily bump.

21 months agocselib: add function to check if SET is redundant [PR106187]
Richard Earnshaw [Wed, 3 Aug 2022 09:01:51 +0000 (10:01 +0100)]
cselib: add function to check if SET is redundant [PR106187]

A SET operation that writes memory may have the same value as an
earlier store but if the alias sets of the new and earlier store do
not conflict then the set is not truly redundant.  This can happen,
for example, if objects of different types share a stack slot.

To fix this we define a new function in cselib that first checks for
equality and if that is successful then finds the earlier store in the
value history and checks the alias sets.

The routine is used in two places elsewhere in the compiler:
cfgcleanup and postreload.

gcc/ChangeLog:

PR rtl-optimization/106187
* alias.h (mems_same_for_tbaa_p): Declare.
* alias.cc (mems_same_for_tbaa_p): New function.
* dse.cc (record_store): Use it instead of open-coding
alias check.
* cselib.h (cselib_redundant_set_p): Declare.
* cselib.cc: Include alias.h
(cselib_redundant_set_p): New function.
* cfgcleanup.cc: (mark_effect): Use cselib_redundant_set_p instead
of rtx_equal_for_cselib_p.
* postreload.cc (reload_cse_simplify): Use cselib_redundant_set_p.
(reload_cse_noop_set_p): Delete.

(cherry picked from commit 64ce76d940501cb04d14a0d36752b4f93473531c)

21 months agoarm: correctly handle misaligned MEMs on MVE [PR105463]
Richard Earnshaw [Wed, 11 May 2022 12:08:40 +0000 (13:08 +0100)]
arm: correctly handle misaligned MEMs on MVE [PR105463]

Vector operations in MVE must be aligned to the element size, so if we
are asked for a misaligned move in a wider mode we must recast it to a
form suitable for the known alignment (larger elements have better
address offset ranges, so there is some advantage to using wider
element sizes if possible).  Whilst fixing this, also rework the
predicates used for validating operands - the Neon predicates are
not right for MVE.

gcc/ChangeLog:

PR target/105463
* config/arm/mve.md (*movmisalign<mode>_mve_store): Use
mve_memory_operand.
(*movmisalign<mode>_mve_load): Likewise.
* config/arm/vec-common.md (movmisalign<mode>): Convert to generator
form...
(@movmisalign<mode>): ... thus.  Use generic predicates and then
rework operands if they are not valid.  For MVE rework to a
narrower element size if the alignment is not high enough.

(cherry picked from commit 6a116728e27c4da65d84483c0e75561a7479d4d5)

21 months agoAArch64: Fix bootstrap failure due to dump_printf_loc format attribute uses [PR106782]
Tamar Christina [Thu, 1 Sep 2022 21:04:57 +0000 (22:04 +0100)]
AArch64: Fix bootstrap failure due to dump_printf_loc format attribute uses [PR106782]

This fixes the bootstrap failure on AArch64 following -Werror=format by
correcting the print format modifiers in the backend.

gcc/ChangeLog:

PR other/106782
* config/aarch64/aarch64.cc
(aarch64_vector_costs::prefer_unrolled_loop): Replace %u with
HOST_WIDE_INT_PRINT_UNSIGNED.

(cherry picked from commit b98c5262d02c13cdbbf3b985859b436adec94d90)

21 months agoDaily bump.
GCC Administrator [Fri, 2 Sep 2022 00:19:58 +0000 (00:19 +0000)]
Daily bump.

21 months agoFix up dump_printf_loc format attribute and adjust uses [PR106782]
Jakub Jelinek [Thu, 1 Sep 2022 09:07:44 +0000 (11:07 +0200)]
Fix up dump_printf_loc format attribute and adjust uses [PR106782]

As discussed on IRC, the r13-2299-g68c61c2daa1f bug only got missed
because dump_printf_loc had incorrect format attribute and therefore
almost no -Wformat=* checking was performed on it.
3, 0 are suitable for function with (whatever, whatever, const char *, va_list)
arguments, not for (whatever, whatever, const char *, ...), that one should
use 3, 4.

There are 3 spots where the mismatch was worse though, two using %u or %d
for unsigned HOST_WIDE_INT argument and one %T for enum argument (promoted
to int) and this backport just fixes those spots.

2022-09-01  Jakub Jelinek  <jakub@redhat.com>

PR other/106782
* tree-vect-slp.cc (vect_print_slp_tree): Use
HOST_WIDE_INT_PRINT_UNSIGNED instead of %u.
* tree-vect-loop.cc (vect_estimate_min_profitable_iters): Use
HOST_WIDE_INT_PRINT_UNSIGNED instead of %d.
* tree-vect-slp-patterns.cc (vect_pattern_validate_optab): Use %G
instead of %T and STMT_VINFO_STMT (SLP_TREE_REPRESENTATIVE (node))
instead of SLP_TREE_DEF_TYPE (node).

(cherry picked from commit 953e08fde44a596e4ec2491efd15cd645e1ddc48)

21 months agoDaily bump.
GCC Administrator [Thu, 1 Sep 2022 00:20:56 +0000 (00:20 +0000)]
Daily bump.

21 months agoDaily bump.
GCC Administrator [Wed, 31 Aug 2022 00:19:54 +0000 (00:19 +0000)]
Daily bump.

21 months agoUpdate gcc sv.po
Joseph Myers [Tue, 30 Aug 2022 22:04:53 +0000 (22:04 +0000)]
Update gcc sv.po

* sv.po: Update.

21 months agoFortran/OpenMP: Fix strictly structured blocks parsing
Tobias Burnus [Thu, 25 Aug 2022 06:34:03 +0000 (08:34 +0200)]
Fortran/OpenMP: Fix strictly structured blocks parsing

gcc/fortran/ChangeLog:

* parse.cc (parse_omp_structured_block): When parsing strictly
structured blocks, issue an error if the end-directive comes
before the 'end block'.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/strictly-structured-block-4.f90: New test.

(cherry picked from commit 33f24eb58748e9db7c827662753757c5c2217eb4)

21 months agoc++: __has_builtin gives the wrong answer [PR106759]
Marek Polacek [Mon, 29 Aug 2022 20:54:05 +0000 (16:54 -0400)]
c++: __has_builtin gives the wrong answer [PR106759]

We've supported __is_nothrow_constructible since r11-4386, but
names_builtin_p didn't know about it, so it gave the wrong answer for
 #if __has_builtin(__is_nothrow_constructible)
 ...
 #endif

I've tested all C++-only built-ins and only two were missing.

PR c++/106759

gcc/cp/ChangeLog:

* cp-objcp-common.cc (names_builtin_p): Handle RID_IS_NOTHROW_ASSIGNABLE
and RID_IS_NOTHROW_CONSTRUCTIBLE.

gcc/testsuite/ChangeLog:

* g++.dg/ext/has-builtin-1.C: New test.

(cherry picked from commit fe915f35b7d8dc768a2b977c09aa02f933e1d1e9)

21 months agosve: Fix fcmuo combine patterns [PR106524]
Tamar Christina [Fri, 12 Aug 2022 11:28:41 +0000 (12:28 +0100)]
sve: Fix fcmuo combine patterns [PR106524]

There's no encoding for fcmuo with zero.  This restricts the combine patterns
from accepting zero registers.

gcc/ChangeLog:

PR target/106524
* config/aarch64/aarch64-sve.md (*fcmuo<mode>_nor_combine,
*fcmuo<mode>_bic_combine): Don't accept comparisons against zero.

gcc/testsuite/ChangeLog:

PR target/106524
* gcc.target/aarch64/sve/pr106524.c: New test.

(cherry picked from commit f4ff20d464f90c85919ce2e7fa63e204dcda4e40)

21 months agoDaily bump.
GCC Administrator [Tue, 30 Aug 2022 00:20:18 +0000 (00:20 +0000)]
Daily bump.

21 months agors6000: Allow conversions of MMA pointer types [PR106017]
Peter Bergner [Sun, 28 Aug 2022 00:44:16 +0000 (19:44 -0500)]
rs6000: Allow conversions of MMA pointer types [PR106017]

GCC incorrectly disables conversions between MMA pointer types, which
are allowed with clang.  The original intent was to disable conversions
between MMA types and other other types, but pointer conversions should
have been allowed.  The fix is to just remove the MMA pointer conversion
handling code altogether.

gcc/
PR target/106017
* config/rs6000/rs6000.cc (rs6000_invalid_conversion): Remove handling
of MMA pointer conversions.

gcc/testsuite/
PR target/106017
* gcc.target/powerpc/pr106017.c: New test.

(cherry picked from commit 1ae1325f24cea1698b56e4299d95446a1f7b90a2)

21 months agox86: Cast stride to __PTRDIFF_TYPE__ in AMX intrinsics
H.J. Lu [Thu, 18 Aug 2022 21:17:33 +0000 (14:17 -0700)]
x86: Cast stride to __PTRDIFF_TYPE__ in AMX intrinsics

On 64-bit Windows, long is 32 bits and can't be used as stride in memory
operand when base is a pointer which is 64 bits.  Cast stride to
__PTRDIFF_TYPE__, instead of long.

PR target/106714
* config/i386/amxtileintrin.h (_tile_loadd_internal): Cast to
__PTRDIFF_TYPE__.
(_tile_stream_loadd_internal): Likewise.
(_tile_stored_internal): Likewise.

(cherry picked from commit aeb9b58225916bc84a0cd02c6fc77bbb92167e53)

21 months agofortran: Expand ieee_arithmetic module's ieee_value inline [PR106579]
Jakub Jelinek [Fri, 26 Aug 2022 07:56:19 +0000 (09:56 +0200)]
fortran: Expand ieee_arithmetic module's ieee_value inline [PR106579]

The following patch expands IEEE_VALUE function inline in the FE,
but only for the powerpc64le-linux IEEE quad real(kind=16) case.

2022-08-26  Jakub Jelinek  <jakub@redhat.com>

PR fortran/106579
* trans-intrinsic.cc: Include realmpfr.h.
(conv_intrinsic_ieee_value): New function.
(gfc_conv_ieee_arithmetic_function): Handle ieee_value.

(cherry picked from commit 0c2d6aa1be2ea85e751852834986ae52d58134d3)

21 months agofortran: Expand ieee_arithmetic module's ieee_class inline [PR106579]
Jakub Jelinek [Fri, 26 Aug 2022 07:52:02 +0000 (09:52 +0200)]
fortran: Expand ieee_arithmetic module's ieee_class inline [PR106579]

The following patch expands IEEE_CLASS inline in the FE but only for the
powerpc64le-linux IEEE quad real(kind=16), using the __builtin_fpclassify
builtin and explicit check of the MSB mantissa bit in place of missing
__builtin_signbit builtin.

2022-08-26  Jakub Jelinek  <jakub@redhat.com>

PR fortran/106579
gcc/fortran/
* f95-lang.cc (gfc_init_builtin_functions): Initialize
BUILT_IN_FPCLASSIFY.
* libgfortran.h (IEEE_OTHER_VALUE, IEEE_SIGNALING_NAN,
IEEE_QUIET_NAN, IEEE_NEGATIVE_INF, IEEE_NEGATIVE_NORMAL,
IEEE_NEGATIVE_DENORMAL, IEEE_NEGATIVE_SUBNORMAL,
IEEE_NEGATIVE_ZERO, IEEE_POSITIVE_ZERO, IEEE_POSITIVE_DENORMAL,
IEEE_POSITIVE_SUBNORMAL, IEEE_POSITIVE_NORMAL, IEEE_POSITIVE_INF):
New enum.
* trans-intrinsic.cc (conv_intrinsic_ieee_class): New function.
(gfc_conv_ieee_arithmetic_function): Handle ieee_class.
libgfortran/
* ieee/ieee_helper.c (IEEE_OTHER_VALUE, IEEE_SIGNALING_NAN,
IEEE_QUIET_NAN, IEEE_NEGATIVE_INF, IEEE_NEGATIVE_NORMAL,
IEEE_NEGATIVE_DENORMAL, IEEE_NEGATIVE_SUBNORMAL,
IEEE_NEGATIVE_ZERO, IEEE_POSITIVE_ZERO, IEEE_POSITIVE_DENORMAL,
IEEE_POSITIVE_SUBNORMAL, IEEE_POSITIVE_NORMAL, IEEE_POSITIVE_INF):
Move to gcc/fortran/libgfortran.h.

(cherry picked from commit db630423a97ec6690a8eb0e5c3cb186c91e3740d)

21 months agoi386: Fix up mode iterators that weren't expanded [PR106721]
Jakub Jelinek [Wed, 24 Aug 2022 07:57:09 +0000 (09:57 +0200)]
i386: Fix up mode iterators that weren't expanded [PR106721]

Currently, when md file reader sees <something> and something is valid mode
(or code) attribute but which doesn't include case for the current mode
(or code), it just keeps the <something> untouched.
I went through all cases matching <[a-zA-Z] in tmp-mddump.md after make mddump.
One of the cases was related to the V*HF mode additions and there was one typo.

2022-08-24  Jakub Jelinek  <jakub@redhat.com>

PR target/106721
* config/i386/sse.md (i128vldq): Add V16HF entry.
(avx512er_vmrcp28<mode><mask_name><round_saeonly_name>): Fix typo,
mask_opernad3 -> mask_operand3.

(cherry picked from commit 846e5c009e360f0c4fe58ff0d3aee03ebe3ca1a9)

21 months agoc++: Implement P2327R1 - De-deprecating volatile compound operations
Jakub Jelinek [Tue, 16 Aug 2022 11:15:32 +0000 (13:15 +0200)]
c++: Implement P2327R1 - De-deprecating volatile compound operations

From what I can see, this has been voted in as a DR and as it means
we warn less often than before in -std={gnu,c}++2{0,3} modes or with
-Wvolatile, I wonder if it shouldn't be backported to affected release
branches as well.

2022-08-16  Jakub Jelinek  <jakub@redhat.com>

* typeck.cc (cp_build_modify_expr): Implement
P2327R1 - De-deprecating volatile compound operations.  Don't warn
for |=, &= or ^= with volatile lhs.
* expr.cc (mark_use) <case MODIFY_EXPR>: Adjust warning wording,
leave out simple.

* g++.dg/cpp2a/volatile1.C: Adjust for de-deprecation of volatile
compound |=, &= and ^= operations.
* g++.dg/cpp2a/volatile3.C: Likewise.
* g++.dg/cpp2a/volatile5.C: Likewise.

(cherry picked from commit 6e790ca4615443fa395ac5cdba1ab6c87810985c)

21 months agoifcvt: Fix up noce_convert_multiple_sets [PR106590]
Jakub Jelinek [Mon, 15 Aug 2022 11:56:57 +0000 (13:56 +0200)]
ifcvt: Fix up noce_convert_multiple_sets [PR106590]

The following testcase is miscompiled on x86_64-linux.
The problem is in the noce_convert_multiple_sets optimization.
We essentially have:
if (g == 1)
  {
    g = 1;
    f = 23;
  }
else
  {
    g = 2;
    f = 20;
  }
and for each insn try to create a conditional move sequence.
There is code to detect overlap with the regs used in the condition
and the destinations, so we actually try to construct:
tmp_g = g == 1 ? 1 : 2;
f = g == 1 ? 23 : 20;
g = tmp_g;
which is fine.  But, we actually try to create two different
conditional move sequences in each case, seq1 with the whole
(eq (reg/v:HI 82 [ g ]) (const_int 1 [0x1]))
condition and seq2 with cc_cmp
(eq (reg:CCZ 17 flags) (const_int 0 [0]))
to rely on the earlier present comparison.  In each case, we
compare the rtx costs and choose the cheaper sequence (seq1 if both
have the same cost).
The problem is that with the skylake tuning,
tmp_g = g == 1 ? 1 : 2;
is actually expanded as
tmp_g = (g == 1) + 1;
in seq1 (which clobbers (reg 17 flags)) and as a cmov in seq2
(which doesn't).  The tuning says both have the same cost, so we
pick seq1.  Next we check sequences for
f = g == 1 ? 23 : 20; and here the seq2 cmov is cheaper, but it
uses (reg 17 flags) which has been clobbered earlier.

The following patch fixes that by detecting if we in the chosen
sequence clobber some register mentioned in cc_cmp or rev_cc_cmp,
and if yes, arranges for only seq1 (i.e. sequences that emit the
comparison itself) to be used after that.

2022-08-15  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/106590
* ifcvt.cc (check_for_cc_cmp_clobbers): New function.
(noce_convert_multiple_sets_1): If SEQ sets or clobbers any regs
mentioned in cc_cmp or rev_cc_cmp, don't consider seq2 for any
further conditional moves.

* gcc.dg/torture/pr106590.c: New test.

(cherry picked from commit 3a74a7bf62f47ed0d19866576378724be932ee17)

21 months agoDaily bump.
GCC Administrator [Mon, 29 Aug 2022 00:19:40 +0000 (00:19 +0000)]
Daily bump.

21 months agoDaily bump.
GCC Administrator [Sun, 28 Aug 2022 00:19:37 +0000 (00:19 +0000)]
Daily bump.

21 months agoDaily bump.
GCC Administrator [Sat, 27 Aug 2022 00:20:00 +0000 (00:20 +0000)]
Daily bump.

21 months agoFortran: improve error recovery while simplifying size of bad array [PR103694]
Harald Anlauf [Tue, 23 Aug 2022 20:16:14 +0000 (22:16 +0200)]
Fortran: improve error recovery while simplifying size of bad array [PR103694]

gcc/fortran/ChangeLog:

PR fortran/103694
* simplify.cc (simplify_size): The size expression of an array cannot
be simplified if an error occurs while resolving the array spec.

gcc/testsuite/ChangeLog:

PR fortran/103694
* gfortran.dg/pr103694.f90: New test.

(cherry picked from commit 55d8c5409325001c89c35c3d04d425dec9127146)

21 months agoDon't gimple fold ymm-version vblendvpd/vblendvps/vpblendvb w/o TARGET_AVX2
liuhongt [Mon, 22 Aug 2022 02:41:16 +0000 (10:41 +0800)]
Don't gimple fold ymm-version vblendvpd/vblendvps/vpblendvb w/o TARGET_AVX2

Since 256-bit vector integer comparison is under TARGET_AVX2,
and gimple folding for vblendvpd/vblendvps/vpblendvb relies on that.
Restrict gimple fold condition to TARGET_AVX2.

gcc/ChangeLog:

PR target/106704
* config/i386/i386-builtin.def (BDESC): Add
CODE_FOR_avx_blendvpd256/CODE_FOR_avx_blendvps256 to
corresponding builtins.
* config/i386/i386.cc (ix86_gimple_fold_builtin):
Don't fold IX86_BUILTIN_PBLENDVB256, IX86_BUILTIN_BLENDVPS256,
IX86_BUILTIN_BLENDVPD256 w/o TARGET_AVX2.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr106704.c: New test.

21 months agoDaily bump.
GCC Administrator [Fri, 26 Aug 2022 00:19:49 +0000 (00:19 +0000)]
Daily bump.

21 months agoLoongArch: Fix pr106459 by use HWIT instead of 1UL.
Chenghua Xu [Wed, 24 Aug 2022 07:34:07 +0000 (15:34 +0800)]
LoongArch: Fix pr106459 by use HWIT instead of 1UL.

gcc/ChangeLog:

PR target/106459
* config/loongarch/loongarch.cc (loongarch_build_integer):
Use HOST_WIDE_INT.
* config/loongarch/loongarch.h (IMM_REACH): Likewise.
(HWIT_1U): New Defined.
(LU12I_OPERAND): Use HOST_WIDE_INT.
(LU32I_OPERAND): Likewise.
(LU52I_OPERAND): Likewise.
(HWIT_UC_0xFFF): Likwise.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/pr106459.c: New test.

(cherry picked from commit b169b67d7dafe2b786f87c31d6b2efc603fd880c)

21 months agoDaily bump.
GCC Administrator [Thu, 25 Aug 2022 00:19:50 +0000 (00:19 +0000)]
Daily bump.

21 months agolibstdc++: Fix visit<void>(v) for non-void visitors [PR106589]
Jonathan Wakely [Tue, 23 Aug 2022 14:46:16 +0000 (15:46 +0100)]
libstdc++: Fix visit<void>(v) for non-void visitors [PR106589]

The optimization for the common case of std::visit forgot to handle the
edge case of passing zero variants to a non-void visitor and converting
the result to void.

libstdc++-v3/ChangeLog:

PR libstdc++/106589
* include/std/variant (__do_visit): Handle is_void<R> for zero
argument case.
* testsuite/20_util/variant/visit_r.cc: Check std::visit<void>(v).

(cherry picked from commit e85bb1881e57e53306ede2a15f30d06480d69886)

21 months agovect: Don't allow vect_emulated_vector_p type in vectorizable_call [PR106322]
Kewen Lin [Tue, 16 Aug 2022 05:18:51 +0000 (00:18 -0500)]
vect: Don't allow vect_emulated_vector_p type in vectorizable_call [PR106322]

As PR106322 shows, in some cases for some vector type whose
TYPE_MODE is a scalar integral mode instead of a vector mode,
it's possible to obtain wrong target support information when
querying with the scalar integral mode.  For example, for the
test case in PR106322, on ppc64 32bit vectorizer gets vector
type "vector(2) short unsigned int" for scalar type "short
unsigned int", its mode is SImode instead of V2HImode.  The
target support querying checks umul_highpart optab with SImode
and considers it's supported, then vectorizer further generates
.MULH IFN call for that vector type.  Unfortunately it's wrong
to use SImode support for that vector type multiply highpart
here.

This patch is to teach vectorizable_call analysis not to allow
vect_emulated_vector_p type for both vectype_in and vectype_out
as Richi suggested.

PR tree-optimization/106322

gcc/ChangeLog:

* tree-vect-stmts.cc (vectorizable_call): Don't allow
vect_emulated_vector_p type for both vectype_in and vectype_out.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr106322.c: New test.
* gcc.target/powerpc/pr106322.c: New test.

(cherry picked from commit 5239e2bd48fb1e6a1d1b06a1bac49bee0a742e98)

21 months agors6000: Adjust mov optabs for opaque modes [PR103353]
Kewen.Lin [Tue, 16 Aug 2022 05:24:07 +0000 (00:24 -0500)]
rs6000: Adjust mov optabs for opaque modes [PR103353]

As PR103353 shows, we may want to continue to expand built-in
function __builtin_vsx_lxvp, even if we have already emitted
error messages about some missing required conditions.  As
shown in that PR, without one explicit mov optab on OOmode
provided, it would call emit_move_insn recursively.

So this patch is to allow the mov pattern to be generated during
expanding phase if compiler has already seen errors.

PR target/103353

gcc/ChangeLog:

* config/rs6000/mma.md (define_expand movoo): Move TARGET_MMA condition
check to preparation statements and add handlings for !TARGET_MMA.
(define_expand movxo): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/pr103353.c: New test.

(cherry picked from commit 9367e3a65f874dffc8f8a3b6760e77fd9ed67117)

21 months agoDaily bump.
GCC Administrator [Wed, 24 Aug 2022 00:20:08 +0000 (00:20 +0000)]
Daily bump.

21 months agolibstdc++: Document linker option for C++23 <stacktrace> [PR105678]
Jonathan Wakely [Mon, 22 Aug 2022 16:24:27 +0000 (17:24 +0100)]
libstdc++: Document linker option for C++23 <stacktrace> [PR105678]

libstdc++-v3/ChangeLog:

PR libstdc++/105678
* doc/xml/manual/using.xml: Document -lstdc++_libbacktrace
requirement for using std::stacktrace. Also adjust -frtti and
-fexceptions to document non-default (i.e. negative) forms.
* doc/html/*: Regenerate.

(cherry picked from commit cc4fa7a210b638d6a46f14dab17f2361389d18e1)

21 months agoUpdate gcc .po files
Joseph Myers [Tue, 23 Aug 2022 19:19:54 +0000 (19:19 +0000)]
Update gcc .po files

* be.po, da.po, de.po, el.po, es.po, fi.po, fr.po, hr.po, id.po,
ja.po, nl.po, ru.po, sr.po, sv.po, tr.po, uk.po, vi.po, zh_CN.po,
zh_TW.po: Update.

21 months agogcn/mkoffload: Cleanup temporary dbgobj file
Tobias Burnus [Tue, 23 Aug 2022 09:35:01 +0000 (11:35 +0200)]
gcn/mkoffload: Cleanup temporary dbgobj file

The file (suffix ".mkoffload.dbg.o") used to save the dbgobj data
data has to be passed to maybe_unlink for cleanup or -v -save-temps stderr
diagnostic. That was missed before.

This is a partial backport of commit r13-2125, "mkoffload: Cleanup
temporary omp_requires_file", only for GCN's mkoffload and its dbgobj
file as 'omp requires' is not supported on GCC 12 and, hence,
omp_requires_file does not exist on this branch.

gcc/ChangeLog:

* config/gcn/mkoffload.cc (main): Add dbgobj to files_to_cleanup.

(cherry picked from commit 713ec97e593bd4d9915a13bc4047f064fec0e24a)

21 months agoFortran: OpenMP fix declare simd inside modules and absent linear step [PR106566]
Tobias Burnus [Tue, 23 Aug 2022 09:29:23 +0000 (11:29 +0200)]
Fortran: OpenMP fix declare simd inside modules and absent linear step [PR106566]

Partial backport from commit r13-2093, only, as 'OpenMP 5.2 linear
clause syntax' is not on GCC 12.

gcc/fortran/ChangeLog:

PR fortran/106566
* openmp.cc (gfc_match_omp_declare_simd): Accept module procedures.

gcc/testsuite/ChangeLog:

PR fortran/106566
* gfortran.dg/gomp/declare-simd-6.f90: New test.

(cherry picked from commit 1513512ec7d0751cba30c9c8804f2be462acfb9b)

21 months agoOpenMP: Fix var replacement with 'simd' and linear-step vars [PR106548]
Tobias Burnus [Wed, 17 Aug 2022 13:45:56 +0000 (15:45 +0200)]
OpenMP: Fix var replacement with 'simd' and linear-step vars [PR106548]

gcc/ChangeLog:

PR middle-end/106548
* omp-low.cc (lower_rec_input_clauses): Use build_outer_var_ref
for 'simd' linear-step values that are variable.

libgomp/ChangeLog:

PR middle-end/106548
* testsuite/libgomp.c/linear-2.c: New test.

(cherry picked from commit d9c9424d2c4f7b25acfc00db0076a65882c8a99f)

21 months agoDaily bump.
GCC Administrator [Tue, 23 Aug 2022 00:19:56 +0000 (00:19 +0000)]
Daily bump.

21 months agoDaily bump.
GCC Administrator [Mon, 22 Aug 2022 00:19:53 +0000 (00:19 +0000)]
Daily bump.

21 months agoDaily bump.
GCC Administrator [Sun, 21 Aug 2022 00:29:41 +0000 (00:29 +0000)]
Daily bump.

21 months agoDaily bump.
GCC Administrator [Sat, 20 Aug 2022 00:19:56 +0000 (00:19 +0000)]
Daily bump.

21 months agoBump BASE-VER
Richard Biener [Fri, 19 Aug 2022 08:24:35 +0000 (10:24 +0200)]
Bump BASE-VER

* BASE-VER: Set to 12.2.1.

21 months agoUpdate ChangeLog and version files for release releases/gcc-12.2.0
Richard Biener [Fri, 19 Aug 2022 08:10:15 +0000 (08:10 +0000)]
Update ChangeLog and version files for release

21 months agoDaily bump.
GCC Administrator [Fri, 19 Aug 2022 00:22:38 +0000 (00:22 +0000)]
Daily bump.

22 months agoDaily bump.
GCC Administrator [Thu, 18 Aug 2022 00:20:26 +0000 (00:20 +0000)]
Daily bump.

22 months agoRegenerate gcc.pot
Joseph Myers [Wed, 17 Aug 2022 22:18:48 +0000 (22:18 +0000)]
Regenerate gcc.pot

* gcc.pot: Regenerate.

22 months agoPR106342 - IBM zSystems: Provide vsel for all vector modes
Ilya Leoshkevich [Fri, 29 Jul 2022 14:14:10 +0000 (16:14 +0200)]
PR106342 - IBM zSystems: Provide vsel for all vector modes

dg.exp=pr104612.c fails with an ICE on s390x, because copysignv2sf3
produces an insn that vsel<mode> is supposed to recognize, but can't,
because it's not defined for V2SF.  Fix by defining it for all vector
modes supported by copysign<mode>3.

gcc/ChangeLog:

* config/s390/vector.md (V_HW_FT): New iterator.
* config/s390/vx-builtins.md (vsel<mode>): Use V_HW_FT instead
of V_HW.

(cherry picked from commit 2f17f489de47d46626ed85804c3b810547ef550e)

22 months agoDaily bump.
GCC Administrator [Wed, 17 Aug 2022 00:21:08 +0000 (00:21 +0000)]
Daily bump.

22 months agod: Update DIP links in gdc documentation to point at upstream repository
Iain Buclaw [Tue, 16 Aug 2022 10:22:10 +0000 (12:22 +0200)]
d: Update DIP links in gdc documentation to point at upstream repository

The wiki links probably worked at some point in the distant past, but
now the official location of tracking all D Improvement Proposals is on
the upstream dlang/DIPs GitHub repository.

PR d/106638

gcc/d/ChangeLog:

* gdc.texi: Update DIP links to point at upstream dlang/DIPs
repository.

(cherry picked from commit e56b695aa3aed3c0c80616bba569bbeb4a06b5e5)

22 months agoDaily bump.
GCC Administrator [Tue, 16 Aug 2022 00:21:58 +0000 (00:21 +0000)]
Daily bump.

22 months agod: Defer compiling inline definitions until after the module has finished.
Iain Buclaw [Mon, 15 Aug 2022 17:00:43 +0000 (19:00 +0200)]
d: Defer compiling inline definitions until after the module has finished.

This is to prevent the case of when generating the methods of a struct
type, we don't accidentally emit an inline function that references it,
as the outer struct itself would still be incomplete.

gcc/d/ChangeLog:

* d-tree.h (d_defer_declaration): Declare.
* decl.cc (function_needs_inline_definition_p): Defer checking
DECL_UNINLINABLE and DECL_DECLARED_INLINE_P.
(maybe_build_decl_tree): Call d_defer_declaration instead of
build_decl_tree.
* modules.cc (deferred_inline_declarations): New variable.
(build_module_tree): Set deferred_inline_declarations and a handle
declarations pushed to it.
(d_defer_declaration): New function.

(cherry picked from commit 8db5b71e212debcc4f6a17f80191ca187c307fcb)

22 months agod: Fix internal compiler error: Segmentation fault at gimple-expr.cc:88
Iain Buclaw [Mon, 15 Aug 2022 15:51:03 +0000 (17:51 +0200)]
d: Fix internal compiler error: Segmentation fault at gimple-expr.cc:88

Because complex types are deprecated in the language, the new way to
expose native complex types is by defining an enum with a basetype of a
library-defined struct that is implicitly treated as-if it is native.
As casts are not implicitly added by the front-end when downcasting from
enum to its underlying type, we must insert an explicit cast during the
code generation pass.

PR d/106623

gcc/d/ChangeLog:

* d-codegen.cc (underlying_complex_expr): New function.
(d_build_call): Handle passing native complex objects as the
library-defined equivalent.
* d-tree.h (underlying_complex_expr): Declare.
* expr.cc (ExprVisitor::visit (DotVarExp *)): Call
underlying_complex_expr instead of build_vconvert.

gcc/testsuite/ChangeLog:

* gdc.dg/torture/pr106623.d: New test.

(cherry picked from commit e206fecaac29f559f4990312b875604eb1ce3ef3)

22 months agoDaily bump.
GCC Administrator [Mon, 15 Aug 2022 00:19:15 +0000 (00:19 +0000)]
Daily bump.

22 months agoDaily bump.
GCC Administrator [Sun, 14 Aug 2022 00:19:37 +0000 (00:19 +0000)]
Daily bump.

22 months agoDaily bump.
GCC Administrator [Sat, 13 Aug 2022 00:19:43 +0000 (00:19 +0000)]
Daily bump.

22 months agoc++: constexpr, empty base after non-empty [PR106369]
Jason Merrill [Tue, 26 Jul 2022 15:02:21 +0000 (11:02 -0400)]
c++: constexpr, empty base after non-empty [PR106369]

Here the CONSTRUCTOR we were providing for D{} had an entry for the B base
subobject at offset 0 following the entry for the C base, causing
output_constructor_regular_field to ICE due to going backwards.  It might be
nice for that function to be more tolerant of empty fields, but it also
seems reasonable for the front end to prune the useless entry.

PR c++/106369

gcc/cp/ChangeLog:

* constexpr.cc (reduced_constant_expression_p): Return false
if a CONSTRUCTOR initializes an empty field.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/constexpr-lambda27.C: New test.

(cherry picked from commit 9efe4e153d994974afcbba09c3c683f5f4a19c63)

22 months agoc++: pedwarn for empty unnamed enum in decl [PR67048]
Marek Polacek [Thu, 28 Apr 2022 20:50:06 +0000 (16:50 -0400)]
c++: pedwarn for empty unnamed enum in decl [PR67048]

[dcl.dcl]/5 says that

  enum { };

is ill-formed, and since r197742 we issue a pedwarn.  However, the
pedwarn also fires for

   enum { } x;

which is well-formed.  So only warn when {} is followed by a ;.  This
should be correct since you can't have "enum {}, <whatever>" -- that
produces "expected unqualified-id before ',' token".

PR c++/67048

gcc/cp/ChangeLog:

* parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
only when it's followed by a semicolon.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/enum42.C: New test.

(cherry picked from commit fd0d3e9121c5aa65150d242676be6bbdc8d4a92a)

22 months agoc: Handle initializations of opaque types [PR106016]
Peter Bergner [Sat, 18 Jun 2022 04:43:23 +0000 (23:43 -0500)]
c: Handle initializations of opaque types [PR106016]

The initial commit that added opaque types thought that there couldn't
be any valid initializations for variables of these types, but the test
case in the bug report shows that isn't true.  The solution is to handle
OPAQUE_TYPE initializations like the other scalar types.

2022-06-17  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR c/106016
* expr.cc (count_type_elements): Handle OPAQUE_TYPE.

gcc/testsuite/
PR c/106016
* gcc.target/powerpc/pr106016.c: New test.

(cherry picked from commit 975658b782f36dcf6eb190966d5b705977bfd5eb)

22 months agoDaily bump.
GCC Administrator [Fri, 12 Aug 2022 00:19:44 +0000 (00:19 +0000)]
Daily bump.

22 months agoaarch64: Implement ACLE Data Intrinsics
Andre Simoes Dias Vieira [Mon, 25 Jul 2022 09:27:13 +0000 (10:27 +0100)]
aarch64: Implement ACLE Data Intrinsics

This patch adds support for the ACLE Data Intrinsics to the AArch64 port.

gcc/ChangeLog:

2022-07-25  Andre Vieira  <andre.simoesdiasvieira@arm.com>

* config/aarch64/aarch64.md (rbit<mode>2): Rename this ...
(@aarch64_rbit<mode>): ... to this and change it in...
(ffs<mode>2,ctz<mode>2): ... here.
(@aarch64_rev16<mode>): New.
* config/aarch64/aarch64-builtins.cc: (aarch64_builtins):
Define the following enum AARCH64_REV16, AARCH64_REV16L,
AARCH64_REV16LL, AARCH64_RBIT, AARCH64_RBITL, AARCH64_RBITLL.
(aarch64_init_data_intrinsics): New.
(aarch64_general_init_builtins): Add call to
aarch64_init_data_intrinsics.
(aarch64_expand_builtin_data_intrinsic): New.
(aarch64_general_expand_builtin): Add call to
aarch64_expand_builtin_data_intrinsic.
* config/aarch64/arm_acle.h (__clz, __clzl, __clzll, __cls, __clsl,
__clsll, __rbit, __rbitl, __rbitll, __rev, __revl, __revll, __rev16,
__rev16l, __rev16ll, __ror, __rorl, __rorll, __revsh): New.

gcc/testsuite/ChangeLog:

2022-07-25  Andre Vieira  <andre.simoesdiasvieira@arm.com>

* gcc.target/aarch64/acle/data-intrinsics.c: New test.

(cherry picked from commit eb966d393dfdfd2c80994e4bfcc0dddf85828a73)

22 months agoDaily bump.
GCC Administrator [Thu, 11 Aug 2022 00:19:22 +0000 (00:19 +0000)]
Daily bump.

22 months agoOpenMP: Fix folding with simd's linear clause [PR106492]
Tobias Burnus [Tue, 9 Aug 2022 05:57:40 +0000 (07:57 +0200)]
OpenMP: Fix folding with simd's linear clause [PR106492]

gcc/ChangeLog:

PR middle-end/106492
* omp-low.cc (lower_rec_input_clauses): Add missing folding
to data type of linear-clause list item.

gcc/testsuite/ChangeLog:

PR middle-end/106492
* g++.dg/gomp/pr106492.C: New test.

(cherry picked from commit 8a16b9f983824b6b9a25275cd23b6bba8c98b800)

22 months agotree-optimization/106513 - fix mistake in bswap symbolic number shifts
Richard Biener [Wed, 10 Aug 2022 13:45:22 +0000 (15:45 +0200)]
tree-optimization/106513 - fix mistake in bswap symbolic number shifts

This fixes a mistake in typing a local variable in the symbolic
shift routine.

PR tree-optimization/106513
* gimple-ssa-store-merging.cc (do_shift_rotate): Use uint64_t
for head_marker.

* gcc.dg/torture/pr106513.c: New testcase.

(cherry picked from commit f675afa4eeac9910a2c085a95aa04d6d9f2fd8d6)

22 months agolto/106540 - fix LTO tree input wrt dwarf2out_register_external_die
Richard Biener [Mon, 8 Aug 2022 07:07:23 +0000 (09:07 +0200)]
lto/106540 - fix LTO tree input wrt dwarf2out_register_external_die

I've revisited the earlier two workarounds for dwarf2out_register_external_die
getting duplicate entries.  It turns out that r11-525-g03d90a20a1afcb
added dref_queue pruning to lto_input_tree but decl reading uses that
to stream in DECL_INITIAL even when in the middle of SCC streaming.
When that SCC then gets thrown away we can end up with debug nodes
registered which isn't supposed to happen.  The following adjusts
the DECL_INITIAL streaming to go the in-SCC way, using lto_input_tree_1,
since no SCCs are expected at this point, just refs.

PR lto/106540
PR lto/106334
* lto-streamer-in.cc (lto_read_tree_1): Use lto_input_tree_1
to input DECL_INITIAL, avoiding to commit drefs.

(cherry picked from commit 2a1448f2763a72c83e2ec496f78243a975b0d44e)

22 months agoDaily bump.
GCC Administrator [Wed, 10 Aug 2022 00:19:29 +0000 (00:19 +0000)]
Daily bump.

22 months agolibgccjit.h: Uncomment macro definition for testing gcc_jit_context_new_bitcast support
Vibhav Pant [Tue, 9 Aug 2022 23:06:43 +0000 (19:06 -0400)]
libgccjit.h: Uncomment macro definition for testing gcc_jit_context_new_bitcast support

(cherry-picked from r13-2004-g9385cd9c74cf66)

The macro definition for LIBGCCJIT_HAVE_gcc_jit_context_new_bitcast
was earlier located in the documentation comment for
gcc_jit_context_new_bitcast, making it unavailable to code that
consumed libgccjit.h. This commit moves the definition out of the
comment, making it effective.

gcc/jit/ChangeLog:
* libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_context_new_bitcast): Move
definition out of comment.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
22 months agod: Fix undefined reference to pragma(inline) symbol (PR106563)
Iain Buclaw [Tue, 9 Aug 2022 10:48:14 +0000 (12:48 +0200)]
d: Fix undefined reference to pragma(inline) symbol (PR106563)

Functions that are declared `pragma(inline)' should be treated as if
they are defined in every translation unit they are referenced from,
regardless of visibility protection.  Ensure they always get
DECL_ONE_ONLY linkage, and start emitting them into other modules that
import them.

PR d/106563

gcc/d/ChangeLog:

* decl.cc (DeclVisitor::visit (FuncDeclaration *)): Set semanticRun
before generating its symbol.
(function_defined_in_root_p): New function.
(function_needs_inline_definition_p): New function.
(maybe_build_decl_tree): New function.
(get_symbol_decl): Call maybe_build_decl_tree before returning symbol.
(start_function): Use function_defined_in_root_p instead of inline
test for locally defined symbols.
(set_linkage_for_decl): Check for inline functions before private or
protected symbols.

gcc/testsuite/ChangeLog:

* gdc.dg/torture/torture.exp (srcdir): New proc.
* gdc.dg/torture/imports/pr106563math.d: New test.
* gdc.dg/torture/imports/pr106563regex.d: New test.
* gdc.dg/torture/imports/pr106563uni.d: New test.
* gdc.dg/torture/pr106563.d: New test.

(cherry picked from commit 04284176d549ff2565406406a6d53ab4ba8e507d)

22 months agoDaily bump.
GCC Administrator [Tue, 9 Aug 2022 00:19:21 +0000 (00:19 +0000)]
Daily bump.

22 months agod: Fix ICE in in add_stack_var, at cfgexpand.cc:476
Iain Buclaw [Mon, 8 Aug 2022 13:17:47 +0000 (15:17 +0200)]
d: Fix ICE in in add_stack_var, at cfgexpand.cc:476

The type that triggers the ICE never got completed by the semantic
analysis pass.  Checking for size forces it to be done, or issue a
compile-time error.

PR d/106555

gcc/d/ChangeLog:

* d-target.cc (Target::isReturnOnStack): Check for return type size.

gcc/testsuite/ChangeLog:

* gdc.dg/imports/pr106555.d: New test.
* gdc.dg/pr106555.d: New test.

(cherry picked from commit 4b0253b019943abf2cc5f4db0b7ed67caedffe4a)

22 months agoDaily bump.
GCC Administrator [Mon, 8 Aug 2022 00:19:17 +0000 (00:19 +0000)]
Daily bump.

22 months agoDaily bump.
GCC Administrator [Sun, 7 Aug 2022 00:19:25 +0000 (00:19 +0000)]
Daily bump.

22 months agoDaily bump.
GCC Administrator [Sat, 6 Aug 2022 00:19:27 +0000 (00:19 +0000)]
Daily bump.

22 months agoDo not enable -mblock-ops-vector-pair.
Michael Meissner [Fri, 5 Aug 2022 22:54:33 +0000 (18:54 -0400)]
Do not enable -mblock-ops-vector-pair.

Testing has shown that using the load vector pair and store vector pair
instructions for block moves has some performance issues on power10.

A patch on June 11th modified the code so that GCC would not set
-mblock-ops-vector-pair by default if we are tuning for power10, but it would
set the option if we were tuning for a different machine and have load and store
vector pair instructions enabled.

This patch eliminates the code setting -mblock-ops-vector-pair.  If you want to
generate load vector pair and store vector pair instructions for block moves,
you must use -mblock-ops-vector-pair.

2022-08-05   Michael Meissner  <meissner@linux.ibm.com>

gcc/

* config/rs6000/rs6000.cc (rs6000_option_override_internal): Remove code
setting -mblock-ops-vector-pair.  Back port patch from trunk on 8/3.

22 months agolibstdc++: Make std::string_view(Range&&) constructor explicit
Jonathan Wakely [Thu, 4 Aug 2022 12:08:00 +0000 (13:08 +0100)]
libstdc++: Make std::string_view(Range&&) constructor explicit

The P2499R0 paper was recently approved for C++23.

libstdc++-v3/ChangeLog:

* include/std/string_view (basic_string_view(Range&&)): Add
explicit as per P2499R0.
* testsuite/21_strings/basic_string_view/cons/char/range_c++20.cc:
Adjust implicit conversions. Check implicit conversions fail.
* testsuite/21_strings/basic_string_view/cons/wchar_t/range_c++20.cc:
Likewise.

(cherry picked from commit 2678386df2cc3505da85e95643327aa928e66a8e)

22 months agolibstdc++: Rename data members of std::unexpected and std::bad_expected_access
Jonathan Wakely [Thu, 4 Aug 2022 09:20:18 +0000 (10:20 +0100)]
libstdc++: Rename data members of std::unexpected and std::bad_expected_access

The P2549R1 paper was accepted for C++23. I already implemented it for
our <expected>, but I didn't rename the private daata members, only the
public member functions. This renames the data members for consistency
with the working draft.

libstdc++-v3/ChangeLog:

* include/std/expected (unexpected::_M_val): Rename to _M_unex.
(bad_expected_access::_M_val): Likewise.

(cherry picked from commit 07c7ee4d2d42f4728928556dbbe0700f9a13db90)

22 months agolibstdc++: Update value of __cpp_lib_ios_noreplace macro
Jonathan Wakely [Thu, 4 Aug 2022 09:18:23 +0000 (10:18 +0100)]
libstdc++: Update value of __cpp_lib_ios_noreplace macro

My P2467R1 proposal was accepted for C++23 so there's an official value
for this macro now.

libstdc++-v3/ChangeLog:

* include/bits/ios_base.h (__cpp_lib_ios_noreplace): Update
value to 202207L.
* include/std/version (__cpp_lib_ios_noreplace): Likewise.
* testsuite/27_io/basic_ofstream/open/char/noreplace.cc: Check
for new value.
* testsuite/27_io/basic_ofstream/open/wchar_t/noreplace.cc:
Likewise.

(cherry picked from commit 3e9bd6b2b1782891639fa5d49b7d2a933b8e85cd)

22 months agoDaily bump.
GCC Administrator [Fri, 5 Aug 2022 00:19:14 +0000 (00:19 +0000)]
Daily bump.

22 months agoDaily bump.
GCC Administrator [Thu, 4 Aug 2022 00:19:28 +0000 (00:19 +0000)]
Daily bump.

22 months agolibstdc++: Improve directory iterator abstractions for openat
Jonathan Wakely [Mon, 27 Jun 2022 13:43:54 +0000 (14:43 +0100)]
libstdc++: Improve directory iterator abstractions for openat

Currently the _Dir::open_subdir function decides whether to construct a
_Dir_base with just a pathname, or a file descriptor and pathname. But
that means it is tightly coupled to the implementation of
_Dir_base::openat, which is what actually decides whether to use a file
descriptor or not. If the derived class passes a file descriptor and
filename, but the base class expects a full path and ignores the file
descriptor, then recursive_directory_iterator cannot recurse.

This change introduces a new type that provides the union of all the
information available to the derived class (the full pathname, as well
as a file descriptor for a directory and another pathname relative to
that directory). This allows the derived class to be agnostic to how the
base class will use that information.

libstdc++-v3/ChangeLog:

* src/c++17/fs_dir.cc (_Dir::dir_and_pathname):: Replace with
current() returning _At_path.
(_Dir::_Dir, _Dir::open_subdir, _Dir::do_unlink): Adjust.
* src/filesystem/dir-common.h (_Dir_base::_At_path): New class.
(_Dir_base::_Dir_Base, _Dir_base::openat): Use _At_path.
* src/filesystem/dir.cc (_Dir::dir_and_pathname): Replace with
current() returning _At_path.
(_Dir::_Dir, _Dir::open_subdir): Adjust.

(cherry picked from commit 198781144f33b0ef17dd2094580b5c77ad97d6e8)

22 months agolibstdc++: Tweak common_iterator::operator-> return type [PR104443]
Jonathan Wakely [Thu, 28 Jul 2022 19:55:51 +0000 (20:55 +0100)]
libstdc++: Tweak common_iterator::operator-> return type [PR104443]

This adjusts the return type to match the resolution of LWG 3672. There
is no functional difference, because decltype(auto) always deduced a
value anyway, but this makes it simpler and consistent with the working
draft.

libstdc++-v3/ChangeLog:

PR libstdc++/104443
* include/bits/stl_iterator.h (common_iterator::operator->):
Change return type to just auto.

(cherry picked from commit b5f5d1b36edbcd7d923f2e2653e54e52637c715b)

This page took 0.109046 seconds and 5 git commands to generate.