]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
23 months agoDaily bump.
GCC Administrator [Sun, 3 Sep 2023 00:18:09 +0000 (00:18 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Sat, 2 Sep 2023 00:19:03 +0000 (00:19 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Fri, 1 Sep 2023 00:18:38 +0000 (00:18 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Thu, 31 Aug 2023 00:21:11 +0000 (00:21 +0000)] 
Daily bump.

23 months agotree-ssa-strlen: Fix up handling of conditionally zero memcpy [PR110914]
Jakub Jelinek [Wed, 30 Aug 2023 09:21:45 +0000 (11:21 +0200)] 
tree-ssa-strlen: Fix up handling of conditionally zero memcpy [PR110914]

The following testcase is miscompiled since r279392 aka r10-5451-gef29b12cfbb4979
The strlen pass has adjust_last_stmt function, which performs mainly strcat
or strcat-like optimizations (say strcpy (x, "abcd"); strcat (x, p);
or equivalent memcpy (x, "abcd", strlen ("abcd") + 1); char *q = strchr (x, 0);
memcpy (x, p, strlen (p)); etc. where the first stmt stores '\0' character
at the end but next immediately overwrites it and so the first memcpy can be
adjusted to store 1 fewer bytes.  handle_builtin_memcpy called this function
in two spots, the first one guarded like:
  if (olddsi != NULL
      && tree_fits_uhwi_p (len)
      && !integer_zerop (len))
    adjust_last_stmt (olddsi, stmt, false);
i.e. only for constant non-zero length.  The other spot can call it even
for non-constant length but in that case we punt before that if that length
isn't length of some string + 1, so again non-zero.
The r279392 change I assume wanted to add some warning stuff and changed it
like
   if (olddsi != NULL
-      && tree_fits_uhwi_p (len)
       && !integer_zerop (len))
-    adjust_last_stmt (olddsi, stmt, false);
+    {
+      maybe_warn_overflow (stmt, len, rvals, olddsi, false, true);
+      adjust_last_stmt (olddsi, stmt, false);
+    }
While maybe_warn_overflow possibly handles non-constant length fine,
adjust_last_stmt really relies on length to be non-zero, which
!integer_zerop (len) alone doesn't guarantee.  While we could for
len being SSA_NAME ask the ranger or tree_expr_nonzero_p, I think
adjust_last_stmt will not benefit from it much, so the following patch
just restores the above condition/previous behavior for the adjust_last_stmt
call only.

2023-08-30  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/110914
* tree-ssa-strlen.c (strlen_pass::handle_builtin_memcpy): Don't call
adjust_last_stmt unless len is known constant.

* gcc.c-torture/execute/pr110914.c: New test.

(cherry picked from commit 398842e7038ea0f34054f0f694014d0ecd656846)

23 months agostore-merging: Fix up >= 64 bit insertion [PR111015]
Jakub Jelinek [Wed, 30 Aug 2023 08:47:21 +0000 (10:47 +0200)] 
store-merging: Fix up >= 64 bit insertion [PR111015]

The following testcase shows that we mishandle bit insertion for
info->bitsize >= 64.  The problem is in using unsigned HOST_WIDE_INT
shift + subtraction + build_int_cst to compute mask, the shift invokes
UB at compile time for info->bitsize 64 and larger and e.g. on the testcase
with info->bitsize happens to compute mask of 0x3f rather than
0x3f'ffffffff'ffffffff.

The patch fixes that by using wide_int wi::mask + wide_int_to_tree, so it
handles masks in any precision (up to WIDE_INT_MAX_PRECISION ;) ).

2023-08-30  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/111015
* gimple-ssa-store-merging.c
(imm_store_chain_info::output_merged_store): Use wi::mask and
wide_int_to_tree instead of unsigned HOST_WIDE_INT shift and
build_int_cst to build BIT_AND_EXPR mask.

* gcc.dg/pr111015.c: New test.

(cherry picked from commit 49a3b35c4068091900b657cd36e5cffd41ef0c47)

23 months agoDaily bump.
GCC Administrator [Wed, 30 Aug 2023 00:19:43 +0000 (00:19 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Tue, 29 Aug 2023 00:19:49 +0000 (00:19 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Mon, 28 Aug 2023 00:20:12 +0000 (00:20 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Sun, 27 Aug 2023 00:18:38 +0000 (00:18 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Sat, 26 Aug 2023 00:20:10 +0000 (00:20 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Fri, 25 Aug 2023 00:20:00 +0000 (00:20 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Thu, 24 Aug 2023 00:19:28 +0000 (00:19 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Wed, 23 Aug 2023 00:19:57 +0000 (00:19 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Tue, 22 Aug 2023 00:20:04 +0000 (00:20 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Mon, 21 Aug 2023 00:19:10 +0000 (00:19 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Sun, 20 Aug 2023 00:19:02 +0000 (00:19 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Sat, 19 Aug 2023 00:18:10 +0000 (00:18 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Fri, 18 Aug 2023 00:18:16 +0000 (00:18 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Thu, 17 Aug 2023 00:18:48 +0000 (00:18 +0000)] 
Daily bump.

23 months agoSupport -m[no-]gather to enable/disable vectorization for all gather instructions
liuhongt [Wed, 16 Aug 2023 02:07:15 +0000 (10:07 +0800)] 
Support -m[no-]gather to enable/disable vectorization for all gather instructions

gcc/ChangeLog:

* config/i386/i386.opt: Add new option mgather.

23 months agoSoftware mitigation: Disable gather generation in vectorization for GDS affected...
liuhongt [Thu, 10 Aug 2023 03:41:39 +0000 (11:41 +0800)] 
Software mitigation: Disable gather generation in vectorization for GDS affected Intel Processors.

For more details of GDS (Gather Data Sampling), refer to
https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/advisory-guidance/gather-data-sampling.html

After microcode update, there's performance regression. To avoid that,
the patch disables gather generation in autovectorization but uses
gather scalar emulation instead.

gcc/ChangeLog:

* config/i386/i386-options.c (m_GDS): New macro.
* config/i386/x86-tune.def (X86_TUNE_USE_GATHER): Don't enable
for m_GDS.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx2-gather-2.c: Adjust options to keep
gather vectorization.
* gcc.target/i386/avx2-gather-6.c: Ditto.
* gcc.target/i386/avx512f-pr88464-1.c: Ditto.
* gcc.target/i386/avx512f-pr88464-5.c: Ditto.
* gcc.target/i386/avx512vl-pr88464-1.c: Ditto.
* gcc.target/i386/avx512vl-pr88464-11.c: Ditto.
* gcc.target/i386/avx512vl-pr88464-3.c: Ditto.
* gcc.target/i386/avx512vl-pr88464-9.c: Ditto.

(cherry picked from commit 3064d1f5c48cb6ce1b4133570dd08ecca8abb52d)

23 months agoDaily bump.
GCC Administrator [Wed, 16 Aug 2023 00:18:17 +0000 (00:18 +0000)] 
Daily bump.

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

23 months agoDaily bump.
GCC Administrator [Mon, 14 Aug 2023 00:18:07 +0000 (00:18 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Sun, 13 Aug 2023 00:18:37 +0000 (00:18 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Sat, 12 Aug 2023 00:18:39 +0000 (00:18 +0000)] 
Daily bump.

23 months agoDaily bump.
GCC Administrator [Fri, 11 Aug 2023 00:18:21 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 10 Aug 2023 00:19:04 +0000 (00:19 +0000)] 
Daily bump.

2 years agoc++: noexcept-spec from nested class confusion [PR109761]
Patrick Palka [Tue, 9 May 2023 19:06:34 +0000 (15:06 -0400)] 
c++: noexcept-spec from nested class confusion [PR109761]

When late processing a noexcept-spec from a nested class after completion
of the outer class (since it's a complete-class context), we pass the wrong
class context to noexcept_override_late_checks -- the outer class type
instead of the nested class type -- which leads to bogus errors in the
below test.

This patch fixes this by making noexcept_override_late_checks obtain the
class context directly via DECL_CONTEXT instead of via an additional
parameter.

PR c++/109761

gcc/cp/ChangeLog:

* parser.c (cp_parser_class_specifier): Don't pass a class
context to noexcept_override_late_checks.
(noexcept_override_late_checks): Remove 'type' parameter
and use DECL_CONTEXT of 'fndecl' instead.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit c13906f258fb34b3e0c90ddc8d9191dd72f3da0e)

2 years agoWorkaround possible CPUID bug in Sandy Bridge.
liuhongt [Fri, 4 Aug 2023 01:27:39 +0000 (09:27 +0800)] 
Workaround possible CPUID bug in Sandy Bridge.

Don't access leaf 7 subleaf 1 unless subleaf 0 says it is
supported via EAX.

Intel documentation says invalid subleaves return 0. We had been
relying on that behavior instead of checking the max sublef number.

It appears that some Sandy Bridge CPUs return at least the subleaf 0
EDX value for subleaf 1. Best guess is that this is a bug in a
microcode patch since all of the bits we're seeing set in EDX were
introduced after Sandy Bridge was originally released.

This is causing avxvnniint16 to be incorrectly enabled with
-march=native on these CPUs.

gcc/ChangeLog:

* common/config/i386/cpuinfo.h (get_available_features): Check
max_subleaf_level for valid subleaf before use CPUID.

2 years agoDaily bump.
GCC Administrator [Wed, 9 Aug 2023 00:17:58 +0000 (00:17 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 8 Aug 2023 00:18:40 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 7 Aug 2023 00:18:31 +0000 (00:18 +0000)] 
Daily bump.

2 years agotestsuite: Fix up pr107397.f90 test [PR107397]
Jakub Jelinek [Mon, 19 Dec 2022 10:24:55 +0000 (11:24 +0100)] 
testsuite: Fix up pr107397.f90 test [PR107397]

The pr107397.f90 test FAILs for me, one problem was that the
added diagnostics has an indefinite article before BOZ, but
the test dg-error didn't.  The other problem was that on the
other dg-error there was no space between the string and closing
}, so it was completely ignored and the error was an excess
error.

2022-12-19  Jakub Jelinek  <jakub@redhat.com>

PR fortran/107397
* gfortran.dg/pr107397.f90: Adjust expected diagnostic wording and
add space between dg-error string and closing }.

(cherry picked from commit 03fb35f8753d87148b29b3f34b6154abe7db4c41)

2 years agoAdd a check for invalid use of BOZ with a derived type.
Steve Kargl [Sun, 18 Dec 2022 03:15:43 +0000 (19:15 -0800)] 
Add a check for invalid use of BOZ with a derived type.

PR fortran/107397

gcc/fortran/ChangeLog:

* decl.c (add_init_expr_to_sym): Add check with new error message.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr107397.f90: New test.

(cherry picked from commit 09710f9934969dcb07131e1ed78b72e648123a3a)

2 years agoDaily bump.
GCC Administrator [Sun, 6 Aug 2023 00:17:57 +0000 (00:17 +0000)] 
Daily bump.

2 years agoICE in gfc_free_namespace. ice-on-invalid.
Jerry DeLisle [Sun, 29 Jan 2023 04:00:34 +0000 (20:00 -0800)] 
ICE in gfc_free_namespace. ice-on-invalid.

PR fortran/103506

gcc/fortran/ChangeLog:

* parse.c (parse_module): Remove use of a bool error value
that prevented proper setting of the namespace pointer.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr103506_1.f90: New test.

(cherry picked from commit 8011fbba7baa46947341ca8069b5a327163a68d5)

2 years agoDaily bump.
GCC Administrator [Sat, 5 Aug 2023 00:18:37 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Fri, 4 Aug 2023 00:18:17 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 3 Aug 2023 00:18:09 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 2 Aug 2023 00:19:03 +0000 (00:19 +0000)] 
Daily bump.

2 years agors6000: Correct vsx operands output for xxeval [PR110741]
Kewen Lin [Wed, 26 Jul 2023 08:42:29 +0000 (03:42 -0500)] 
rs6000: Correct vsx operands output for xxeval [PR110741]

PR110741 exposes one issue that we didn't use the correct
character for vsx operands in output operand substitution,
consequently it can map to the wrong registers which hold
some unexpected values.

PR target/110741

gcc/ChangeLog:

* config/rs6000/altivec.md (define_insn xxeval): Correct vsx
operands output with "x".

gcc/testsuite/ChangeLog:

* g++.target/powerpc/pr110741.C: New test.

(cherry picked from commit 96a839233ced3a0bfc3d5492a6d8b102e6981472)

2 years agoDaily bump.
GCC Administrator [Tue, 1 Aug 2023 00:19:37 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 31 Jul 2023 00:18:52 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 30 Jul 2023 00:18:55 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 29 Jul 2023 00:19:05 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Fri, 28 Jul 2023 00:19:38 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 27 Jul 2023 00:19:27 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 26 Jul 2023 00:19:11 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 25 Jul 2023 00:20:55 +0000 (00:20 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 24 Jul 2023 00:18:59 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 23 Jul 2023 00:19:18 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 22 Jul 2023 00:19:21 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Fri, 21 Jul 2023 00:19:00 +0000 (00:19 +0000)] 
Daily bump.

2 years agoFortran: intrinsics and deferred-length character arguments [PR95947,PR110658]
Harald Anlauf [Sun, 16 Jul 2023 20:17:27 +0000 (22:17 +0200)] 
Fortran: intrinsics and deferred-length character arguments [PR95947,PR110658]

gcc/fortran/ChangeLog:

PR fortran/95947
PR fortran/110658
* trans-expr.c (gfc_conv_procedure_call): For intrinsic procedures
whose result characteristics depends on the first argument and which
can be of type character, the character length will not be deferred.

gcc/testsuite/ChangeLog:

PR fortran/95947
PR fortran/110658
* gfortran.dg/deferred_character_37.f90: New test.

(cherry picked from commit 95ddd2659849a904509067ec3a2770135149a722)

2 years agoDaily bump.
GCC Administrator [Thu, 20 Jul 2023 00:19:16 +0000 (00:19 +0000)] 
Daily bump.

2 years agotestsuite: Require vectors of doubles for pr97428.c
Maciej W. Rozycki [Tue, 11 Jul 2023 14:57:33 +0000 (15:57 +0100)] 
testsuite: Require vectors of doubles for pr97428.c

The pr97428.c test assumes support for vectors of doubles, but some
targets only support vectors of floats, causing this test to fail with
such targets.  Limit this test to targets that support vectors of
doubles then.

gcc/testsuite/
* gcc.dg/vect/pr97428.c: Limit to `vect_double' targets.

(cherry picked from commit 5d9fc2aced3a2128527afd4a627424542f238471)

2 years agoDaily bump.
GCC Administrator [Wed, 19 Jul 2023 00:19:09 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 18 Jul 2023 00:18:57 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 17 Jul 2023 00:18:46 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 16 Jul 2023 00:18:46 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 15 Jul 2023 00:19:01 +0000 (00:19 +0000)] 
Daily bump.

2 years agoFortran: formal symbol attributes for intrinsic procedures [PR110288]
Harald Anlauf [Tue, 11 Jul 2023 19:21:25 +0000 (21:21 +0200)] 
Fortran: formal symbol attributes for intrinsic procedures [PR110288]

gcc/fortran/ChangeLog:

PR fortran/110288
* symbol.c (gfc_copy_formal_args_intr): When deriving the formal
argument attributes from the actual ones for intrinsic procedure
calls, take special care of CHARACTER arguments that we do not
wrongly treat them formally as deferred-length.

gcc/testsuite/ChangeLog:

PR fortran/110288
* gfortran.dg/findloc_10.f90: New test.

(cherry picked from commit 3b2c523ae31b68fc3b8363b458a55eec53a44365)

2 years agoSH: Fix PR101469 peephole bug
Oleg Endo [Fri, 14 Jul 2023 00:54:20 +0000 (09:54 +0900)] 
SH: Fix PR101469 peephole bug

gcc/ChangeLog:

PR target/101469
* config/sh/sh.md (peephole2): Handle case where eliminated reg
is also used by the address of the following memory operand.

2 years agoDaily bump.
GCC Administrator [Fri, 14 Jul 2023 00:18:43 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 13 Jul 2023 00:18:54 +0000 (00:18 +0000)] 
Daily bump.

2 years agolibstdc++: Check conversion from filesystem::path to wide strings [PR95048]
Jonathan Wakely [Wed, 12 Jul 2023 13:40:19 +0000 (14:40 +0100)] 
libstdc++: Check conversion from filesystem::path to wide strings [PR95048]

The testcase added for this bug only checks conversion from wide strings
on construction, but the fix also covered conversion to wide strings via
path::wstring(). Add checks for that, and u16string() and u32string().

libstdc++-v3/ChangeLog:

PR libstdc++/95048
* testsuite/27_io/filesystem/path/construct/95048.cc: Check
conversions to wide strings.
* testsuite/experimental/filesystem/path/construct/95048.cc:
Likewise.

(cherry picked from commit d6384ad1a9ab7ea46990a7ed1299d5a2be4acece)

2 years agoDaily bump.
GCC Administrator [Wed, 12 Jul 2023 00:18:17 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 11 Jul 2023 00:18:39 +0000 (00:18 +0000)] 
Daily bump.

2 years agolibstdc++: Fix wstring conversions in filesystem::path [PR95048]
Jonathan Wakely [Fri, 11 Nov 2022 15:22:02 +0000 (15:22 +0000)] 
libstdc++: Fix wstring conversions in filesystem::path [PR95048]

In commit r9-7381-g91756c4abc1757 I changed filesystem::path to use
std::codecvt<CharT, char, mbstate_t> for conversions from all wide
strings to UTF-8, instead of using std::codecvt_utf8<CharT>. This was
done because for 16-bit wchar_t, std::codecvt_utf8<wchar_t> only
supports UCS-2 and not UTF-16. The rationale for the change was sound,
but the actual fix was not. It's OK to use std::codecvt for char16_t or
char32_t, because the specializations for those types always use UTF-8 ,
but std::codecvt<wchar_t, char, mbstate_t> uses the current locale's
encodings, and the narrow encoding is probably ASCII and can't support
non-ASCII characters.

The correct fix is to use std::codecvt only for char16_t and char32_t.
For 32-bit wchar_t we could have continued using std::codecvt_utf8
because that uses UTF-32 which is fine, switching to std::codecvt broke
non-Windows targets with 32-bit wchar_t. For 16-bit wchar_t we did need
to change, but should have changed to std::codecvt_utf8_utf16<wchar_t>
instead, as that always uses UTF-16 not UCS-2. I actually noted that in
the commit message for r9-7381-g91756c4abc1757 but didn't use that
option. Oops.

This replaces the unconditional std::codecvt<CharT, char, mbstate_t>
with a type defined via template specialization, so it can vary
depending on the wide character type. The code is also simplified to
remove some of the mess of #ifdef and if-constexpr conditions.

libstdc++-v3/ChangeLog:

PR libstdc++/95048
* include/bits/fs_path.h (path::_Codecvt): New class template
that selects the kind of code conversion done.
(path::_Codecvt<wchar_t>): Select based on sizeof(wchar_t).
(_GLIBCXX_CONV_FROM_UTF8): New macro to allow the same code to
be used for Windows and POSIX.
(path::_S_convert(const EcharT*, const EcharT*)): Simplify by
using _Codecvt and _GLIBCXX_CONV_FROM_UTF8 abstractions.
(path::_S_str_convert(basic_string_view<value_type>, const A&)):
Simplify nested conditions.
* include/experimental/bits/fs_path.h (path::_Cvt): Define
nested typedef controlling type of code conversion done.
(path::_Cvt::_S_wconvert): Use new typedef.
(path::string(const A&)): Likewise.
* testsuite/27_io/filesystem/path/construct/95048.cc: New test.
* testsuite/experimental/filesystem/path/construct/95048.cc: New
test.

(cherry picked from commit b331bf303bdc1edead41e2b3d11d1a7804b433cf)

2 years agoDaily bump.
GCC Administrator [Mon, 10 Jul 2023 00:18:07 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 9 Jul 2023 00:18:19 +0000 (00:18 +0000)] 
Daily bump.

2 years agoFortran: simplification of FINDLOC for constant complex arguments [PR110585]
Harald Anlauf [Fri, 7 Jul 2023 18:25:06 +0000 (20:25 +0200)] 
Fortran: simplification of FINDLOC for constant complex arguments [PR110585]

gcc/fortran/ChangeLog:

PR fortran/110585
* arith.c (gfc_compare_expr): Handle equality comparison of constant
complex gfc_expr arguments.

gcc/testsuite/ChangeLog:

PR fortran/110585
* gfortran.dg/findloc_9.f90: New test.

(cherry picked from commit 7ac1581d066a6f3a0d4acf1042a74634258b4966)

2 years agoDaily bump.
GCC Administrator [Sat, 8 Jul 2023 00:17:48 +0000 (00:17 +0000)] 
Daily bump.

2 years agod: Fix PR 108842: Cannot use enum array with -fno-druntime
Iain Buclaw [Fri, 7 Jul 2023 19:06:07 +0000 (21:06 +0200)] 
d: Fix PR 108842: Cannot use enum array with -fno-druntime

Restrict the generating of CONST_DECLs for D manifest constants to just
scalars without pointers.  It shouldn't happen that a reference to a
manifest constant has not been expanded within a function body during
codegen, but it has been found to occur in older versions of the D
front-end (PR98277), so if the decl of a non-scalar constant is
requested, just return its initializer as an expression.

PR d/108842

gcc/d/ChangeLog:

* decl.cc (DeclVisitor::visit (VarDeclaration *)): Only emit scalar
manifest constants.
(get_symbol_decl): Don't generate CONST_DECL for non-scalar manifest
constants.
* imports.cc (ImportVisitor::visit (VarDeclaration *)): New method.

gcc/testsuite/ChangeLog:

* gdc.dg/pr98277.d: Add more tests.
* gdc.dg/pr108842.d: New test.

(cherry picked from commit f934c5753849f7c48c6a3abfcd73b8f6008e8371)

2 years agoDaily bump.
GCC Administrator [Fri, 7 Jul 2023 00:18:46 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 6 Jul 2023 00:19:40 +0000 (00:19 +0000)] 
Daily bump.

2 years agoFix power10 fusion bug with prefixed loads, PR target/105325
Michael Meissner [Wed, 5 Jul 2023 19:50:15 +0000 (15:50 -0400)] 
Fix power10 fusion bug with prefixed loads, PR target/105325

This changes fixes PR target/105325.  PR target/105325 is a bug where an
invalid lwa instruction is generated due to power10 fusion of a load
instruction to a GPR and an compare immediate instruction with the immediate
being -1, 0, or 1.

In some cases, when the load instruction is done, the GCC compiler would
generate a load instruction with an offset that was too large to fit into the
normal load instruction.

In particular, loads from the stack might originally have a small offset, so
that the load is not a prefixed load.  However, after the stack is set up, and
register allocation has been done, the offset now is large enough that we would
have to use a prefixed load instruction.

The support for prefixed loads did not consider that patterns with a fused load
and compare might have a prefixed address.  Without this support, the proper
prefixed load won't be generated.

In the original code, when the split2 pass is run after reload has finished the
ds_form_mem_operand predicate that was used for lwa and ld no longer returns
true.  When the pattern was created, ds_form_mem_operand recognized the insn as
being valid since the offset was small.  But after register allocation,
ds_form_mem_operand did not return true.  Because it didn't return true, the
insn could not be split.  Since the insn was not split and the prefix support
did not indicate a prefixed instruction was used, the wrong load is generated.

The solution involves:

    1) Don't use ds_form_mem_operand for ld and lwa, always use
non_update_memory_operand.

    2) Delete ds_form_mem_operand since it is no longer used.

    3) Use the "YZ" constraints for ld/lwa instead of "m".

    4) If we don't need to sign extend the lwa, convert it to lwz, and use
cmpwi instead of cmpdi.  Adjust the insn name to reflect the code
generate.

    5) Insure that the insn using lwa will be recognized as having a prefixed
operand (and hence the insn length will be 16 bytes instead of 8
bytes).

5a) Set the prefixed and maybe_prefix attributes to know that
    fused_load_cmpi are also load insns;

5b) In the case where we are just setting CC and not using the memory
    afterward, set the clobber to use a DI register, and put an
    explicit sign_extend operation in the split;

5c) Set the sign_extend attribute to "yes" for lwa.

5d) 5a-5c are the things that prefixed_load_p in rs6000.cc checks to
    ensure that lwa is treated as a ds-form instruction and not as
    a d-form instruction (i.e. lwz).

    6) Add a new test case for this case.

    7) Adjust the insn counts in fusion-p10-ldcmpi.c.  Because we are no
longer using ds_form_mem_operand, the ld and lwa instructions will fuse
x-form (reg+reg) addresses in addition ds-form (reg+offset or reg).

2023-06-23   Michael Meissner  <meissner@linux.ibm.com>

gcc/

PR target/105325
* config/rs6000/genfusion.pl (gen_ld_cmpi_p10_one): Fix problems that
allowed prefixed lwa to be generated.
* config/rs6000/fusion.md: Regenerate.
* config/rs6000/predicates.md (ds_form_mem_operand): Delete.
* config/rs6000/rs6000.md (prefixed attribute): Add support for load
plus compare immediate fused insns.
(maybe_prefixed): Likewise.

gcc/testsuite/

PR target/105325
* g++.target/powerpc/pr105325.C: New test.
* gcc.target/powerpc/fusion-p10-ldcmpi.c: Update insn counts.

(cherry picked from commit 370de1488a9a49956c47e5ec8c8f1489b4314a34)

Co-Authored-By: Aaron Sawdey <acsawdey@linux.ibm.com>
2 years agors6000: genfusion: Rewrite load/compare code
Segher Boessenkool [Fri, 2 Jun 2023 15:32:41 +0000 (15:32 +0000)] 
rs6000: genfusion: Rewrite load/compare code

This makes the code more readable, more digestible, more maintainable,
more extensible.  That kind of thing.  It does that by pulling things
apart a bit, but also making what stays together more cohesive lumps.

The original function was a bunch of loops and early-outs, and then
quite a bit of stuff done per iteration, with the iterations essentially
independent of each other.  This patch moves the stuff done for one
iteration to a new _one function.

The second big thing is the stuff printed to the .md file is done in
"here documents" now, which is a lot more readable than having to quote
and escape and double-escape pieces of text.  Whitespace inside the
here-document is significant (will be printed as-is), which is a bit
awkward sometimes, or might take some getting used to, but it is also
one of the benefits of using them.

Local variables are declared at first use (or close to first use).
There also shouldn't be many at all, often you can write easier to
read and manage code by omitting to name something that is hard to name
in the first place.

Finally some things are done in more typical, more modern, and tighter
Perl style, for example REs in "if"s or "qw" for lists of constants.

2023-06-06  Segher Boessenkool  <segher@kernel.crashing.org>

* config/rs6000/genfusion.pl (gen_ld_cmpi_p10_one): New, rewritten and
split out from...
(gen_ld_cmpi_p10): ... this.

(cherry picked from commit 19e5bf1d5fac00da0b8cd4144d5651b2979d8308)

2 years agoDaily bump.
GCC Administrator [Wed, 5 Jul 2023 00:19:02 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 4 Jul 2023 00:19:48 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 3 Jul 2023 00:19:49 +0000 (00:19 +0000)] 
Daily bump.

2 years agod: Fix core.volatile.volatileLoad discarded if result is unused
Iain Buclaw [Sun, 2 Jul 2023 01:24:53 +0000 (03:24 +0200)] 
d: Fix core.volatile.volatileLoad discarded if result is unused

The first pass of code generation in the D front-end splits up all
compound expressions and discards expressions that have no side effects.
This included calls to the `volatileLoad' intrinsic if its result was
not used, causing such calls to be eliminated from the program.

We already set TREE_THIS_VOLATILE on the expression, however the
tree documentation says if this bit is set in an expression, so is
TREE_SIDE_EFFECTS.  So set TREE_SIDE_EFFECTS on the expression too.
This prevents any early discarding from occuring.

PR d/110516

gcc/d/ChangeLog:

* intrinsics.cc (expand_volatile_load): Set TREE_SIDE_EFFECTS on the
expanded expression.
(expand_volatile_store): Likewise.

gcc/testsuite/ChangeLog:

* gdc.dg/torture/pr110516a.d: New test.
* gdc.dg/torture/pr110516b.d: New test.

(cherry picked from commit 80ae426a195a0d035640a6301da833564deade52)

2 years agoDaily bump.
GCC Administrator [Sun, 2 Jul 2023 00:18:30 +0000 (00:18 +0000)] 
Daily bump.

2 years agod: Fix ICE in setValue, at d/dmd/dinterpret.c:7013
Iain Buclaw [Sat, 1 Jul 2023 13:04:25 +0000 (15:04 +0200)] 
d: Fix ICE in setValue, at d/dmd/dinterpret.c:7013

Backports ICE fix from upstream.  When casting null to integer or real,
instead of painting the type on the NullExp, we emplace an
IntegerExp/RealExp with the value zero.  Same as when casting from
NullExp to bool.

Reviewed-on: https://github.com/dlang/dmd/pull/13172

PR d/110511

gcc/d/ChangeLog:

* dmd/dinterpret.c (Interpreter::visit (CastExp *)): Handle casting
null to int or float.

gcc/testsuite/ChangeLog:

* gdc.test/compilable/test21794.d: New test.

2 years agoDaily bump.
GCC Administrator [Sat, 1 Jul 2023 00:20:52 +0000 (00:20 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Fri, 30 Jun 2023 00:19:35 +0000 (00:19 +0000)] 
Daily bump.

2 years agogo: Update usage of TARGET_AIX to TARGET_AIX_OS
Paul E. Murphy [Thu, 22 Jun 2023 22:53:46 +0000 (17:53 -0500)] 
go: Update usage of TARGET_AIX to TARGET_AIX_OS

TARGET_AIX is defined to a non-zero value on linux and maybe other
powerpc64le targets.  This leads to unexpected behavior such as
dropping the .go_export section when linking a shared library
on linux/powerpc64le.

Instead, use TARGET_AIX_OS to toggle AIX specific behavior.

Fixes golang/go#60798.

2023-06-22  Paul E. Murphy  <murphyp@linux.ibm.com>

gcc/go/
* go-backend.c [TARGET_AIX]: Rename and update usage to TARGET_AIX_OS.
* go-lang.c: Likewise.

(cherry picked from commit b76cd1ec361712e1ac9ca5e0246da24ea2b78916)

2 years agoRefine maskstore patterns with UNSPEC_MASKMOV.
liuhongt [Mon, 26 Jun 2023 13:07:09 +0000 (21:07 +0800)] 
Refine maskstore patterns with UNSPEC_MASKMOV.

Similar like r14-2070-gc79476da46728e

If mem_addr points to a memory region with less than whole vector size
bytes of accessible memory and k is a mask that would prevent reading
the inaccessible bytes from mem_addr, add UNSPEC_MASKMOV to prevent
it to be transformed to any other whole memory access instructions.

gcc/ChangeLog:

PR rtl-optimization/110237
* config/i386/sse.md (<avx512>_store<mode>_mask): Refine with
UNSPEC_MASKMOV.
(maskstore<mode><avx512fmaskmodelower): Ditto.
(*<avx512>_store<mode>_mask): New define_insn, it's renamed
from original <avx512>_store<mode>_mask.

2 years agoRefine maskloadmn pattern with UNSPEC_MASKLOAD.
liuhongt [Tue, 20 Jun 2023 07:41:00 +0000 (15:41 +0800)] 
Refine maskloadmn pattern with UNSPEC_MASKLOAD.

If mem_addr points to a memory region with less than whole vector size
bytes of accessible memory and k is a mask that would prevent reading
the inaccessible bytes from mem_addr, add UNSPEC_MASKLOAD to prevent
it to be transformed to vpblendd.

gcc/ChangeLog:

PR target/110309
* config/i386/sse.md (maskload<mode><avx512fmaskmodelower>):
Refine pattern with UNSPEC_MASKLOAD.
(maskload<mode><avx512fmaskmodelower>): Ditto.

2 years agoDaily bump.
GCC Administrator [Thu, 29 Jun 2023 00:19:33 +0000 (00:19 +0000)] 
Daily bump.

2 years agoSupport parallel testing in libgomp: fallback Perl 'flock' [PR66005]
Thomas Schwinge [Mon, 15 May 2023 18:00:07 +0000 (20:00 +0200)] 
Support parallel testing in libgomp: fallback Perl 'flock' [PR66005]

Follow-up to commit 6c3b30ef9e0578509bdaf59c13da4a212fe6c2ba
"Support parallel testing in libgomp, part II [PR66005]"
("..., and enable if 'flock' is available for serializing execution testing"),
where we saw:

> On my Dell Precision 7530 laptop:
>
>     $ uname -srvi
>     Linux 5.15.0-71-generic #78-Ubuntu SMP Tue Apr 18 09:00:29 UTC 2023 x86_64
>     $ grep '^model name' < /proc/cpuinfo | uniq -c
>          12 model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
>     $ nvidia-smi -L
>     GPU 0: Quadro P1000 (UUID: GPU-e043973b-b52a-d02b-c066-a8fdbf64e8ea)
>
> ... [...]: case (c) standard configuration, no offloading
> configured, [...]

>     $ \time make check-target-libgomp
>
> Case (c), baseline; [...]:
>
>     1180.98user 110.80system 19:36.40elapsed 109%CPU (0avgtext+0avgdata 505148maxresident)k
>     1133.22user 111.08system 19:35.75elapsed 105%CPU (0avgtext+0avgdata 505212maxresident)k
>
> Case (c), parallelized [using 'flock']:
>
> [...]
>     -j12 GCC_TEST_PARALLEL_SLOTS=12
>     2591.04user 192.64system 4:44.98elapsed 976%CPU (0avgtext+0avgdata 505216maxresident)k
>     2581.23user 195.21system 4:47.51elapsed 965%CPU (0avgtext+0avgdata 505212maxresident)k

Quite the same when instead of 'flock' using this fallback Perl 'flock':

    2565.23user 194.35system 4:46.77elapsed 962%CPU (0avgtext+0avgdata 505216maxresident)k
    2549.38user 200.20system 4:46.08elapsed 961%CPU (0avgtext+0avgdata 505216maxresident)k

PR testsuite/66005
gcc/
* doc/install.texi: Document (optional) Perl usage for parallel
testing of libgomp.
libgomp/
* testsuite/lib/libgomp.exp: 'flock' through stdout.
* testsuite/flock: New.
* configure.ac (FLOCK): Point to that if no 'flock' available, but
'perl' is.
* configure: Regenerate.

(cherry picked from commit 04abe1944d30eb18a2060cfcd9695d085f7b4752)

2 years agoSupport parallel testing in libgomp, part II [PR66005]
Thomas Schwinge [Tue, 25 Apr 2023 21:53:12 +0000 (23:53 +0200)] 
Support parallel testing in libgomp, part II [PR66005]

..., and enable if 'flock' is available for serializing execution testing.

Regarding the default of 19 parallel slots, this turned out to be a local
minimum for wall time when testing this on:

    $ uname -srvi
    Linux 4.2.0-42-generic #49~14.04.1-Ubuntu SMP Wed Jun 29 20:22:11 UTC 2016 x86_64
    $ grep '^model name' < /proc/cpuinfo | uniq -c
         32 model name      : Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz

... in two configurations: case (a) standard configuration, no offloading
configured, case (b) offloading for GCN and nvptx configured but no devices
available.  For both cases, default plus '-m32' variant.

    $ \time make check-target-libgomp RUNTESTFLAGS="--target_board=unix\{,-m32\}"

Case (a), baseline:

    6432.23user 332.38system 47:32.28elapsed 237%CPU (0avgtext+0avgdata 505044maxresident)k
    6382.43user 319.21system 47:06.04elapsed 237%CPU (0avgtext+0avgdata 505172maxresident)k

This is what people have been complaining about, rightly so, in
<https://gcc.gnu.org/PR66005> "libgomp make check time is excessive" and
elsewhere.

Case (a), parallelized:

    -j12 GCC_TEST_PARALLEL_SLOTS=10
    3088.49user 267.74system 6:43.82elapsed 831%CPU (0avgtext+0avgdata 505188maxresident)k
    -j15 GCC_TEST_PARALLEL_SLOTS=15
    3308.08user 294.79system 5:56.04elapsed 1011%CPU (0avgtext+0avgdata 505360maxresident)k
    -j17 GCC_TEST_PARALLEL_SLOTS=17
    3539.93user 298.99system 5:27.86elapsed 1170%CPU (0avgtext+0avgdata 505112maxresident)k
    -j18 GCC_TEST_PARALLEL_SLOTS=18
    3697.50user 317.18system 5:14.63elapsed 1275%CPU (0avgtext+0avgdata 505360maxresident)k
    -j19 GCC_TEST_PARALLEL_SLOTS=19
    3765.94user 324.27system 5:13.22elapsed 1305%CPU (0avgtext+0avgdata 505128maxresident)k
    -j20 GCC_TEST_PARALLEL_SLOTS=20
    3684.66user 312.32system 5:15.26elapsed 1267%CPU (0avgtext+0avgdata 505100maxresident)k
    -j23 GCC_TEST_PARALLEL_SLOTS=23
    4040.59user 347.10system 5:29.12elapsed 1333%CPU (0avgtext+0avgdata 505200maxresident)k
    -j26 GCC_TEST_PARALLEL_SLOTS=26
    3973.24user 377.96system 5:24.70elapsed 1340%CPU (0avgtext+0avgdata 505160maxresident)k
    -j32 GCC_TEST_PARALLEL_SLOTS=32
    4004.42user 346.10system 5:16.11elapsed 1376%CPU (0avgtext+0avgdata 505160maxresident)k

Yay!

Case (b), baseline; 2+ h:

    7227.58user 700.54system 2:14:33elapsed 98%CPU (0avgtext+0avgdata 994264maxresident)k

Case (b), parallelized:

    -j12 GCC_TEST_PARALLEL_SLOTS=10
    7377.46user 777.52system 16:06.63elapsed 843%CPU (0avgtext+0avgdata 994344maxresident)k
    -j15 GCC_TEST_PARALLEL_SLOTS=15
    8019.18user 721.42system 12:13.56elapsed 1191%CPU (0avgtext+0avgdata 994228maxresident)k
    -j17 GCC_TEST_PARALLEL_SLOTS=17
    8530.11user 716.95system 10:45.92elapsed 1431%CPU (0avgtext+0avgdata 994176maxresident)k
    -j18 GCC_TEST_PARALLEL_SLOTS=18
    8776.79user 645.89system 10:27.20elapsed 1502%CPU (0avgtext+0avgdata 994248maxresident)k
    -j19 GCC_TEST_PARALLEL_SLOTS=19
    9332.37user 641.76system 10:15.09elapsed 1621%CPU (0avgtext+0avgdata 994260maxresident)k
    -j20 GCC_TEST_PARALLEL_SLOTS=20
    9609.54user 789.88system 10:26.94elapsed 1658%CPU (0avgtext+0avgdata 994284maxresident)k
    -j23 GCC_TEST_PARALLEL_SLOTS=23
    10362.40user 911.14system 10:44.47elapsed 1749%CPU (0avgtext+0avgdata 994208maxresident)k
    -j26 GCC_TEST_PARALLEL_SLOTS=26
    11159.44user 850.99system 11:09.25elapsed 1794%CPU (0avgtext+0avgdata 994256maxresident)k
    -j32 GCC_TEST_PARALLEL_SLOTS=32
    11453.50user 939.52system 11:00.38elapsed 1876%CPU (0avgtext+0avgdata 994240maxresident)k

On my Dell Precision 7530 laptop:

    $ uname -srvi
    Linux 5.15.0-71-generic #78-Ubuntu SMP Tue Apr 18 09:00:29 UTC 2023 x86_64
    $ grep '^model name' < /proc/cpuinfo | uniq -c
         12 model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    $ nvidia-smi -L
    GPU 0: Quadro P1000 (UUID: GPU-e043973b-b52a-d02b-c066-a8fdbf64e8ea)

... in two configurations: case (c) standard configuration, no offloading
configured, case (d) offloading for nvptx configured and device available.
For both cases, only default variant, no '-m32'.

    $ \time make check-target-libgomp

Case (c), baseline; roughly half of case (a) (just one variant):

    1180.98user 110.80system 19:36.40elapsed 109%CPU (0avgtext+0avgdata 505148maxresident)k
    1133.22user 111.08system 19:35.75elapsed 105%CPU (0avgtext+0avgdata 505212maxresident)k

Case (c), parallelized:

    -j12 GCC_TEST_PARALLEL_SLOTS=2
    1143.83user 110.76system 10:20.46elapsed 202%CPU (0avgtext+0avgdata 505216maxresident)k
    -j12 GCC_TEST_PARALLEL_SLOTS=6
    1737.08user 143.94system 4:59.48elapsed 628%CPU (0avgtext+0avgdata 505200maxresident)k
    1730.31user 143.02system 4:58.75elapsed 627%CPU (0avgtext+0avgdata 505152maxresident)k
    -j12 GCC_TEST_PARALLEL_SLOTS=8
    2192.63user 169.34system 4:52.96elapsed 806%CPU (0avgtext+0avgdata 505216maxresident)k
    2219.04user 167.67system 4:53.19elapsed 814%CPU (0avgtext+0avgdata 505152maxresident)k
    -j12 GCC_TEST_PARALLEL_SLOTS=10
    2463.93user 184.98system 4:48.39elapsed 918%CPU (0avgtext+0avgdata 505200maxresident)k
    2455.62user 183.68system 4:47.40elapsed 918%CPU (0avgtext+0avgdata 505216maxresident)k
    -j12 GCC_TEST_PARALLEL_SLOTS=12
    2591.04user 192.64system 4:44.98elapsed 976%CPU (0avgtext+0avgdata 505216maxresident)k
    2581.23user 195.21system 4:47.51elapsed 965%CPU (0avgtext+0avgdata 505212maxresident)k
    -j20 GCC_TEST_PARALLEL_SLOTS=20 [oversubscribe]
    2613.18user 199.51system 4:44.06elapsed 990%CPU (0avgtext+0avgdata 505216maxresident)k

Case (d), baseline (compared to case (b): only nvptx offloading compilation,
but also nvptx offloading execution); ~1 h:

    2841.93user 653.68system 1:02:26elapsed 93%CPU (0avgtext+0avgdata 909792maxresident)k
    2842.03user 654.39system 1:02:24elapsed 93%CPU (0avgtext+0avgdata 909880maxresident)k

Case (d), parallelized:

    -j12 GCC_TEST_PARALLEL_SLOTS=2
    2856.39user 606.87system 33:58.64elapsed 169%CPU (0avgtext+0avgdata 909948maxresident)k
    -j12 GCC_TEST_PARALLEL_SLOTS=6
    3444.90user 666.86system 18:37.57elapsed 367%CPU (0avgtext+0avgdata 909856maxresident)k
    3462.13user 667.13system 18:36.87elapsed 369%CPU (0avgtext+0avgdata 909872maxresident)k
    -j12 GCC_TEST_PARALLEL_SLOTS=8
    3929.74user 716.22system 18:02.36elapsed 429%CPU (0avgtext+0avgdata 909832maxresident)k
    -j12 GCC_TEST_PARALLEL_SLOTS=10
    4152.84user 736.16system 17:43.05elapsed 459%CPU (0avgtext+0avgdata 909872maxresident)k
    -j12 GCC_TEST_PARALLEL_SLOTS=12
    4209.60user 749.00system 17:35.20elapsed 469%CPU (0avgtext+0avgdata 909840maxresident)k
    -j20 GCC_TEST_PARALLEL_SLOTS=20 [oversubscribe]
    4255.54user 756.78system 17:29.06elapsed 477%CPU (0avgtext+0avgdata 909868maxresident)k

Worth noting is that with nvptx offloading, there is one execution test case
that times out ('libgomp.fortran/reverse-offload-5.f90').  This effectively
stalls progress for almost 5 min: quickly other executions test cases queue up
on the lock for all parallel slots.  That's working as expected; just noting
this as it accordingly does skew the wall time numbers.

PR testsuite/66005
libgomp/
* configure.ac: Look for 'flock'.
* testsuite/Makefile.am (gcc_test_parallel_slots): Enable parallel testing.
* testsuite/config/default.exp: Don't 'load_lib "standard.exp"' here...
* testsuite/lib/libgomp.exp: ... but here, instead.
(libgomp_load): Override for parallel testing.
* testsuite/libgomp-site-extra.exp.in (FLOCK): Set.
* configure: Regenerate.
* Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.

(cherry picked from commit 6c3b30ef9e0578509bdaf59c13da4a212fe6c2ba)

2 years agoSupport parallel testing in libgomp, part I [PR66005]
Rainer Orth [Thu, 7 May 2015 11:26:57 +0000 (13:26 +0200)] 
Support parallel testing in libgomp, part I [PR66005]

..., while still hard-coding the number of parallel slots to one.

PR testsuite/66005
libgomp/
* testsuite/Makefile.am (PWD_COMMAND): New variable.
(%/site.exp): New target.
(check_p_numbers0, check_p_numbers1, check_p_numbers2)
(check_p_numbers3, check_p_numbers4, check_p_numbers5)
(check_p_numbers6, check_p_numbers, gcc_test_parallel_slots)
(check_p_subdirs)
(check_DEJAGNU_libgomp_targets): New variables.
($(check_DEJAGNU_libgomp_targets)): New target.
($(check_DEJAGNU_libgomp_targets)): New dependency.
(check-DEJAGNU $(check_DEJAGNU_libgomp_targets)): New targets.
* testsuite/Makefile.in: Regenerate.
* testsuite/lib/libgomp.exp: For parallel testing,
'load_file ../libgomp-test-support.exp'.

Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>
(cherry picked from commit e797db5c744f7b4e110f23a495fca8e6b8aebe83)

2 years agoMake option mvzeroupper independent of optimization level.
liuhongt [Mon, 26 Jun 2023 01:50:25 +0000 (09:50 +0800)] 
Make option mvzeroupper independent of optimization level.

pass_insert_vzeroupper is under condition

TARGET_AVX && TARGET_VZEROUPPER
&& flag_expensive_optimizations && !optimize_size

But the document of mvzeroupper doesn't mention the insertion
required -O2 and above, it may confuse users when they explicitly
use -Os -mvzeroupper.

------------
mvzeroupper
Target Mask(VZEROUPPER) Save
Generate vzeroupper instruction before a transfer of control flow out of
the function.
------------

The patch moves flag_expensive_optimizations && !optimize_size to
ix86_option_override_internal. It makes -mvzeroupper independent of
optimization level, but still keeps the behavior of architecture
tuning(emit_vzeroupper) unchanged.

gcc/ChangeLog:

* config/i386/i386-features.c (pass_insert_vzeroupper:gate):
Move flag_expensive_optimizations && !optimize_size to ..
* config/i386/i386-options.c (ix86_option_override_internal):
.. this, it makes -mvzeroupper independent of optimization
level, but still keeps the behavior of architecture
tuning(emit_vzeroupper) unchanged.
(rest_of_handle_insert_vzeroupper): Remove
flag_expensive_optimizations && !optimize_size.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx-vzeroupper-29.c: New testcase.

2 years agoDaily bump.
GCC Administrator [Wed, 28 Jun 2023 00:20:10 +0000 (00:20 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 27 Jun 2023 00:20:37 +0000 (00:20 +0000)] 
Daily bump.

2 years agod: Suboptimal codegen for __builtin_expect(cond, false)
Iain Buclaw [Mon, 26 Jun 2023 01:24:27 +0000 (03:24 +0200)] 
d: Suboptimal codegen for __builtin_expect(cond, false)

Since PR96435, both boolean objects and expressions have been evaluated
in the following way.

    (*(ubyte*)&obj_or_expr) & 1

It has been noted that sometimes this can cause the back-end to optimize
in non-obvious ways - in particular with __builtin_expect.

This @safe feature is now restricted to just when reading the value of a
bool field that comes from a union.

PR d/110359

gcc/d/ChangeLog:

* d-convert.cc (convert_for_rvalue): Only apply the @safe boolean
conversion to boolean fields of a union.
(convert_for_condition): Call convert_for_rvalue in the default case.

gcc/testsuite/ChangeLog:

* gdc.dg/pr110359.d: New test.

(cherry picked from commit ab98db1e8c1b997414539f41b7fb814019497d8d)

2 years agoDaily bump.
GCC Administrator [Mon, 26 Jun 2023 00:19:02 +0000 (00:19 +0000)] 
Daily bump.