public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=znver3 since r13-4685-g4834e9360f7bf4
Date: Thu, 15 Dec 2022 10:47:33 +0000	[thread overview]
Message-ID: <bug-108110-4-1clfwjia0z@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108110-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108110

--- Comment #11 from Martin Liška <marxin at gcc dot gnu.org> ---
A bit more reduced test-case:

namespace std {
template <int __v> struct integral_constant {
  static constexpr int value = __v;
};
template <typename _Tp> using decay_t = _Tp;
template <bool, typename _Tp> using enable_if_t = _Tp;
template <typename _Tp> _Tp &&forward(_Tp &);
long max(long __b) {
  if (__b)
    return __b;
}
} // namespace std
enum layout_type { row_major };
struct svector {
  long operator[](long) const;
  long *m_begin;
};
auto svector::operator[](long idx) const -> long { return m_begin[idx]; }
template <class> struct xcontainer_inner_types;
template <class, layout_type, class, class = int> class xarray_container;
template <class, layout_type L = row_major, class A = int>
using xarray = xarray_container<A, L, long>;
struct xrange {
  xrange() noexcept;
  int m_size;
};
template <class, class, class> struct xrange_adaptor {
  xrange_adaptor(int, int, int) : m_start() {}
  std::enable_if_t<std::integral_constant<0>::value, xrange> get(long size) {
    if (m_start)
      std::max(size);
    if (m_stop)
      std::max(size);
    return xrange();
  }
  int m_start;
  int m_stop;
};
template <class A, class B> auto range(A, B stop_val) {
  return xrange_adaptor<A, B, int>(0, stop_val, int());
}
template <class> struct slice_implementation_getter {
  template <class E, class SL> auto operator()(E e, SL slice, long index) {
    return get_slice(e, slice, index, std::integral_constant<1>());
  }
  template <class E, class SL>
  auto get_slice(E, SL slice, long, std::integral_constant<true>) {
    return slice < std::decay_t<SL>() ?: slice;
  }
};
template <class A, class B, class C>
struct slice_implementation_getter<xrange_adaptor<A, B, C>> {
  template <class E, class SL> auto operator()(E e, SL adaptor, long index) {
    const svector __trans_tmp_6 = e.shape();
    long __trans_tmp_2 = __trans_tmp_6[index];
    return adaptor.get(__trans_tmp_2);
  }
};
long get_slice_implementation_index;
template <class E, class SL> auto get_slice_implementation(E e, SL &&slice) {
  slice_implementation_getter<std::decay_t<SL>> getter;
  return getter(e, slice, get_slice_implementation_index);
}
xrange::xrange() noexcept {}
template <class D> struct xcontainer {
  using derived_type = D;
  using inner_shape_type = typename
xcontainer_inner_types<D>::inner_shape_type;
  constexpr const inner_shape_type &shape() const noexcept;
  const derived_type &derived_cast() const &noexcept;
};
template <class D> struct xstrided_container : xcontainer<D> {
  using typename xcontainer<D>::inner_shape_type;
  const inner_shape_type &shape_impl() const noexcept;
  inner_shape_type m_shape;
};
template <class D>
constexpr auto xcontainer<D>::shape() const noexcept
    -> const inner_shape_type & {
  return derived_cast().shape_impl();
}
template <class D>
auto xcontainer<D>::derived_cast() const &noexcept -> const derived_type & {
  return *static_cast<const derived_type *>(this);
}
template <class D>
auto xstrided_container<D>::shape_impl() const noexcept
    -> const inner_shape_type & {
  return m_shape;
}
template <class EC, layout_type L, class SC, class Tag>
struct xcontainer_inner_types<xarray_container<EC, L, SC, Tag>> {
  using inner_shape_type = SC;
};
template <class, layout_type L, class, class>
struct xarray_container
    : xstrided_container<xarray_container<double, L, svector>> {};
struct xview {
  template <class CTA, class FSL> xview(CTA, FSL);
};
template <class E, class... S> void make_view_impl(E e, S &&...slices) {
  xview(get_slice_implementation(e, std::forward(slices))...);
}
template <class E, class... S> void view(E e, S... slices) {
  make_view_impl(e, slices...);
}
void TestBody() {
  xarray<double> a, arr;
  xrange_adaptor __trans_tmp_3 = range(1, 4), __trans_tmp_4 = range(1, 3);
  view(a, 1, __trans_tmp_3);
  view(arr, 1, __trans_tmp_4);
}

  parent reply	other threads:[~2022-12-15 10:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14 19:03 [Bug c++/108110] New: ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native dcb314 at hotmail dot com
2022-12-14 19:10 ` [Bug ipa/108110] " dcb314 at hotmail dot com
2022-12-14 19:11 ` [Bug ipa/108110] [13 Regression] " pinskia at gcc dot gnu.org
2022-12-14 19:13 ` pinskia at gcc dot gnu.org
2022-12-14 22:54 ` dcb314 at hotmail dot com
2022-12-15  5:25 ` dcb314 at hotmail dot com
2022-12-15  5:51 ` dcb314 at hotmail dot com
2022-12-15  7:18 ` dcb314 at hotmail dot com
2022-12-15  7:47 ` dcb314 at hotmail dot com
2022-12-15  8:24 ` rguenth at gcc dot gnu.org
2022-12-15  8:36 ` dcb314 at hotmail dot com
2022-12-15  8:55 ` dcb314 at hotmail dot com
2022-12-15  9:14 ` dcb314 at hotmail dot com
2022-12-15 10:44 ` [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=znver3 since r13-4685-g4834e9360f7bf4 marxin at gcc dot gnu.org
2022-12-15 10:47 ` marxin at gcc dot gnu.org [this message]
2022-12-18 19:03 ` manuel.lauss at googlemail dot com
2023-01-02 12:08 ` jakub at gcc dot gnu.org
2023-01-02 12:50 ` slyfox at gcc dot gnu.org
2023-01-04 13:41 ` jamborm at gcc dot gnu.org
2023-01-05 16:47 ` jamborm at gcc dot gnu.org
2023-01-06  8:13 ` slyfox at gcc dot gnu.org
2023-01-10 13:20 ` cvs-commit at gcc dot gnu.org
2023-01-10 13:21 ` jamborm at gcc dot gnu.org

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=bug-108110-4-1clfwjia0z@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).