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

            Bug ID: 107485
           Summary: gcc-10 ICE with -fnon-call-exception
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: spop at gcc dot gnu.org
  Target Milestone: ---

On arm64-linux I see the following crash only on gcc-10.
I do not see the ICE on gcc-11, 12, and trunk. 

$ ~/gcc-10/bld/gcc/cc1plus -fnon-call-exceptions f.ii
[...]
f.ii:29:23: internal compiler error: Segmentation fault
   29 |   template <int> void x(double *, b, unsigned long *) { f(); }
      |                       ^
0x134e58b crash_signal
        ../../gcc/toplev.c:328
0x1639464 tree_vec_extract(gimple_stmt_iterator*, tree_node*, tree_node*,
tree_node*, tree_node*)
        ../../gcc/tree-vect-generic.c:140
0x163ca0f expand_vector_condition
        ../../gcc/tree-vect-generic.c:1044
0x164081f expand_vector_operations_1
        ../../gcc/tree-vect-generic.c:1988
0x16419f7 expand_vector_operations
        ../../gcc/tree-vect-generic.c:2240
0x1641b3f execute
        ../../gcc/tree-vect-generic.c:2284
[...]

$ cat f.ii
typedef long a;
typedef double b;
typedef struct {
  a c __attribute__((__vector_size__(32)));
  b d __attribute__((__vector_size__(32)));
} e;
__attribute__((__always_inline__)) b f() {
  e g, h, i;
  g.c = h.d < i.d;
}
class j {
  bool k();
};
template <typename l, typename n, typename aa> void ab(aa, l, n) {
  int o;
  typename n::p q;
  unsigned long r;
  q(0, o, &r);
}
namespace s {
template <typename, typename n, typename, typename>
void t(j *, long, long, unsigned long *, int u) {
  n ac;
  void v();
  ab(v, u, ac);
}
} // namespace s
struct w {
  template <int> void x(double *, b, unsigned long *) { f(); }
  double ad;
  void operator()(double, double, unsigned long *) {
    unsigned long m;
    x<0>(&ad, 0, &m);
  }
};
using s::t;
struct y {
  using p = w;
};
long ag, ah;
unsigned long ai;
double aj;
bool j::k() {
  using n = y;
  t<j, n, a, double>(this, ag, ah, &ai, aj);
}



git bisect stops on this patch:

commit 1e676cfbe1e13fba2c636b560362ed4f0a56893d
Author: Richard Biener <rguent...@suse.de>
Date:   Mon May 18 08:51:23 2020 +0200

    middle-end/95171 - inlining of trapping compare into non-call EH fn

    This fixes always-inlining across -fnon-call-exception boundaries
    for conditions which we do not allow to throw.

    2020-05-18  Richard Biener  <rguent...@suse.de>

            PR middle-end/95171
            * tree-inline.c (remap_gimple_stmt): Split out trapping compares
            when inlining into a non-call EH function.

            * gcc.dg/pr95171.c: New testcase.

    (cherry picked from commit fe168751c5c1c517c7c89c9a1e4e561d66b24663)

Reply via email to