commit:     28d2380b495e99daca3b01ca9e6a73a623a2f3d2
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 26 20:38:52 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Apr 26 20:38:52 2023 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=28d2380b

13.2.0: drop upstream patches

We only put them in here to include in 13.1.0-r1. They're already on 
releases/gcc-13.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...573_13_ICE-in-vectorizable_live_operation.patch | 134 ---------------------
 ...l_all_PR109585_13_rtl-alias-analysis-typo.patch |  68 -----------
 .../77_all_all_PR109609_13_tail-call-fnspec.patch  | 105 ----------------
 3 files changed, 307 deletions(-)

diff --git 
a/13.2.0/gentoo/75_all_all_PR109573_13_ICE-in-vectorizable_live_operation.patch 
b/13.2.0/gentoo/75_all_all_PR109573_13_ICE-in-vectorizable_live_operation.patch
deleted file mode 100644
index 31abade..0000000
--- 
a/13.2.0/gentoo/75_all_all_PR109573_13_ICE-in-vectorizable_live_operation.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=263d1ed0484fc81d3f93e39cdd2f9eb0ce4d3e88
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109573
-https://bugs.gentoo.org/904455
-
-kFrom 263d1ed0484fc81d3f93e39cdd2f9eb0ce4d3e88 Mon Sep 17 00:00:00 2001
-From: Richard Biener <rguent...@suse.de>
-Date: Fri, 21 Apr 2023 12:57:17 +0200
-Subject: [PATCH] tree-optimization/109573 - avoid ICEing on unexpected live
- def
-
-The following relaxes the assert in vectorizable_live_operation
-where we catch currently unhandled cases to also allow an
-intermediate copy as it happens here but also relax the assert
-to checking only.
-
-       PR tree-optimization/109573
-       * tree-vect-loop.cc (vectorizable_live_operation): Allow
-       unhandled SSA copy as well.  Demote assert to checking only.
-
-       * g++.dg/vect/pr109573.cc: New testcase.
-
-(cherry picked from commit cddfe6bc40b3dc0806e260bbfb4cac82d609a258)
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/vect/pr109573.cc
-@@ -0,0 +1,91 @@
-+// { dg-do compile }
-+// { dg-require-effective-target c++20 }
-+
-+void *operator new(__SIZE_TYPE__, void *__p) { return __p; }
-+template <typename _Head> struct _Head_base {
-+  _Head _M_head_impl;
-+};
-+template <unsigned long, typename...> struct _Tuple_impl;
-+template <unsigned long _Idx, typename _Head, typename... _Tail>
-+struct _Tuple_impl<_Idx, _Head, _Tail...> : _Tuple_impl<_Idx + 1, _Tail...>,
-+                                            _Head_base<_Head> {
-+  template <typename _UHead, typename... _UTail>
-+  _Tuple_impl(_UHead __head, _UTail... __tail)
-+      : _Tuple_impl<_Idx + 1, _Tail...>(__tail...), _Head_base<_Head>(__head) 
{}
-+};
-+template <unsigned long _Idx, typename _Head> struct _Tuple_impl<_Idx, _Head> 
{
-+  template <typename _UHead> _Tuple_impl(_UHead);
-+};
-+template <typename... _Elements> struct tuple : _Tuple_impl<0, _Elements...> {
-+  template <typename... _UElements>
-+  tuple(_UElements... __elements)
-+      : _Tuple_impl<0, _Elements...>(__elements...) {}
-+};
-+unsigned long position_;
-+struct Zone {
-+  template <typename T, typename... Args> T *New(Args... args) {
-+    return new (reinterpret_cast<void *>(position_)) T(args...);
-+  }
-+};
-+struct Label {
-+  int pos_;
-+  int near_link_pos_;
-+};
-+enum Condition { below_equal };
-+void bind(Label *);
-+Zone *zone();
-+unsigned long deopt_info_address();
-+int MakeDeferredCode___trans_tmp_2, MakeDeferredCode___trans_tmp_3,
-+    Prologue___trans_tmp_6, MakeDeferredCode___trans_tmp_1;
-+struct MaglevAssembler {
-+  template <typename Function, typename... Args>
-+  void MakeDeferredCode(Function &&, Args &&...);
-+  template <typename Function, typename... Args>
-+  void JumpToDeferredIf(Condition, Function, Args... args) {
-+    MakeDeferredCode(Function(), args...);
-+  }
-+  void Prologue();
-+};
-+struct ZoneLabelRef {
-+  ZoneLabelRef(Zone *zone) : label_(zone->New<Label>()) {}
-+  ZoneLabelRef(MaglevAssembler *) : ZoneLabelRef(zone()) {}
-+  Label *operator*() { return label_; }
-+  Label *label_;
-+};
-+template <typename Function>
-+struct FunctionArgumentsTupleHelper
-+    : FunctionArgumentsTupleHelper<decltype(&Function::operator())> {};
-+template <typename C, typename R, typename... A>
-+struct FunctionArgumentsTupleHelper<R (C::*)(A...) const> {
-+  using Tuple = tuple<A...>;
-+};
-+template <typename> struct StripFirstTupleArg;
-+template <typename T1, typename... T>
-+struct StripFirstTupleArg<tuple<T1, T...>> {
-+  using Stripped = tuple<T...>;
-+};
-+template <typename Function> struct DeferredCodeInfoImpl {
-+  template <typename... InArgs>
-+  DeferredCodeInfoImpl(int *, int, int, Function, InArgs... args)
-+      : args(args...) {}
-+  StripFirstTupleArg<
-+      typename FunctionArgumentsTupleHelper<Function>::Tuple>::Stripped args;
-+};
-+template <typename Function, typename... Args>
-+void MaglevAssembler::MakeDeferredCode(Function &&deferred_code_gen,
-+                                       Args &&...args) {
-+  zone()->New<DeferredCodeInfoImpl<Function>>(
-+      &MakeDeferredCode___trans_tmp_1, MakeDeferredCode___trans_tmp_2,
-+      MakeDeferredCode___trans_tmp_3, deferred_code_gen, args...);
-+}
-+void MaglevAssembler::Prologue() {
-+  int *__trans_tmp_9;
-+  ZoneLabelRef deferred_call_stack_guard_return(this);
-+  __trans_tmp_9 = reinterpret_cast<int *>(deopt_info_address());
-+  JumpToDeferredIf(
-+      below_equal, [](MaglevAssembler, int *, ZoneLabelRef, int, int) {},
-+      __trans_tmp_9, deferred_call_stack_guard_return, Prologue___trans_tmp_6,
-+      0);
-+  Label __trans_tmp_7 = **deferred_call_stack_guard_return;
-+  bind(&__trans_tmp_7);
-+}
---- a/gcc/tree-vect-loop.cc
-+++ b/gcc/tree-vect-loop.cc
-@@ -10114,9 +10114,10 @@ vectorizable_live_operation (vec_info *vinfo,
-                                               use_stmt))
-             {
-               enum tree_code code = gimple_assign_rhs_code (use_stmt);
--              gcc_assert (code == CONSTRUCTOR
--                          || code == VIEW_CONVERT_EXPR
--                          || CONVERT_EXPR_CODE_P (code));
-+              gcc_checking_assert (code == SSA_NAME
-+                                   || code == CONSTRUCTOR
-+                                   || code == VIEW_CONVERT_EXPR
-+                                   || CONVERT_EXPR_CODE_P (code));
-               if (dump_enabled_p ())
-                 dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
-                                  "Using original scalar computation for "
--- 
-2.31.1

diff --git a/13.2.0/gentoo/76_all_all_PR109585_13_rtl-alias-analysis-typo.patch 
b/13.2.0/gentoo/76_all_all_PR109585_13_rtl-alias-analysis-typo.patch
deleted file mode 100644
index b40e3af..0000000
--- a/13.2.0/gentoo/76_all_all_PR109585_13_rtl-alias-analysis-typo.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585
-https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=bb406a6aea336966681927a27f54ee89c4fd4ea1
-
-From bb406a6aea336966681927a27f54ee89c4fd4ea1 Mon Sep 17 00:00:00 2001
-From: Richard Biener <rguent...@suse.de>
-Date: Mon, 24 Apr 2023 13:31:07 +0200
-Subject: [PATCH] rtl-optimization/109585 - alias analysis typo
-
-When r10-514-gc6b84edb6110dd2b4fb improved access path analysis
-it introduced a typo that triggers when there's an access to a
-trailing array in the first access path leading to false
-disambiguation.
-
-       PR rtl-optimization/109585
-       * tree-ssa-alias.cc (aliasing_component_refs_p): Fix typo.
-
-       * gcc.dg/torture/pr109585.c: New testcase.
-
-(cherry picked from commit 6d4bd27a60447c7505cb4783e675e98a191a8904)
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/torture/pr109585.c
-@@ -0,0 +1,33 @@
-+/* { dg-do run } */
-+
-+#include <stdlib.h>
-+
-+struct P {
-+    long v;
-+    struct P *n;
-+};
-+
-+struct F {
-+    long x;
-+    struct P fam[];
-+};
-+
-+int __attribute__((noipa))
-+f(struct F *f, int i)
-+{
-+  struct P *p = f->fam;
-+  asm("" : "+r"(f): "r"(p));
-+  p->v = 0;
-+  p->n = 0;
-+  return f->fam->n != 0;
-+}
-+
-+int
-+main()
-+{
-+  struct F *m = malloc (sizeof (long) + 2 * sizeof (struct P));
-+  m->fam[0].n = &m->fam[1];
-+  if (f (m, 0))
-+    abort ();
-+  return 0;
-+}
---- a/gcc/tree-ssa-alias.cc
-+++ b/gcc/tree-ssa-alias.cc
-@@ -1330,7 +1330,7 @@ aliasing_component_refs_p (tree ref1,
-   /* If we didn't find a common base, try the other way around.  */
-   if (cmp_outer <= 0 
-       || (end_struct_ref1
--        && compare_type_sizes (TREE_TYPE (end_struct_ref1), type1) <= 0))
-+        && compare_type_sizes (TREE_TYPE (end_struct_ref1), type2) <= 0))
-     {
-       int res = aliasing_component_refs_walk (ref2, type2, base2,
-                                             offset2, max_size2,
--- 
-2.31.1

diff --git a/13.2.0/gentoo/77_all_all_PR109609_13_tail-call-fnspec.patch 
b/13.2.0/gentoo/77_all_all_PR109609_13_tail-call-fnspec.patch
deleted file mode 100644
index 9871b81..0000000
--- a/13.2.0/gentoo/77_all_all_PR109609_13_tail-call-fnspec.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=df49e4602882eabe0642699fb71a70f6e120e263
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109609
-
-From df49e4602882eabe0642699fb71a70f6e120e263 Mon Sep 17 00:00:00 2001
-From: Richard Biener <rguent...@suse.de>
-Date: Tue, 25 Apr 2023 14:56:44 +0200
-Subject: [PATCH] tree-optimization/109609 - correctly interpret arg size in
- fnspec
-
-By majority vote and a hint from the API name which is
-arg_max_access_size_given_by_arg_p this interprets a memory access
-size specified as given as other argument such as for strncpy
-in the testcase which has "1cO313" as specifying the _maximum_
-size read/written rather than the exact size.  There are two
-uses interpreting it that way already and one differing.  The
-following adjusts the differing and clarifies the documentation.
-
-       PR tree-optimization/109609
-       * attr-fnspec.h (arg_max_access_size_given_by_arg_p):
-       Clarify semantics.
-       * tree-ssa-alias.cc (check_fnspec): Correctly interpret
-       the size given by arg_max_access_size_given_by_arg_p as
-       maximum, not exact, size.
-
-       * gcc.dg/torture/pr109609.c: New testcase.
-
-(cherry picked from commit e8d00353017f895d03a9eabae3506fd126ce1a2d)
---- a/gcc/attr-fnspec.h
-+++ b/gcc/attr-fnspec.h
-@@ -54,7 +54,7 @@
-      ' '        nothing is known
-      't'      the size of value written/read corresponds to the size of
-               of the pointed-to type of the argument type
--     '1'...'9'  specifies the size of value written/read is given by the
-+     '1'...'9'  specifies the size of value written/read is bound by the
-               specified argument
-  */
- 
-@@ -169,7 +169,7 @@ public:
-          && str[idx] != 'x' && str[idx] != 'X';
-   }
- 
--  /* Return true if load of memory pointed to by argument I is specified
-+  /* Return true if load of memory pointed to by argument I is bound
-      by another argument.  In this case set ARG.  */
-   bool
-   arg_max_access_size_given_by_arg_p (unsigned int i, unsigned int *arg)
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/torture/pr109609.c
-@@ -0,0 +1,26 @@
-+/* { dg-do run } */
-+
-+#define N 23
-+#define MAX_LEN 13
-+char dst[N + 1];
-+
-+void __attribute__((noipa))
-+invert(const char *id)
-+{
-+  char buf[MAX_LEN];
-+  char *ptr = buf + sizeof(buf);  // start from the end of buf
-+  *(--ptr) = '\0';                // terminate string
-+  while (*id && ptr > buf) {
-+    *(--ptr) = *(id++);           // copy id backwards
-+  }
-+  __builtin_strncpy(dst, ptr, N);           // copy ptr/buf to dst
-+}
-+
-+
-+int main()
-+{
-+  invert("abcde");
-+  if (__builtin_strcmp(dst, "edcba"))
-+    __builtin_abort();
-+  return 0;
-+}
---- a/gcc/tree-ssa-alias.cc
-+++ b/gcc/tree-ssa-alias.cc
-@@ -2726,9 +2726,21 @@ check_fnspec (gcall *call, ao_ref *ref, bool clobber)
-                     t = TREE_CHAIN (t);
-                   size = TYPE_SIZE_UNIT (TREE_TYPE (TREE_VALUE (t)));
-                 }
--              ao_ref_init_from_ptr_and_size (&dref,
--                                             gimple_call_arg (call, i),
--                                             size);
-+              poly_int64 size_hwi;
-+              if (size
-+                  && poly_int_tree_p (size, &size_hwi)
-+                  && coeffs_in_range_p (size_hwi, 0,
-+                                        HOST_WIDE_INT_MAX / BITS_PER_UNIT))
-+                {
-+                  size_hwi = size_hwi * BITS_PER_UNIT;
-+                  ao_ref_init_from_ptr_and_range (&dref,
-+                                                  gimple_call_arg (call, i),
-+                                                  true, 0, -1, size_hwi);
-+                }
-+              else
-+                ao_ref_init_from_ptr_and_range (&dref,
-+                                                gimple_call_arg (call, i),
-+                                                false, 0, -1, -1);
-               if (refs_may_alias_p_1 (&dref, ref, false))
-                 return 1;
-             }
--- 
-2.31.1

Reply via email to