public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108110] New: ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
@ 2022-12-14 19:03 dcb314 at hotmail dot com
  2022-12-14 19:10 ` [Bug ipa/108110] " dcb314 at hotmail dot com
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: dcb314 at hotmail dot com @ 2022-12-14 19:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108110
           Summary: ice in modify_call, at ipa-param-manipulation.cc:700
                    with -std=c++14 -O3 -march=native
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 54093
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54093&action=edit
gzipped C++ source code

The attached C++ source code does this:

during IPA pass: inline
In file included from
/home/dcb36/rpmbuild/BUILD/xtensor-0.23.1/test/test_xview.
cpp:33:
In function ‘auto xt::view(E&&, S&& ...) [with E =
xarray_container<uvector<doub
le, std::allocator<double> >, xt::layout_type::row_major, svector<long unsigned 
int, 4, std::allocator<long unsigned int>, true>, xtensor_expression_tag>&; S = 
{int, xrange_adaptor<long int, long int, placeholders::xtuph>}]’,
    inlined from ‘virtual void xt::xview_access_Test::TestBody()’ at
/home/dcb36
/rpmbuild/BUILD/xtensor-0.23.1/test/test_xview.cpp:335:51:
/home/dcb36/rpmbuild/BUILD/xtensor-0.23.1/include/xtensor/xview.hpp:1670:127:
in
ternal compiler error: in modify_call, at ipa-param-manipulation.cc:700
 1670 |         return detail::make_view_impl(std::forward<E>(e),
std::make_inde
x_sequence<sizeof...(S)>(), std::forward<S>(slices)...);
      |                                                                         
                                                      ^
0xe33c71 ipa_param_adjustments::modify_call(cgraph_edge*, bool)
        ../../trunk.d1/gcc/ipa-param-manipulation.cc:700

I have a reduction running. Problem seems to be recent (today or yesterday).
Command line is

$ ~/gcc/results.20221214.asan.ubsan/bin/g++ -c -march=native -std=c++14 -O3
bug867.cc

$ ~/gcc/results.20221213.asan.ubsan/bin/g++ -v 2>&1 | fgrep exp
gcc version 13.0.0 20221213 (experimental) (0a43f7b1a73c8e3b) 
$ ~/gcc/results.20221214.asan.ubsan/bin/g++ -v 2>&1 | fgrep exp
gcc version 13.0.0 20221214 (experimental) (330b9a8d87dd73e1) 
$ 

Native is zen2 or maybe zen3.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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 ` dcb314 at hotmail dot com
  2022-12-14 19:11 ` [Bug ipa/108110] [13 Regression] " pinskia at gcc dot gnu.org
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dcb314 at hotmail dot com @ 2022-12-14 19:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
CPU is AMD Ryzen 7 5700G, so -march flag is zen3.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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 ` pinskia at gcc dot gnu.org
  2022-12-14 19:13 ` pinskia at gcc dot gnu.org
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-14 19:11 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
            Summary|ice in modify_call, at      |[13 Regression] ice in
                   |ipa-param-manipulation.cc:7 |modify_call, at
                   |00 with -std=c++14 -O3      |ipa-param-manipulation.cc:7
                   |-march=native               |00 with -std=c++14 -O3
                   |                            |-march=native
           Keywords|                            |ice-on-valid-code

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-14 19:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Most likely one of the following revisions ranges caused the issue:
r13-4705 - r13-4706
r13-4684 - r13-4691

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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
                   ` (2 preceding siblings ...)
  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
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dcb314 at hotmail dot com @ 2022-12-14 22:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
Reduced C++ code seems to be:

namespace std {
template <int __v> struct integral_constant {
  static constexpr int value = __v;
};
using true_type = integral_constant<true>;
using false_type = integral_constant<false>;
template <int> struct __conditional {
  template <typename _Tp, typename> using type = _Tp;
};
template <bool _Cond, typename _If, typename _Else>
using __conditional_t = typename __conditional<_Cond>::type<_If, _Else>;
template <typename _Tp> struct remove_cv { using type = _Tp; };
template <typename _Tp> struct remove_reference { using type = _Tp; };
template <typename _Up>
struct __decay_selector
    : __conditional_t<false_type ::value, remove_cv<_Up>, _Up> {};
template <typename _Tp> struct decay {
  using type = typename __decay_selector<_Tp>::type;
};
template <typename _Tp> using decay_t = typename decay<_Tp>::type;
template <bool, typename _Tp> using enable_if_t = _Tp;
template <typename _Tp> _Tp &&forward(typename remove_reference<_Tp>::type &);
long max(long __b) {
  if (__b)
    return __b;
}
} // namespace std
enum layout_type { row_major };
template <class> struct svector {
  using size_type = long;
  using value_type = long;
  using const_reference = value_type;
  const_reference operator[](size_type) const;
  long *m_begin;
};
template <class T>
auto svector<T>::operator[](size_type idx) const -> const_reference {
  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>;
template <class> struct xrange {
  using size_type = int;
  xrange(size_type, size_type) noexcept;
  size_type 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<long>>
  get(long size) {
    long __trans_tmp_8, __trans_tmp_7;
    if (m_start)
      std::max(size);
    if (m_stop)
      std::max(size);
    return xrange<long>(__trans_tmp_7, __trans_tmp_8);
  }
  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::true_type) {
    using int_type = std::decay_t<SL>;
    return slice < int_type() ?: 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<long> __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);
}
template <class T> xrange<T>::xrange(size_type, size_type) noexcept {}
template <class D> struct xcontainer {
  using derived_type = D;
  using inner_types = xcontainer_inner_types<D>;
  using inner_shape_type = typename inner_types::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 base_type = xcontainer<D>;
  using typename base_type::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 shape_type = SC;
  using inner_shape_type = shape_type;
};
template <class, layout_type L, class, class>
struct xarray_container
    : xstrided_container<xarray_container<double, L, svector<long>>> {};
struct xview {
  template <class CTA, class FSL> xview(CTA, FSL);
};
template <class E, class... S> void make_view_impl(E e, S &&...slices) {
  using view_type = xview;
  view_type(get_slice_implementation(e, std::forward<S>(slices))...);
}
template <class E, class... S> void view(E e, S... slices) {
  make_view_impl(e, std::forward<S>(slices)...);
}
void TestBody() {
  xarray<double> a, arr;
  xrange_adaptor<int, int, int> __trans_tmp_3 = range(1, 4),
                                __trans_tmp_4 = range(1, 3);
  view(a, 1, __trans_tmp_3);
  view(arr, 1, __trans_tmp_4);
}

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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
                   ` (3 preceding siblings ...)
  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
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dcb314 at hotmail dot com @ 2022-12-15  5:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from David Binderman <dcb314 at hotmail dot com> ---
Git bisect now running. Trying 15f04af347e3b65f.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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
                   ` (4 preceding siblings ...)
  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
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dcb314 at hotmail dot com @ 2022-12-15  5:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from David Binderman <dcb314 at hotmail dot com> ---
That revision seems good. Trying 7450b25566b7a738.

For the reduced code, -march=zen3 not required.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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
                   ` (5 preceding siblings ...)
  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
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dcb314 at hotmail dot com @ 2022-12-15  7:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to David Binderman from comment #5)
> That revision seems good. Trying 7450b25566b7a738.

Seems good. Trying 512098a3316f07d4.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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
                   ` (6 preceding siblings ...)
  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
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dcb314 at hotmail dot com @ 2022-12-15  7:47 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjambor at suse dot cz

--- Comment #7 from David Binderman <dcb314 at hotmail dot com> ---
That one seems bad. Trying 803a91330bf20174. Range seems
to be [7450b25566b7a738..512098a3316f07d4], so some 9 commits.

7 of them are by Martin Jambor <mjambor@suse.cz>, one is a daily bump
and one is unrelated.

Over to Martin.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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
                   ` (7 preceding siblings ...)
  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
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-15  8:24 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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
                   ` (8 preceding siblings ...)
  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
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dcb314 at hotmail dot com @ 2022-12-15  8:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from David Binderman <dcb314 at hotmail dot com> ---
803a91330bf20174 seems bad, so trying 095a13eda2caf684.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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
                   ` (9 preceding siblings ...)
  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
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dcb314 at hotmail dot com @ 2022-12-15  8:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to David Binderman from comment #8)
> 803a91330bf20174 seems bad, so trying 095a13eda2caf684.

That seems bad, so trying 4834e9360f7bf42f.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug ipa/108110] [13 Regression] ice in modify_call, at ipa-param-manipulation.cc:700 with -std=c++14 -O3 -march=native
  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
                   ` (10 preceding siblings ...)
  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
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dcb314 at hotmail dot com @ 2022-12-15  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from David Binderman <dcb314 at hotmail dot com> ---
That's the bad revision.

  ipa: Better way of applying both IPA-CP and IPA-SRA (PR 103227)

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [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
  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
                   ` (11 preceding siblings ...)
  2022-12-15  9:14 ` dcb314 at hotmail dot com
@ 2022-12-15 10:44 ` marxin at gcc dot gnu.org
  2022-12-15 10:47 ` marxin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-15 10:44 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-12-15
             Status|UNCONFIRMED                 |ASSIGNED
            Summary|[13 Regression] ice in      |[13 Regression] ice in
                   |modify_call, at             |modify_call, at
                   |ipa-param-manipulation.cc:7 |ipa-param-manipulation.cc:7
                   |00 with -std=c++14 -O3      |00 with -std=c++14 -O3
                   |-march=native               |-march=znver3 since
                   |                            |r13-4685-g4834e9360f7bf4
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |jamborm at gcc dot gnu.org

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [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
  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
                   ` (12 preceding siblings ...)
  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
  2022-12-18 19:03 ` manuel.lauss at googlemail dot com
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-15 10:47 UTC (permalink / raw)
  To: gcc-bugs

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);
}

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [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
  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
                   ` (13 preceding siblings ...)
  2022-12-15 10:47 ` marxin at gcc dot gnu.org
@ 2022-12-18 19:03 ` manuel.lauss at googlemail dot com
  2023-01-02 12:08 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: manuel.lauss at googlemail dot com @ 2022-12-18 19:03 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel Lauss <manuel.lauss at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manuel.lauss at googlemail dot com

--- Comment #12 from Manuel Lauss <manuel.lauss at googlemail dot com> ---
Created attachment 54122
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54122&action=edit
unreduced test case

I've attached another testcase:

-O2 and -march with AVX support are essential to trigger it:

moya ~ # g++ -c ipa-param-manipulation.i -O1 -march=core-avx-i
moya ~ # g++ -c ipa-param-manipulation.i -O3 -march=core-avx-i
moya ~ # g++ -c ipa-param-manipulation.i -O2 -march=core-avx-i
during IPA pass: inline
In file included from
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/tuple:41,
                 from
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:36,
                 from
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/memory:78,
                 from src/mongo/util/background.h:32,
                 from src/mongo/util/background.cpp:34:
In function 'constexpr _Res std::__invoke_impl(__invoke_other, _Fn&&, _Args&&
...) [with _Res = void; _Fn =
mongo::logv2::detail::doLog<mongo::{anonymous}::PeriodicTaskRunner::_runTask(mongo::PeriodicTask*)::<lambda()>::FMT_COMPILE_STRING,
14, NamedArg<const std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >&>, NamedArg<mongo::Duration<std::ratio<1, 1000> > >
>(int32_t, const mongo::logv2::LogSeverity&, const mongo::logv2::LogOptions&,
const
mongo::{anonymous}::PeriodicTaskRunner::_runTask(mongo::PeriodicTask*)::<lambda()>::FMT_COMPILE_STRING&,
const char (&)[14], const NamedArg<const std::__cxx11::basic_string<char>&>&,
const NamedArg<mongo::Duration<std::ratio<1, 1000> > >&)::<lambda(auto:20&&
...)>; _Args = {const mongo::logv2::detail::NamedArg<const
__cxx11::basic_string<char, char_traits<char>, allocator<char> >&>&, const
mongo::logv2::detail::NamedArg<mongo::Duration<ratio<1, 1000> > >&}]',
    inlined from 'constexpr typename std::__invoke_result<_Functor,
_ArgTypes>::type std::__invoke(_Callable&&, _Args&& ...) [with _Callable =
mongo::logv2::detail::doLog<mongo::{anonymous}::PeriodicTaskRunner::_runTask(mongo::PeriodicTask*)::<lambda()>::FMT_COMPILE_STRING,
14, NamedArg<const std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >&>, NamedArg<mongo::Duration<std::ratio<1, 1000> > >
>(int32_t, const mongo::logv2::LogSeverity&, const mongo::logv2::LogOptions&,
const
mongo::{anonymous}::PeriodicTaskRunner::_runTask(mongo::PeriodicTask*)::<lambda()>::FMT_COMPILE_STRING&,
const char (&)[14], const NamedArg<const std::__cxx11::basic_string<char>&>&,
const NamedArg<mongo::Duration<std::ratio<1, 1000> > >&)::<lambda(auto:20&&
...)>; _Args = {const mongo::logv2::detail::NamedArg<const
__cxx11::basic_string<char, char_traits<char>, allocator<char> >&>&, const
mongo::logv2::detail::NamedArg<mongo::Duration<ratio<1, 1000> > >&}]' at
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/invoke.h:96:40,
    inlined from 'constexpr decltype(auto) std::__apply_impl(_Fn&&, _Tuple&&,
index_sequence<_Idx ...>) [with _Fn =
mongo::logv2::detail::doLog<mongo::{anonymous}::PeriodicTaskRunner::_runTask(mongo::PeriodicTask*)::<lambda()>::FMT_COMPILE_STRING,
14, NamedArg<const std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >&>, NamedArg<mongo::Duration<std::ratio<1, 1000> > >
>(int32_t, const mongo::logv2::LogSeverity&, const mongo::logv2::LogOptions&,
const
mongo::{anonymous}::PeriodicTaskRunner::_runTask(mongo::PeriodicTask*)::<lambda()>::FMT_COMPILE_STRING&,
const char (&)[14], const NamedArg<const std::__cxx11::basic_string<char>&>&,
const NamedArg<mongo::Duration<std::ratio<1, 1000> > >&)::<lambda(auto:20&&
...)>; _Tuple = tuple<const mongo::logv2::detail::NamedArg<const
__cxx11::basic_string<char, char_traits<char>, allocator<char> >&>&, const
mongo::logv2::detail::NamedArg<mongo::Duration<ratio<1, 1000> > >&>; long
unsigned int ..._Idx = {0, 1}]' at
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/tuple:2287:27,
    inlined from 'constexpr decltype(auto) std::apply(_Fn&&, _Tuple&&) [with
_Fn =
mongo::logv2::detail::doLog<mongo::{anonymous}::PeriodicTaskRunner::_runTask(mongo::PeriodicTask*)::<lambda()>::FMT_COMPILE_STRING,
14, NamedArg<const std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >&>, NamedArg<mongo::Duration<std::ratio<1, 1000> > >
>(int32_t, const mongo::logv2::LogSeverity&, const mongo::logv2::LogOptions&,
const
mongo::{anonymous}::PeriodicTaskRunner::_runTask(mongo::PeriodicTask*)::<lambda()>::FMT_COMPILE_STRING&,
const char (&)[14], const NamedArg<const std::__cxx11::basic_string<char>&>&,
const NamedArg<mongo::Duration<std::ratio<1, 1000> > >&)::<lambda(auto:20&&
...)>; _Tuple = tuple<const mongo::logv2::detail::NamedArg<const
__cxx11::basic_string<char, char_traits<char>, allocator<char> >&>&, const
mongo::logv2::detail::NamedArg<mongo::Duration<ratio<1, 1000> > >&>]' at
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/tuple:2298:31,
    inlined from 'void mongo::logv2::detail::doLog(int32_t, const
mongo::logv2::LogSeverity&, const mongo::logv2::LogOptions&, const S&, const
char (&)[N], const Args& ...) [with S =
mongo::{anonymous}::PeriodicTaskRunner::_runTask(mongo::PeriodicTask*)::<lambda()>::FMT_COMPILE_STRING;
long unsigned int N = 14; Args = {NamedArg<const
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
>&>, NamedArg<mongo::Duration<std::ratio<1, 1000> > >}]' at
src/mongo/logv2/log_detail.h:121:15,
    inlined from 'void
mongo::{anonymous}::PeriodicTaskRunner::_runTask(mongo::PeriodicTask*)' at
src/mongo/util/background.cpp:358:440:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/invoke.h:61:36:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
   61 |     { return std::forward<_Fn>(__f)(std::forward<_Args>(__args)...); }
      |              ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x1ced1ad internal_error(char const*, ...)
        ???:0
0x6be47f fancy_abort(char const*, int, char const*)
        ???:0
0x9bfc8e cgraph_edge::redirect_call_stmt_to_callee(cgraph_edge*)
        ???:0
0xe54a9b redirect_all_calls(copy_body_data*, basic_block_def*)
        ???:0
0xe601bb optimize_inline_calls(tree_node*)
        ???:0
0xbbd42b inline_transform(cgraph_node*)
        ???:0
0xd125df execute_all_ipa_transforms(bool)
        ???:0
0x9c640f cgraph_node::expand()
        ???:0
0x9c9f77 symbol_table::finalize_compilation_unit()
        ???:0

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [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
  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
                   ` (14 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-02 12:08 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
In Fedora test mass rebuild this seems to be the most common ICE:
./UNCONFIRMED/fedora-rawhide-ppc64le/llvm8.0/05172811-llvm8.0/build.log.gz
/usr/include/c++/13/bits/stl_algo.h:4103:29: internal compiler error: in
modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-ppc64le/chatterino2/05168380-chatterino2/build.log.gz
/usr/include/c++/13/bits/stl_iterator_base_funcs.h:106:21: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-ppc64le/pdns-recursor/05174194-pdns-recursor/build.log.gz
/usr/include/boost/circular_buffer/base.hpp:2824:46: internal compiler error:
in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-ppc64le/krita/05171764-krita/build.log.gz
/usr/include/boost/range/iterator_range_core.hpp:408:28: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-ppc64le/root/05185147-root/build.log.gz
/usr/include/c++/13/bits/stl_algo.h:4103:29: internal compiler error: in
modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-ppc64le/python-graph-tool/05175233-python-graph-tool/build.log.gz
src/graph/generation/graph_rewiring.hh:106:5: internal compiler error: in
modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-ppc64le/pcl/05174165-pcl/build.log.gz
/usr/include/boost/circular_buffer/base.hpp:1787:46: internal compiler error:
in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-ppc64le/innoextract/05171222-innoextract/build.log.gz
/usr/include/boost/preprocessor/iteration/detail/limits/local_256.hpp:22:9:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
/usr/include/boost/preprocessor/iteration/detail/limits/local_256.hpp:22:9:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-ppc64le/QuantLib/05167497-QuantLib/build.log.gz
/usr/include/c++/13/bits/stl_iterator_base_funcs.h:106:21: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-ppc64le/llvm9.0/05172812-llvm9.0/build.log.gz
/usr/include/c++/13/bits/stl_algo.h:4103:29: internal compiler error: in
modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-s390x/llvm8.0/05172811-llvm8.0/build.log.gz
/usr/include/c++/13/bits/stl_algo.h:4103:29: internal compiler error: in
modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-s390x/chatterino2/05168380-chatterino2/build.log.gz
/usr/include/c++/13/bits/stl_iterator_base_funcs.h:106:21: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-s390x/pdns-recursor/05174194-pdns-recursor/build.log.gz
/usr/include/boost/circular_buffer/base.hpp:2824:46: internal compiler error:
in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-s390x/krita/05171764-krita/build.log.gz
/usr/include/boost/range/iterator_range_core.hpp:408:28: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700
/usr/include/boost/range/iterator_range_core.hpp:408:28: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-s390x/root/05185147-root/build.log.gz
/usr/include/c++/13/bits/stl_algo.h:4103:29: internal compiler error: in
modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-s390x/python-graph-tool/05175233-python-graph-tool/build.log.gz
src/graph/generation/graph_rewiring.hh:106:5: internal compiler error: in
modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-s390x/pcl/05174165-pcl/build.log.gz
/usr/include/boost/circular_buffer/base.hpp:1787:46: internal compiler error:
in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-s390x/innoextract/05171222-innoextract/build.log.gz
/usr/include/boost/preprocessor/iteration/detail/limits/local_256.hpp:22:9:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
/usr/include/boost/preprocessor/iteration/detail/limits/local_256.hpp:22:9:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-s390x/QuantLib/05167497-QuantLib/build.log.gz
/usr/include/c++/13/bits/stl_iterator_base_funcs.h:106:21: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-s390x/llvm9.0/05172812-llvm9.0/build.log.gz
/usr/include/c++/13/bits/stl_algo.h:4103:29: internal compiler error: in
modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-i386/krita/05171764-krita/build.log.gz
/usr/include/boost/range/iterator_range_core.hpp:408:28: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-i386/vigra/05187153-vigra/build.log.gz
/builddir/build/BUILD/vigra-1.11.1/include/vigra/multi_convolution.hxx:552:26:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-i386/pcl/05174165-pcl/build.log.gz
/usr/include/boost/circular_buffer/base.hpp:1787:46: internal compiler error:
in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-i386/minetest/05173164-minetest/build.log.gz
/builddir/build/BUILD/minetest-5.6.1/src/unittest/test_utilities.cpp:241:32:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
/builddir/build/BUILD/minetest-5.6.1/src/unittest/test_utilities.cpp:241:32:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-i386/QuantLib/05167497-QuantLib/build.log.gz
/usr/include/c++/13/bits/stl_iterator_base_funcs.h:106:21: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-x86_64/chatterino2/05168380-chatterino2/build.log.gz
/usr/include/c++/13/bits/stl_iterator_base_funcs.h:106:21: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-x86_64/pdns-recursor/05174194-pdns-recursor/build.log.gz
/usr/include/boost/circular_buffer/base.hpp:2824:46: internal compiler error:
in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-x86_64/krita/05171764-krita/build.log.gz
/usr/include/boost/range/iterator_range_core.hpp:408:28: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-x86_64/vigra/05187153-vigra/build.log.gz
/builddir/build/BUILD/vigra-1.11.1/include/vigra/multi_convolution.hxx:552:26:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-x86_64/python-graph-tool/05175233-python-graph-tool/build.log.gz
src/graph/generation/graph_rewiring.hh:106:5: internal compiler error: in
modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-x86_64/pcl/05174165-pcl/build.log.gz
/usr/include/boost/circular_buffer/base.hpp:1787:46: internal compiler error:
in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-x86_64/minetest/05173164-minetest/build.log.gz
/builddir/build/BUILD/minetest-5.6.1/src/unittest/test_utilities.cpp:241:32:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
/builddir/build/BUILD/minetest-5.6.1/src/unittest/test_utilities.cpp:241:32:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-x86_64/innoextract/05171222-innoextract/build.log.gz
/usr/include/boost/preprocessor/iteration/detail/limits/local_256.hpp:22:9:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
/usr/include/boost/preprocessor/iteration/detail/limits/local_256.hpp:22:9:
internal compiler error: in modify_call, at ipa-param-manipulation.cc:700
./UNCONFIRMED/fedora-rawhide-x86_64/QuantLib/05167497-QuantLib/build.log.gz
/usr/include/c++/13/bits/stl_iterator_base_funcs.h:106:21: internal compiler
error: in modify_call, at ipa-param-manipulation.cc:700

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [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
  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
                   ` (15 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: slyfox at gcc dot gnu.org @ 2023-01-02 12:50 UTC (permalink / raw)
  To: gcc-bugs

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

Sergei Trofimovich <slyfox at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slyfox at gcc dot gnu.org

--- Comment #14 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
Got a similar ICE on minetest-5.6.1. With a bit of manual cleanup reduced down
to the following:

//$ cat bug.cc
void __throw_out_of_range_fmt(...);
char *_M_p;
struct Trans_NS___cxx11_basic_string {
  long _M_string_length;
  long _M_check___pos;
  Trans_NS___cxx11_basic_string() {
    long __length = 0;
    _M_string_length = __length;
  }
  long size() { return _M_string_length; }
  long foo___pos;
  char foo() { return _M_p[foo___pos]; }
  int compare() { __throw_out_of_range_fmt(_M_check___pos, _M_string_length);
__builtin_trap(); }
};
bool str_starts_with(Trans_NS___cxx11_basic_string &str,
                     Trans_NS___cxx11_basic_string prefix) {
  if (str.size() < prefix.size())
    str.compare();
  for (; prefix.size();) {
    char __trans_tmp_2 = prefix.foo();
    if (__trans_tmp_2)
      return false;
  }
  __builtin_trap();
}
void testStartsWith() {
  Trans_NS___cxx11_basic_string s1, s2;
  str_starts_with(s1, s2);
}

$ g++ -Wall -Wextra  -O3  -c bug.cc
during IPA pass: inline
bug.cc: In function 'void testStartsWith()':
bug.cc:28:18: internal compiler error: in modify_call, at
ipa-param-manipulation.cc:700
   28 |   str_starts_with(s1, s2);
      |   ~~~~~~~~~~~~~~~^~~~~~~~
0x1cbdfd4 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char
const*, __va_list_tag (*) [1], diagnostic_t)
        ???:0
0x1cbec26 internal_error(char const*, ...)
        ???:0
0x753df0 fancy_abort(char const*, int, char const*)
        ???:0
0x723afe ipa_param_adjustments::modify_call(cgraph_edge*, bool) [clone .cold]
        ???:0
0xa4e735 cgraph_edge::redirect_call_stmt_to_callee(cgraph_edge*)
        ???:0
0xec8a13 redirect_all_calls(copy_body_data*, basic_block_def*)
        ???:0
0xece256 copy_body(copy_body_data*, basic_block_def*, basic_block_def*,
basic_block_def*) [clone .isra.0]
        ???:0
0xed1ded expand_call_inline(basic_block_def*, gimple*, copy_body_data*,
bitmap_head*)
        ???:0
0xed3b69 optimize_inline_calls(tree_node*)
        ???:0
0xc3f753 inline_transform(cgraph_node*)
        ???:0
0xd8d1ff execute_all_ipa_transforms(bool)
        ???:0
0xa54b3f cgraph_node::expand()
        ???:0
0xa5604d symbol_table::compile() [clone .part.0]
        ???:0
0xa58517 symbol_table::finalize_compilation_unit()
        ???:0

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [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
  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
                   ` (16 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jamborm at gcc dot gnu.org @ 2023-01-04 13:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Sorry for the breakage.  The problem is that in
ipa_param_body_adjustments::m_replacements, items pertaining to the
same base original parameter are no longer necessarily adjacent, which
is assumed in ipa_param_body_adjustments::modify_call_stmt.

So the following is a stupid quick fix:

diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc
index a0e4098a3f1..974b0c5eb9f 100644
--- a/gcc/ipa-param-manipulation.cc
+++ b/gcc/ipa-param-manipulation.cc
@@ -2127,7 +2127,7 @@ ipa_param_body_adjustments::modify_call_stmt (gcall
**stmt_p,
          for (; j < repl_list_len; j++)
            { 
              if (m_replacements[j].base != base)
-               break;
+               continue;
              if (m_replacements[j].unit_offset < agg_arg_offset)
                continue;
              pass_through_split_map pt_map;


But I'll try to sort m_replacements instead so that we don't do too
many of these linear searches.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [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
  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
                   ` (17 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jamborm at gcc dot gnu.org @ 2023-01-05 16:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I have posted the sorting patch to the mailing list:

https://gcc.gnu.org/pipermail/gcc-patches/2023-January/609459.html

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [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
  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
                   ` (18 preceding siblings ...)
  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
  21 siblings, 0 replies; 23+ messages in thread
From: slyfox at gcc dot gnu.org @ 2023-01-06  8:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
(In reply to Martin Jambor from comment #16)
> I have posted the sorting patch to the mailing list:
> 
> https://gcc.gnu.org/pipermail/gcc-patches/2023-January/609459.html

I confirm the test fixes original minetest-5.6.1 build failure for me. Thank
you!

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [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
  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
                   ` (19 preceding siblings ...)
  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
  21 siblings, 0 replies; 23+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-10 13:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Jambor <jamborm@gcc.gnu.org>:

https://gcc.gnu.org/g:c389991432da2bcc335a2b4fb7e502d28a6b3346

commit r13-5090-gc389991432da2bcc335a2b4fb7e502d28a6b3346
Author: Martin Jambor <mjambor@suse.cz>
Date:   Tue Jan 10 14:18:22 2023 +0100

    ipa: Sort ipa_param_body_adjustments::m_replacements (PR 108110)

    The problem in PR 108110 is that elements describing the same base
    parameter in ipa_param_body_adjustments::m_replacements are not
    adjacent to each other, which is something that
    ipa_param_body_adjustments::modify_call_stmt when it gathers all
    replacements for a parameter.

    One option would be to simply always keep looking until the end of the
    vector (see bugzilla comment 15 for a one-line fix) but the correct
    thing to do is to keep the elements of the vector sorted and thus make
    such elements adjacent again.  This patch does that and then also
    modifies the look-ups to take advantage of it.

    Since the one user of ipa_param_body_adjustments that is not
    tree-inline.cc, which is OpenMP declare SIMD cloning code, also
    registers its own replacements and in theory pointers to elements of
    the m_replacements vector can leak through public method
    get_expr_replacement, I decided that in those cases it is the
    responsibility of the user of the class to call the sorting method
    between the replacement registrations and the first lookup.  That is
    why the patch also adds a line to omp-simd-clone.cc.

    gcc/ChangeLog:

    2023-01-09  Martin Jambor  <mjambor@suse.cz>

            PR ipa/108110
            * ipa-param-manipulation.h (ipa_param_body_adjustments): New
members
            sort_replacements, lookup_first_base_replacement and
            m_sorted_replacements_p.
            * ipa-param-manipulation.cc: Define INCLUDE_ALGORITHM.
            (ipa_param_body_adjustments::register_replacement): Set
            m_sorted_replacements_p to false.
            (compare_param_body_replacement): New function.
            (ipa_param_body_adjustments::sort_replacements): Likewise.
            (ipa_param_body_adjustments::common_initialization): Call
            sort_replacements.
            (ipa_param_body_adjustments::ipa_param_body_adjustments):
Initialize
            m_sorted_replacements_p.
            (ipa_param_body_adjustments::lookup_replacement_1): Rework to use
            std::lower_bound.
            (ipa_param_body_adjustments::lookup_first_base_replacement): New
            function.
            (ipa_param_body_adjustments::modify_call_stmt): Use
            lookup_first_base_replacement.
            * omp-simd-clone.cc (ipa_simd_modify_function_body): Call
            adjustments->sort_replacements.

    gcc/testsuite/ChangeLog:

    2023-01-04  Martin Jambor  <mjambor@suse.cz>

            PR ipa/108110
            * g++.dg/ipa/pr108110.C: New test.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [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
  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
                   ` (20 preceding siblings ...)
  2023-01-10 13:20 ` cvs-commit at gcc dot gnu.org
@ 2023-01-10 13:21 ` jamborm at gcc dot gnu.org
  21 siblings, 0 replies; 23+ messages in thread
From: jamborm at gcc dot gnu.org @ 2023-01-10 13:21 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #19 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2023-01-10 13:21 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).