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

            Bug ID: 92278
           Summary: [10 regression] LTO ICE
                    ipa_get_ith_polymorhic_call_context ipa-prop.h:616
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimhen at gmail dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

r277460 PASS
r277486 FAIL as PR92242
r277504 FAIL
r277576 FAIL

$ cat a.i
typedef enum a b;
unsigned f2(b *, int);

void f1(void* i, void* j) {
  (void) i;
  (void) j;
  f2(0, 0);
}

$ cat b.i
typedef unsigned (*c)(void *, void *);
typedef struct {
  c d;
} e;

unsigned f1(void *, void *);
static const e f[] = {{f1}};

const e *foo() { return f; }

$ cat c.i
int g(int, int, int, unsigned char *, int);
void a(void *, void *);

typedef struct {
  int b;
} c;
typedef struct {
  c d;
} e;

static int h(unsigned char *i, int j, int *k, int l) {
  int ae = j;
  j = ae;
  g(0, 0, 0, i, 0);
  if (l)
    a(k, 0);
  return 0;
}
static int am(void) { return 0; }
static int ar(c *i) {
  int as = i->b;
  h(0, as, 0, 0);
  return 0;
}
unsigned f2(e *i, int j) {
  (void) j;
  am();
  ar(&i->d);
  return 0;
}

$ cat x.ver
{ global:
foo;
local: *; };

$ gcc -fpreprocessed -O2 -flto -c a.i b.i c.i

$ gcc -flto -fPIC -DPIC -shared a.o b.o c.o -Wl,-version-script -Wl,x.ver -o
libx.so
during IPA pass: inline
lto1: internal compiler error: Segmentation fault
0xdd458f crash_signal
        /home/dimhen/src/gcc_current/gcc/toplev.c:326
0xbef32b ipa_get_ith_polymorhic_call_context
        /home/dimhen/src/gcc_current/gcc/ipa-prop.h:616
0xbef32b update_jump_functions_after_inlining
        /home/dimhen/src/gcc_current/gcc/ipa-prop.c:2671
0xbf00e3 propagate_info_to_inlined_callees
        /home/dimhen/src/gcc_current/gcc/ipa-prop.c:3555
0x16f7a8c inline_call(cgraph_edge*, bool, vec<cgraph_edge*, va_heap, vl_ptr>*,
int*, bool, bool*)
        /home/dimhen/src/gcc_current/gcc/ipa-inline-transform.c:488
0x16f13b2 inline_small_functions
        /home/dimhen/src/gcc_current/gcc/ipa-inline.c:2151
0x16f13b2 ipa_inline
        /home/dimhen/src/gcc_current/gcc/ipa-inline.c:2615
0x16f13b2 execute
        /home/dimhen/src/gcc_current/gcc/ipa-inline.c:3023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/local/binutils_current/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Reply via email to