Compare commits

..

No commits in common. "c8" and "a8-beta" have entirely different histories.
c8 ... a8-beta

8 changed files with 15 additions and 4904 deletions

View File

@ -1,59 +0,0 @@
2024-04-18 Jakub Jelinek <jakub@redhat.com>
* tree-vect-stmts.c (vectorizable_call): For j == 0 use
vargs.safe_grow (nargs) rather than vargs.create (nargs), for j != 0
remove vargs.truncate (0). Instead of vargs.quick_push store into
vargs[i]. Use vargs[i] instead of gimple_call_arg (new_stmt, i)
if j != 0.
* gcc.c-torture/compile/20240418.c: New test.
--- gcc/tree-vect-stmts.c.jj 2021-04-22 15:48:48.228178359 +0200
+++ gcc/tree-vect-stmts.c 2024-04-18 13:21:46.104061529 +0200
@@ -3242,9 +3242,7 @@ vectorizable_call (gimple *gs, gimple_st
{
/* Build argument list for the vectorized call. */
if (j == 0)
- vargs.create (nargs);
- else
- vargs.truncate (0);
+ vargs.safe_grow (nargs);
if (slp_node)
{
@@ -3252,7 +3250,7 @@ vectorizable_call (gimple *gs, gimple_st
vec<tree> vec_oprnds0;
for (i = 0; i < nargs; i++)
- vargs.quick_push (gimple_call_arg (stmt, i));
+ vargs[i] = gimple_call_arg (stmt, i);
vect_get_slp_defs (vargs, slp_node, &vec_defs);
vec_oprnds0 = vec_defs[0];
@@ -3314,13 +3312,10 @@ vectorizable_call (gimple *gs, gimple_st
vec_oprnd0
= vect_get_vec_def_for_operand (op, stmt);
else
- {
- vec_oprnd0 = gimple_call_arg (new_stmt, i);
- vec_oprnd0
- = vect_get_vec_def_for_stmt_copy (dt[i], vec_oprnd0);
- }
+ vec_oprnd0
+ = vect_get_vec_def_for_stmt_copy (dt[i], vargs[i]);
- vargs.quick_push (vec_oprnd0);
+ vargs[i] = vec_oprnd0;
}
if (gimple_call_internal_p (stmt)
--- gcc/testsuite/gcc.c-torture/compile/20240418.c.jj 2024-04-18 13:24:10.180065661 +0200
+++ gcc/testsuite/gcc.c-torture/compile/20240418.c 2024-04-18 13:19:12.166194018 +0200
@@ -0,0 +1,7 @@
+void
+foo (signed char *p, unsigned long long *q)
+{
+ int i;
+ for (i = 0; i <= 64; i++)
+ *p++ = __builtin_popcountll (*q++);
+}

View File

@ -1,30 +0,0 @@
The change is based on:
commit 190c644c06369766aa2537851ddbf83b1231b65b
Author: Philipp Fent <fent@in.tum.de>
Date: Sun Sep 4 20:47:34 2022 +0200
libstdc++: Fix pretty printer tests of tuple indexes
but it is adapted to GCC8 since it does not have the tuple inheritance change,
which is:
commit 91e6226f880b048275a7ceedef716e159c7cefd9
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Aug 7 17:13:56 2020 +0100
libstdc++: Remove inheritance from elements in std::tuple
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/48362.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/48362.cc
index cc91803e247..af335d0d3c7 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/48362.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/48362.cc
@@ -29,7 +29,7 @@ main()
// { dg-final { note-test t1 {empty std::tuple} } }
std::tuple<std::string, int, std::tuple<>> t2{ "Johnny", 5, {} };
-// { dg-final { regexp-test t2 {std::tuple containing = {\[1\] = "Johnny", \[2\] = 5, \[3\] = {<std::(__8::)?tuple<>> = empty std::tuple, <No data fields>}}} } }
+// { dg-final { regexp-test t2 {std::tuple containing = {\[0\] = "Johnny", \[1\] = 5, \[2\] = {<std::(__8::)?tuple<>> = empty std::tuple, <No data fields>}}} } }
std::cout << "\n";
return 0; // Mark SPOT

View File

@ -1,27 +0,0 @@
NullablePointer support not available, so drop these tests.
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc.new
index 2f75d12..6fb19c3 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
@@ -145,20 +145,6 @@ main()
std::unique_ptr<data>& rarrptr = arrptr;
// { dg-final { regexp-test rarrptr {std::unique_ptr.datum \[\]. = {get\(\) = 0x.*}} } }
- struct Deleter
- {
- int deleter_member = -1;
- using pointer = __gnu_test::NullablePointer<void>;
- void operator()(pointer) const noexcept { }
- };
- static_assert( !std::is_empty<Deleter>(), "Deleter is not empty" );
- static_assert( std::is_empty<Deleter::pointer>(), "but pointer is empty" );
-
- std::unique_ptr<int, Deleter> empty_ptr;
-// { dg-final { note-test empty_ptr {std::unique_ptr<int> = {get() = {<No data fields>}}} } }
- std::unique_ptr<int, Deleter>& rempty_ptr = empty_ptr;
-// { dg-final { note-test rempty_ptr {std::unique_ptr<int> = {get() = {<No data fields>}}} } }
-
struct Deleter_pr103086
{
int deleter_member = -1;

View File

@ -1,44 +0,0 @@
Revert this commit for libstdc++-prettyprinters (only cxx17, 91997
doesn't exist in this tree) since gcc8 does not default to c++17. The
context has been adapted but the change should be exact:
commit 0498d2d09a2364aae1e6b5e085c8ebb8fc517684
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Mon May 10 16:22:54 2021 +0100
libstdc++: Remove redundant -std=gnu++17 option from remaining tests
Also remove the filesystem tests since it's not supported by RHEL8 gcc.
diff --git b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc
index 72c66d3b785..98e21e963fe 100644
--- b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc
+++ a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc
@@ -1,4 +1,4 @@
-// { dg-options "-g -O0" }
+// { dg-options "-g -O0 -std=gnu++17" }
// { dg-do run { target c++17 } }
// Copyright (C) 2014-2024 Free Software Foundation, Inc.
@@ -18,7 +18,6 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-#include <filesystem>
#include <any>
#include <optional>
#include <variant>
@@ -120,13 +119,6 @@ main()
// { dg-final { regexp-test q {std::shared_ptr.int \[2\]. \(use count 2, weak count 1\) = {get\(\) = 0x.*}} } }
// { dg-final { regexp-test wq {std::weak_ptr.int \[2\]. \(use count 2, weak count 1\) = {get\(\) = 0x.*}} } }
- std::filesystem::path path0;
-// { dg-final { note-test path0 {filesystem::path ""} } }
- std::filesystem::path path1("filename");
-// { dg-final { note-test path1 {filesystem::path "filename"} } }
- std::filesystem::path path2("/dir/.");
-// { dg-final { note-test path2 {filesystem::path "/dir/." = {[root-directory] = "/", [1] = "dir", [2] = "."}} } }
-
std::cout << "\n";
return 0; // Mark SPOT
}

View File

@ -1,458 +0,0 @@
.../testsuite/libstdc++-prettyprinters/compat.cc | 11 +-
.../testsuite/libstdc++-prettyprinters/cxx11.cc | 129 +++++++++++++++------
.../testsuite/libstdc++-prettyprinters/cxx17.cc | 50 +++++---
.../libstdc++-prettyprinters/filesystem-ts.cc | 8 +-
.../libstdc++-prettyprinters/libfundts.cc | 26 +++--
5 files changed, 146 insertions(+), 78 deletions(-)
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/compat.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/compat.cc
index 81e0ce7213f..604a6f6415b 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/compat.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/compat.cc
@@ -1,8 +1,7 @@
// { dg-options "-g -O0" }
// { dg-do run { target c++11 } }
-// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
-// Copyright (C) 2014-2019 Free Software Foundation, Inc.
+// Copyright (C) 2014-2024 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -103,13 +102,13 @@ main()
using std::optional;
optional<int> o;
-// { dg-final { note-test o {std::optional<int> [no contained value]} } }
+// { dg-final { note-test o {std::optional [no contained value]} } }
optional<bool> ob{false};
-// { dg-final { note-test ob {std::optional<bool> = {[contained value] = false}} } }
+// { dg-final { note-test ob {std::optional = {[contained value] = false}} } }
optional<int> oi{5};
-// { dg-final { note-test oi {std::optional<int> = {[contained value] = 5}} } }
+// { dg-final { note-test oi {std::optional = {[contained value] = 5}} } }
optional<void*> op{nullptr};
-// { dg-final { note-test op {std::optional<void *> = {[contained value] = 0x0}} } }
+// { dg-final { note-test op {std::optional = {[contained value] = 0x0}} } }
__builtin_puts("");
return 0; // Mark SPOT
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
index 9a90d8d91db..2f75d12703c 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
@@ -1,8 +1,7 @@
// { dg-do run { target c++11 } }
// { dg-options "-g -O0" }
-// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
-// Copyright (C) 2011-2018 Free Software Foundation, Inc.
+// Copyright (C) 2011-2024 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -25,6 +24,10 @@
#include <string>
#include <memory>
#include <iostream>
+#include <future>
+#include <initializer_list>
+#include <atomic>
+#include "../util/testsuite_allocator.h" // NullablePointer
typedef std::tuple<int, int> ExTuple;
@@ -60,84 +63,74 @@ struct datum
std::unique_ptr<datum> global;
-struct Deleter
-{
- // Deleter is not an empty class:
- int deleter_member = -1;
- // But pointer is an empty class:
- struct pointer
- {
- pointer(const void* = nullptr) { }
- explicit operator bool() const noexcept { return false; }
- friend bool operator==(pointer, pointer) noexcept { return true; }
- friend bool operator!=(pointer, pointer) noexcept { return false; }
- };
- void operator()(pointer) const noexcept { }
+struct custom_cat : std::error_category {
+ const char* name() const noexcept { return "miaow"; }
+ std::string message(int) const { return ""; }
};
int
main()
{
std::forward_list<int> efl;
-// { dg-final { note-test efl "empty std::forward_list" } }
+// { dg-final { regexp-test efl "empty std::(__debug::)?forward_list" } }
std::forward_list<int> &refl = efl;
-// { dg-final { note-test refl "empty std::forward_list" } }
+// { dg-final { regexp-test refl "empty std::(__debug::)?forward_list" } }
std::forward_list<int> fl;
fl.push_front(2);
fl.push_front(1);
-// { dg-final { note-test fl {std::forward_list = {[0] = 1, [1] = 2}} } }
+// { dg-final { regexp-test fl {std::(__debug::)?forward_list = {\[0\] = 1, \[1\] = 2}} } }
std::forward_list<int> &rfl = fl;
-// { dg-final { note-test rfl {std::forward_list = {[0] = 1, [1] = 2}} } }
+// { dg-final { regexp-test rfl {std::(__debug::)?forward_list = {\[0\] = 1, \[1\] = 2}} } }
std::unordered_map<int, std::string> eum;
-// { dg-final { note-test eum "std::unordered_map with 0 elements" } }
+// { dg-final { regexp-test eum "std::(__debug::)?unordered_map with 0 elements" } }
std::unordered_map<int, std::string> &reum = eum;
-// { dg-final { note-test reum "std::unordered_map with 0 elements" } }
+// { dg-final { regexp-test reum "std::(__debug::)?unordered_map with 0 elements" } }
std::unordered_multimap<int, std::string> eumm;
-// { dg-final { note-test eumm "std::unordered_multimap with 0 elements" } }
+// { dg-final { regexp-test eumm "std::(__debug::)?unordered_multimap with 0 elements" } }
std::unordered_multimap<int, std::string> &reumm = eumm;
-// { dg-final { note-test reumm "std::unordered_multimap with 0 elements" } }
+// { dg-final { regexp-test reumm "std::(__debug::)?unordered_multimap with 0 elements" } }
std::unordered_set<int> eus;
-// { dg-final { note-test eus "std::unordered_set with 0 elements" } }
+// { dg-final { regexp-test eus "std::(__debug::)?unordered_set with 0 elements" } }
std::unordered_set<int> &reus = eus;
-// { dg-final { note-test reus "std::unordered_set with 0 elements" } }
+// { dg-final { regexp-test reus "std::(__debug::)?unordered_set with 0 elements" } }
std::unordered_multiset<int> eums;
-// { dg-final { note-test eums "std::unordered_multiset with 0 elements" } }
+// { dg-final { regexp-test eums "std::(__debug::)?unordered_multiset with 0 elements" } }
std::unordered_multiset<int> &reums = eums;
-// { dg-final { note-test reums "std::unordered_multiset with 0 elements" } }
+// { dg-final { regexp-test reums "std::(__debug::)?unordered_multiset with 0 elements" } }
std::unordered_map<int, std::string> uom;
uom[5] = "three";
uom[3] = "seven";
-// { dg-final { note-test uom {std::unordered_map with 2 elements = {[3] = "seven", [5] = "three"}} } }
+// { dg-final { regexp-test uom {std::(__debug::)?unordered_map with 2 elements = {\[3\] = "seven", \[5\] = "three"}} } }
std::unordered_map<int, std::string> &ruom = uom;
-// { dg-final { note-test ruom {std::unordered_map with 2 elements = {[3] = "seven", [5] = "three"}} } }
+// { dg-final { regexp-test ruom {std::(__debug::)?unordered_map with 2 elements = {\[3\] = "seven", \[5\] = "three"}} } }
std::unordered_multimap<int, std::string> uomm;
uomm.insert(std::pair<int, std::string> (5, "three"));
uomm.insert(std::pair<int, std::string> (5, "seven"));
-// { dg-final { note-test uomm {std::unordered_multimap with 2 elements = {[5] = "seven", [5] = "three"}} } }
+// { dg-final { regexp-test uomm {std::(__debug::)?unordered_multimap with 2 elements = {\[5\] = "seven", \[5\] = "three"}} } }
std::unordered_multimap<int, std::string> &ruomm = uomm;
-// { dg-final { note-test ruomm {std::unordered_multimap with 2 elements = {[5] = "seven", [5] = "three"}} } }
+// { dg-final { regexp-test ruomm {std::(__debug::)?unordered_multimap with 2 elements = {\[5\] = "seven", \[5\] = "three"}} } }
std::unordered_set<int> uos;
uos.insert(5);
-// { dg-final { note-test uos {std::unordered_set with 1 element = {[0] = 5}} } }
+// { dg-final { regexp-test uos {std::(__debug::)?unordered_set with 1 element = {\[0\] = 5}} } }
std::unordered_set<int> &ruos = uos;
-// { dg-final { note-test ruos {std::unordered_set with 1 element = {[0] = 5}} } }
+// { dg-final { regexp-test ruos {std::(__debug::)?unordered_set with 1 element = {\[0\] = 5}} } }
std::unordered_multiset<int> uoms;
uoms.insert(5);
-// { dg-final { note-test uoms {std::unordered_multiset with 1 element = {[0] = 5}} } }
+// { dg-final { regexp-test uoms {std::(__debug::)?unordered_multiset with 1 element = {\[0\] = 5}} } }
std::unordered_multiset<int> &ruoms = uoms;
-// { dg-final { note-test ruoms {std::unordered_multiset with 1 element = {[0] = 5}} } }
+// { dg-final { regexp-test ruoms {std::(__debug::)?unordered_multiset with 1 element = {\[0\] = 5}} } }
std::unique_ptr<datum> uptr (new datum);
uptr->s = "hi bob";
@@ -152,15 +145,77 @@ main()
std::unique_ptr<data>& rarrptr = arrptr;
// { dg-final { regexp-test rarrptr {std::unique_ptr.datum \[\]. = {get\(\) = 0x.*}} } }
+ struct Deleter
+ {
+ int deleter_member = -1;
+ using pointer = __gnu_test::NullablePointer<void>;
+ void operator()(pointer) const noexcept { }
+ };
+ static_assert( !std::is_empty<Deleter>(), "Deleter is not empty" );
+ static_assert( std::is_empty<Deleter::pointer>(), "but pointer is empty" );
+
std::unique_ptr<int, Deleter> empty_ptr;
// { dg-final { note-test empty_ptr {std::unique_ptr<int> = {get() = {<No data fields>}}} } }
std::unique_ptr<int, Deleter>& rempty_ptr = empty_ptr;
// { dg-final { note-test rempty_ptr {std::unique_ptr<int> = {get() = {<No data fields>}}} } }
+ struct Deleter_pr103086
+ {
+ int deleter_member = -1;
+ void operator()(int*) const noexcept { }
+ };
+
+ std::unique_ptr<int, Deleter_pr103086> uniq_ptr;
+// { dg-final { note-test uniq_ptr {std::unique_ptr<int> = {get() = 0x0}} } }
+ std::unique_ptr<int, Deleter_pr103086>& runiq_ptr = uniq_ptr;
+// { dg-final { note-test runiq_ptr {std::unique_ptr<int> = {get() = 0x0}} } }
+
ExTuple tpl(6,7);
-// { dg-final { note-test tpl {std::tuple containing = {[1] = 6, [2] = 7}} } }
+// { dg-final { note-test tpl {std::tuple containing = {[0] = 6, [1] = 7}} } }
ExTuple &rtpl = tpl;
-// { dg-final { note-test rtpl {std::tuple containing = {[1] = 6, [2] = 7}} } }
+// { dg-final { note-test rtpl {std::tuple containing = {[0] = 6, [1] = 7}} } }
+
+ std::error_code e0;
+ // { dg-final { note-test e0 {std::error_code = { }} } }
+ std::error_condition ec0;
+ // { dg-final { note-test ec0 {std::error_condition = { }} } }
+ std::error_code einval = std::make_error_code(std::errc::invalid_argument);
+ // { dg-final { note-test einval {std::error_code = {"generic": EINVAL}} } }
+ std::error_condition ecinval = std::make_error_condition(std::errc::invalid_argument);
+ // { dg-final { note-test ecinval {std::error_condition = {"generic": EINVAL}} } }
+
+ custom_cat cat;
+ std::error_code emiaow(42, cat);
+ // { dg-final { note-test emiaow {std::error_code = {custom_cat: 42}} } }
+ std::error_condition ecmiaow(42, cat);
+ // { dg-final { note-test ecmiaow {std::error_condition = {custom_cat: 42}} } }
+
+ std::error_code ecio = std::make_error_code(std::io_errc::stream);
+ // { dg-final { note-test ecio {std::error_code = {"io": stream}} } }
+ std::error_code ecfut0 = std::make_error_code(std::future_errc{});
+ // { dg-final { note-test ecfut0 {std::error_code = {"future": 0}} } }
+
+ std::initializer_list<int> emptyIl = {};
+ // { dg-final { note-test emptyIl {std::initializer_list of length 0} } }
+ std::initializer_list<int> il = {3, 4};
+ // { dg-final { note-test il {std::initializer_list of length 2 = {3, 4}} } }
+
+ std::atomic<int> ai{100};
+ // { dg-final { note-test ai {std::atomic<int> = { 100 }} } }
+ long l{};
+ std::atomic<long*> ap{&l};
+ // { dg-final { regexp-test ap {std::atomic.long \*. = { 0x.* }} } }
+ struct Value { int i, j; };
+ std::atomic<Value> av{{8, 9}};
+ // { dg-final { note-test av {std::atomic<Value> = { {i = 8, j = 9} }} } }
+
+ std::integral_constant<int, 1> one;
+ // { dg-final { note-test one {std::integral_constant<int, 1>} } }
+ std::integral_constant<bool, true> truth;
+ // { dg-final { note-test truth {std::true_type} } }
+ std::integral_constant<bool, 0> lies;
+ // { dg-final { note-test lies {std::false_type} } }
+
placeholder(""); // Mark SPOT
use(efl);
use(fl);
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc
index 0c7cb4c9bb6..c8b70622bef 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc
@@ -1,8 +1,7 @@
-// { dg-options "-g -O0 -std=gnu++17" }
+// { dg-options "-g -O0" }
// { dg-do run { target c++17 } }
-// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
-// Copyright (C) 2014-2018 Free Software Foundation, Inc.
+// Copyright (C) 2014-2024 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -19,9 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// Type printers only recognize the old std::string for now.
-#define _GLIBCXX_USE_CXX11_ABI 0
-
+#include <filesystem>
#include <any>
#include <optional>
#include <variant>
@@ -41,6 +38,11 @@ using std::unordered_set;
using std::shared_ptr;
using std::weak_ptr;
+struct X {
+ X(int) { }
+ X(const X&) { } // not trivially-copyable
+};
+
int
main()
{
@@ -48,18 +50,18 @@ main()
// { dg-final { note-test str "\"string\"" } }
optional<int> o;
-// { dg-final { note-test o {std::optional<int> [no contained value]} } }
+// { dg-final { note-test o {std::optional [no contained value]} } }
optional<bool> ob{false};
-// { dg-final { note-test ob {std::optional<bool> = {[contained value] = false}} } }
+// { dg-final { note-test ob {std::optional = {[contained value] = false}} } }
optional<int> oi{5};
-// { dg-final { note-test oi {std::optional<int> = {[contained value] = 5}} } }
+// { dg-final { note-test oi {std::optional = {[contained value] = 5}} } }
optional<void*> op{nullptr};
-// { dg-final { note-test op {std::optional<void *> = {[contained value] = 0x0}} } }
+// { dg-final { note-test op {std::optional = {[contained value] = 0x0}} } }
optional<std::map<int, double>> om;
om = std::map<int, double>{ {1, 2.}, {3, 4.}, {5, 6.} };
-// { dg-final { note-test om {std::optional<std::map<int, double>> containing std::map with 3 elements = {[1] = 2, [3] = 4, [5] = 6}} } }
+// { dg-final { regexp-test om {std::optional containing std::(__debug::)?map with 3 elements = {\[1\] = 2, \[3\] = 4, \[5\] = 6}} } }
optional<std::string> os{ "stringy" };
-// { dg-final { note-test os {std::optional<std::string> = {[contained value] = "stringy"}} } }
+// { dg-final { note-test os {std::optional = {[contained value] = "stringy"}} } }
any a;
// { dg-final { note-test a {std::any [no contained value]} } }
@@ -74,22 +76,25 @@ main()
any as2("stringiest");
// { dg-final { regexp-test as2 {std::any containing const char \* = {\[contained value\] = 0x[[:xdigit:]]+ "stringiest"}} } }
any am = *om;
-// { dg-final { note-test am {std::any containing std::map with 3 elements = {[1] = 2, [3] = 4, [5] = 6}} } }
+// { dg-final { regexp-test am {std::any containing std::(__debug::)?map with 3 elements = {\[1\] = 2, \[3\] = 4, \[5\] = 6}} } }
+ struct local_type { int i = 99; };
+ any al = local_type{};
+// { dg-final { note-test al {std::any containing local_type = {[contained value] = {i = 99}}} } }
struct S { operator int() { throw 42; }};
variant<float, int, string_view> v0;
-// { dg-final { note-test v0 {std::variant<float, int, std::string_view> [index 0] = {0}} } }
+// { dg-final { note-test v0 {std::variant [index 0] = {0}} } }
variant<float, int, string_view> v1{ 0.5f };
-// { dg-final { note-test v1 {std::variant<float, int, std::string_view> [index 0] = {0.5}} } }
- variant<float, int, string_view> v2;
+// { dg-final { note-test v1 {std::variant [index 0] = {0.5}} } }
+ variant<float, X, string_view> v2;
try {
v2.emplace<1>(S());
} catch (int) { }
-// { dg-final { note-test v2 {std::variant<float, int, std::string_view> [no contained value]} } }
+// { dg-final { note-test v2 {std::variant [no contained value]} } }
variant<float, int, string_view> v3{ 3 };
-// { dg-final { note-test v3 {std::variant<float, int, std::string_view> [index 1] = {3}} } }
+// { dg-final { note-test v3 {std::variant [index 1] = {3}} } }
variant<float, int, string_view> v4{ str };
-// { dg-final { note-test v4 {std::variant<float, int, std::string_view> [index 2] = {"string"}} } }
+// { dg-final { note-test v4 {std::variant [index 2] = {"string"}} } }
map<int, string_view> m{ {1, "one"} };
map<int, string_view>::node_type n0;
@@ -115,6 +120,13 @@ main()
// { dg-final { regexp-test q {std::shared_ptr.int \[2\]. \(use count 2, weak count 1\) = {get\(\) = 0x.*}} } }
// { dg-final { regexp-test wq {std::weak_ptr.int \[2\]. \(use count 2, weak count 1\) = {get\(\) = 0x.*}} } }
+ std::filesystem::path path0;
+// { dg-final { note-test path0 {filesystem::path ""} } }
+ std::filesystem::path path1("filename");
+// { dg-final { note-test path1 {filesystem::path "filename"} } }
+ std::filesystem::path path2("/dir/.");
+// { dg-final { note-test path2 {filesystem::path "/dir/." = {[root-directory] = "/", [1] = "dir", [2] = "."}} } }
+
std::cout << "\n";
return 0; // Mark SPOT
}
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/filesystem-ts.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/filesystem-ts.cc
index 8a1398f6c85..9faeed02852 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/filesystem-ts.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/filesystem-ts.cc
@@ -2,7 +2,7 @@
// { dg-do run { target c++11 } }
// { dg-require-filesystem-ts "" }
-// Copyright (C) 2020 Free Software Foundation, Inc.
+// Copyright (C) 2020-2024 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -26,11 +26,11 @@ int
main()
{
std::experimental::filesystem::path path0;
-// { dg-final { note-test path0 {filesystem::path ""} } }
+// { dg-final { note-test path0 {experimental::filesystem::path ""} } }
std::experimental::filesystem::path path1("filename");
-// { dg-final { note-test path1 {filesystem::path "filename"} } }
+// { dg-final { note-test path1 {experimental::filesystem::path "filename"} } }
std::experimental::filesystem::path path2("/dir/.");
-// { dg-final { note-test path2 {filesystem::path "/dir/." = {[root-directory] = "/", [1] = "dir", [2] = "."}} } }
+// { dg-final { note-test path2 {experimental::filesystem::path "/dir/." = {[root-directory] = "/", [1] = "dir", [2] = "."}} } }
std::cout << "\n";
return 0; // Mark SPOT
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
index ea13ebe71ee..7a6ee8d281e 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
@@ -1,8 +1,7 @@
// { dg-do run { target c++14 } }
// { dg-options "-g -O0" }
-// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
-// Copyright (C) 2014-2018 Free Software Foundation, Inc.
+// Copyright (C) 2014-2024 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -19,9 +18,6 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// Type printers only recognize the old std::string for now.
-#define _GLIBCXX_USE_CXX11_ABI 0
-
#include <experimental/any>
#include <experimental/optional>
#include <experimental/string_view>
@@ -36,22 +32,28 @@ using std::experimental::string_view;
int
main()
{
+ // Ensure debug info for std::string is issued in the local
+ // translation unit, so that GDB won't pick up any alternate
+ // std::string notion that might be present in libstdc++.so.
+ std::string bah = "hi";
+ (void)bah;
+
string_view str = "string";
// { dg-final { note-test str "\"string\"" } }
optional<int> o;
-// { dg-final { note-test o {std::experimental::optional<int> [no contained value]} } }
+// { dg-final { note-test o {std::experimental::optional [no contained value]} } }
optional<bool> ob{false};
-// { dg-final { note-test ob {std::experimental::optional<bool> = {[contained value] = false}} } }
+// { dg-final { note-test ob {std::experimental::optional = {[contained value] = false}} } }
optional<int> oi{5};
-// { dg-final { note-test oi {std::experimental::optional<int> = {[contained value] = 5}} } }
+// { dg-final { note-test oi {std::experimental::optional = {[contained value] = 5}} } }
optional<void*> op{nullptr};
-// { dg-final { note-test op {std::experimental::optional<void *> = {[contained value] = 0x0}} } }
+// { dg-final { note-test op {std::experimental::optional = {[contained value] = 0x0}} } }
optional<std::map<int, double>> om;
om = std::map<int, double>{ {1, 2.}, {3, 4.}, {5, 6.} };
-// { dg-final { note-test om {std::experimental::optional<std::map<int, double>> containing std::map with 3 elements = {[1] = 2, [3] = 4, [5] = 6}} } }
+// { dg-final { regexp-test om {std::experimental::optional containing std::(__debug::)?map with 3 elements = {\[1\] = 2, \[3\] = 4, \[5\] = 6}} } }
optional<std::string> os{ "stringy" };
-// { dg-final { note-test os {std::experimental::optional<std::string> = {[contained value] = "stringy"}} } }
+// { dg-final { note-test os {std::experimental::optional = {[contained value] = "stringy"}} } }
any a;
// { dg-final { note-test a {std::experimental::any [no contained value]} } }
@@ -66,7 +68,7 @@ main()
any as2("stringiest");
// { dg-final { regexp-test as2 {std::experimental::any containing const char \* = {\[contained value\] = 0x[[:xdigit:]]+ "stringiest"}} } }
any am = *om;
-// { dg-final { note-test am {std::experimental::any containing std::map with 3 elements = {[1] = 2, [3] = 4, [5] = 6}} } }
+// { dg-final { regexp-test am {std::experimental::any containing std::(__debug::)?map with 3 elements = {\[1\] = 2, \[3\] = 4, \[5\] = 6}} } }
std::cout << "\n";
return 0; // Mark SPOT

File diff suppressed because it is too large Load Diff

View File

@ -1,74 +0,0 @@
commit ba374dfb937a8ac1c7c4740913331951a924f88b
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed May 12 10:38:35 2021 +0200
expand: Don't reuse DEBUG_EXPRs with vector type if they have different modes [PR100508]
The inliner doesn't remap DEBUG_EXPR_DECLs, so the same decls can appear
in multiple functions.
Furthermore, expansion reuses corresponding DEBUG_EXPRs too, so they again
can be reused in multiple functions.
Neither of that is a major problem, DEBUG_EXPRs are just magic value holders
and what value they stand for is independent in each function and driven by
what debug stmts or DEBUG_INSNs they are bound to.
Except for DEBUG_EXPR*s with vector types, TYPE_MODE can be either BLKmode
or some vector mode depending on whether current function's enabled ISAs
support that vector mode or not. On the following testcase, we expand it
first in foo function without AVX2 enabled and so the DEBUG_EXPR is
BLKmode, but later the same DEBUG_EXPR_DECL is used in a simd clone with
AVX2 enabled and expansion ICEs because of a mode mismatch.
The following patch fixes that by forcing recreation of a DEBUG_EXPR if
there is a mode mismatch for vector typed DEBUG_EXPR_DECL, DEBUG_EXPRs
will be still reused in between functions otherwise and within the same
function the mode should be always the same.
2021-05-12 Jakub Jelinek <jakub@redhat.com>
PR middle-end/100508
* cfgexpand.c (expand_debug_expr): For DEBUG_EXPR_DECL with vector
type, don't reuse DECL_RTL if it has different mode, instead force
creation of a new DEBUG_EXPR.
* gcc.dg/gomp/pr100508.c: New test.
(cherry picked from commit 19040050aa2c8ee890fc58dda48639fc91bf0af0)
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index b1535e15d28..a7d05202184 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -4358,7 +4358,12 @@ expand_debug_expr (tree exp)
op0 = DECL_RTL_IF_SET (exp);
if (op0)
- return op0;
+ {
+ if (GET_MODE (op0) != mode)
+ gcc_assert (VECTOR_TYPE_P (TREE_TYPE (exp)));
+ else
+ return op0;
+ }
op0 = gen_rtx_DEBUG_EXPR (mode);
DEBUG_EXPR_TREE_DECL (op0) = exp;
diff --git a/gcc/testsuite/gcc.dg/gomp/pr100508.c b/gcc/testsuite/gcc.dg/gomp/pr100508.c
new file mode 100644
index 00000000000..c3fa2fc258e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr100508.c
@@ -0,0 +1,14 @@
+/* PR middle-end/100508 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -fopenmp-simd" } */
+
+typedef int __attribute__((__vector_size__(32))) V;
+V j;
+
+#pragma omp declare simd
+int
+foo (void)
+{
+ V m = j;
+ return 0;
+}

View File

@ -1,11 +1,10 @@
%global source_date_epoch_from_changelog 1
%global DATE 20210514
%global gitrev a3253c88425835d5b339d6998a1110a66ccd8b44
%global gcc_version 8.5.0
%global gcc_major 8
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 26
%global gcc_release 21
%global nvptx_tools_gitrev c28050f60193b3b95a18866a96f03334e874e78f
%global nvptx_newlib_gitrev aadc8eb0ec43b7cd0dd2dfb484bae63c8b05ef24
%global _unpackaged_files_terminate_build 0
@ -105,7 +104,7 @@
Summary: Various compilers (C, C++, Objective-C, ...)
Name: gcc
Version: %{gcc_version}
Release: %{gcc_release}%{?dist}
Release: %{gcc_release}%{?dist}.alma.1
# libgcc, libgfortran, libgomp, libstdc++ and crtstuff have
# GCC Runtime Exception.
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
@ -307,19 +306,10 @@ Patch45: gcc8-pr99074.patch
Patch46: gcc8-pr87723.patch
Patch47: gcc8-pr111039.patch
Patch48: gcc8-pr111070.patch
Patch49: gcc8-RHEL-32886.patch
Patch50: gcc8-pr100508.patch
# Any patches changing libstdc++-v3/python and its tests should go after this.
Patch1000: gcc8-libstdc++-prettyprinter-update-14.patch
Patch1001: gcc8-libstdc++-prettyprinter-update-14-tests.patch
Patch1002: gcc8-libstdc++-prettyprinter-update-14-tests-48362.patch
Patch1003: gcc8-libstdc++-prettyprinter-update-14-tests-cxx11.patch
Patch1004: gcc8-libstdc++-prettyprinter-update-14-tests-cxx17.patch
Patch2000: nvptx-tools-no-ptxas.patch
Patch2001: nvptx-tools-build.patch
Patch2002: nvptx-tools-glibc.patch
Patch1000: nvptx-tools-no-ptxas.patch
Patch1001: nvptx-tools-build.patch
Patch1002: nvptx-tools-glibc.patch
# On ARM EABI systems, we do want -gnueabi to be part of the
@ -939,19 +929,11 @@ so that there cannot be any synchronization problems.
%patch46 -p1 -b .pr87723~
%patch47 -p1 -b .pr111039~
%patch48 -p1 -b .pr111070~
%patch49 -p0 -b .32886~
%patch50 -p1 -b .pr100508~
%patch1000 -p1 -b .libstdc++-prettyprinter-update-14~
%patch1001 -p1 -b .libstdc++-prettyprinter-update-14-tests~
%patch1002 -p1 -b .libstdc++-prettyprinter-update-14-tests-48362~
%patch1003 -p1 -b .libstdc++-prettyprinter-update-14-tests-cxx11~
%patch1004 -p1 -b .libstdc++-prettyprinter-update-14-tests-cxx17~
cd nvptx-tools-%{nvptx_tools_gitrev}
%patch2000 -p1 -b .nvptx-tools-no-ptxas~
%patch2001 -p1 -b .nvptx-tools-build~
%patch2002 -p1 -b .nvptx-tools-glibc~
%patch1000 -p1 -b .nvptx-tools-no-ptxas~
%patch1001 -p1 -b .nvptx-tools-build~
%patch1002 -p1 -b .nvptx-tools-glibc~
cd ..
echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE
@ -1039,7 +1021,7 @@ CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" \
--target nvptx-none --enable-as-accelerator-for=%{gcc_target_platform} \
--enable-languages=c,c++,fortran,lto \
--prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
--with-bugurl=http://bugzilla.redhat.com/bugzilla \
--with-bugurl=http://bugs.almalinux.org/ \
--enable-checking=release --with-system-zlib \
--with-gcc-major-version-only --without-isl
make %{?_smp_mflags}
@ -1065,7 +1047,7 @@ enablelgo=,go
%endif
CONFIGURE_OPTS="\
--prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
--with-bugurl=http://bugzilla.redhat.com/bugzilla \
--with-bugurl=http://bugs.almalinux.org/ \
--enable-shared --enable-threads=posix --enable-checking=release \
%ifarch ppc64le
--enable-targets=powerpcle-linux \
@ -1572,9 +1554,9 @@ mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++*gdb.py* \
%{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/
pushd ../libstdc++-v3/python
for i in `find . -name \*.py`; do
touch -d @$SOURCE_DATE_EPOCH %{buildroot}%{_prefix}/share/gcc-%{gcc_major}/python/$i
touch -r $i %{buildroot}%{_prefix}/share/gcc-%{gcc_major}/python/$i
done
touch -d @$SOURCE_DATE_EPOCH %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/libstdc++*gdb.py
touch -r hook.in %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/libstdc++*gdb.py
popd
for f in `find %{buildroot}%{_prefix}/share/gcc-%{gcc_major}/python/ \
%{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/ -name \*.py`; do
@ -2698,7 +2680,7 @@ fi
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/liblsan_preinit.o
%endif
%{_prefix}/libexec/getconf/default
%doc gcc/README* rpm.doc/changelogs/gcc/ChangeLog*
%doc gcc/README* rpm.doc/changelogs/gcc/ChangeLog*
%{!?_licensedir:%global license %%doc}
%license gcc/COPYING* COPYING.RUNTIME
@ -3354,20 +3336,8 @@ fi
%{ANNOBIN_GCC_PLUGIN_DIR}/gcc-annobin.so.0.0.0
%changelog
* Fri Mar 21 2025 Siddhesh Poyarekar <siddhesh@redhat.com> 8.5.0-26
- Pin modification time for python files to SOURCE_DATE_EPOCH (RHEL-50290).
* Fri Feb 28 2025 Siddhesh Poyarekar <siddhesh@redhat.com> 8.5.0-25
- Sync libstdc++ pretty printers to latest GTS (RHEL-50290).
* Mon Feb 24 2025 Marek Polacek <polacek@redhat.com> 8.5.0-24
- don't reuse DEBUG_EXPRs with vector type (PR middle-end/100508, RHEL-79501)
* Fri Feb 7 2025 Marek Polacek <polacek@redhat.com> 8.5.0-23
- rebuild for CVE-2020-11023 (RHEL-78274)
* Thu Apr 18 2024 Marek Polacek <polacek@redhat.com> 8.5.0-22
- fix ICE in the vectorizer (RHEL-32886)
* Wed Mar 27 2024 Eduard Abdullin <eabdullin@almalinux.org> - 8.5.0-21.alma.1
- AlmaLinux changes
* Wed Oct 4 2023 Marek Polacek <polacek@redhat.com> 8.5.0-21
- guard the bit test merging code in if-combine (RHEL-11483)
@ -3394,7 +3364,6 @@ fi
* Wed Jul 20 2022 Marek Polacek <polacek@redhat.com> 8.5.0-15
- backport straight-line-speculation mitigation (#2108721)
* Fri Jul 8 2022 Jonathan Wakely <jwakely@redhat.com> 8.5.0-14
- backport std::regex check for invalid range (#2001788)