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

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
Alternate testcase:

struct request_t;
typedef void (*request_start_fn_t)(unsigned long, struct request_t **);
struct request_t { request_start_fn_t req_start; } typedef request_t;
struct { request_t req_ompi; } typedef precv_request_t;
request_t *start_req_3;
long start_req_2;
request_t start_req_3_0;
precv_request_t precv_request_construct_recvreq;

__attribute__((__always_inline__)) static inline void
start(unsigned long count, request_t **)
{
  for (; count;)
    start_req_3_0.req_start(start_req_2, &start_req_3);
}
void precv_request_construct()
{
  precv_request_construct_recvreq.req_ompi.req_start = start;
}

> ./cc1 -quiet part_persist_recvreq.i -O2 -Wall
In function ‘start’,
    inlined from ‘start’ at part_persist_recvreq.i:14:5,
    inlined from ‘start’ at part_persist_recvreq.i:14:5,
    inlined from ‘start’ at part_persist_recvreq.i:14:5,
    inlined from ‘start’ at part_persist_recvreq.i:14:5,
    inlined from ‘start’ at part_persist_recvreq.i:14:5,
    inlined from ‘start’ at part_persist_recvreq.i:14:5,
    inlined from ‘start’ at part_persist_recvreq.i:14:5,
    inlined from ‘start’ at part_persist_recvreq.i:14:5:
part_persist_recvreq.i:11:1: error: inlining failed in call to ‘always_inline’
start’: --param max-inline-insns-single limit reached
   11 | start(unsigned long count, request_t **)
      | ^~~~~
part_persist_recvreq.i:14:5: note: called from here
   14 |     start_req_3_0.req_start(start_req_2, &start_req_3);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

if you comment the 'for (; count;)' line you get back the recursive inlining
diagnostic

Reply via email to