public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gcc-patches:master commit in: 12.2.0/gentoo/
Date: Sun, 23 Apr 2023 02:41:46 +0000 (UTC)	[thread overview]
Message-ID: <1682159744.ffa606b25a8535e81f34e661ef0da04dee80d72b.sam@gentoo> (raw)

commit:     ffa606b25a8535e81f34e661ef0da04dee80d72b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 22 10:35:44 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Apr 22 10:35:44 2023 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=ffa606b2

12.2.0: add chromium ICE patch

Bug: https://bugs.gentoo.org/904455
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...573_12_ICE-in-vectorizable_live_operation.patch | 131 +++++++++++++++++++++
 12.2.0/gentoo/README.history                       |   3 +
 2 files changed, 134 insertions(+)

diff --git a/12.2.0/gentoo/76_all_all_PR109573_12_ICE-in-vectorizable_live_operation.patch b/12.2.0/gentoo/76_all_all_PR109573_12_ICE-in-vectorizable_live_operation.patch
new file mode 100644
index 0000000..bf3b48a
--- /dev/null
+++ b/12.2.0/gentoo/76_all_all_PR109573_12_ICE-in-vectorizable_live_operation.patch
@@ -0,0 +1,131 @@
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109573
+https://bugs.gentoo.org/904455
+
+From cddfe6bc40b3dc0806e260bbfb4cac82d609a258 Mon Sep 17 00:00:00 2001
+From: Richard Biener <rguenther@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.
+--- /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/12.2.0/gentoo/README.history b/12.2.0/gentoo/README.history
index 23576e0..521b11e 100644
--- a/12.2.0/gentoo/README.history
+++ b/12.2.0/gentoo/README.history
@@ -1,3 +1,6 @@
+15		22 Apr 2023
+	+ 76_all_all_PR109573_12_ICE-in-vectorizable_live_operation.patch
+
 14		13 Mar 2023
 	U 01_all_default-fortify-source.patch
 


             reply	other threads:[~2023-04-23  2:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-23  2:41 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-03-13 22:28 [gentoo-commits] proj/gcc-patches:master commit in: 12.2.0/gentoo/ Sam James
2023-02-12  2:39 Sam James
2023-02-06 18:36 Sam James
2023-02-06 17:40 Sam James
2023-01-29  8:50 Sam James
2023-01-23  0:35 Sam James
2023-01-08  4:46 Sam James
2022-12-28 19:35 Sam James
2022-12-26  8:06 Sam James
2022-12-17  4:54 Sam James
2022-12-09 11:24 Sam James
2022-12-05  0:27 Sam James
2022-12-05  0:18 Andreas K. Hüttel
2022-11-20  0:25 Sam James
2022-08-22  1:41 Sam James
2022-08-22  1:41 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1682159744.ffa606b25a8535e81f34e661ef0da04dee80d72b.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox