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

            Bug ID: 103601
           Summary: [12 Regression] ICE in insert_kill, at
                    ipa-modref-tree.c:84
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rearnsha at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---
            Target: arm-none-eabi aarch64-none-elf

The following reduced testcase (from CSiBE) generates an ICE at -O2 or above:

typedef struct { } spinlock_t;
struct list_head {
 struct list_head *next, *prev;
};
struct __wait_queue_head {
 spinlock_t lock;
 struct list_head task_list;
};
typedef struct __wait_queue_head wait_queue_head_t;
static inline void init_waitqueue_head(wait_queue_head_t *q)
{
 q->lock = (spinlock_t) { };
 do { (&q->task_list)->next = (&q->task_list); (&q->task_list)->prev =
(&q->task_list); } while (0);
}
struct timer_list {
 void (*function)(unsigned long);
};
struct rpc_task {
 struct timer_list tk_timer;
 wait_queue_head_t tk_wait;
};
typedef void (*rpc_action)(struct rpc_task *);
static void
rpc_run_timer(struct rpc_task *task)
{
}
inline void
rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt,
    rpc_action callback, int flags)
{
 task->tk_timer.function = (void (*)(unsigned long)) rpc_run_timer;
 init_waitqueue_head(&task->tk_wait);
}

When compiled with, eg:

-O3 -mcpu=arm1136jf-s -marm -mfpu=vfp -mfloat-abi=softfp -fno-short-enums
-fgnu89-inline -fno-strict-aliasing -fno-common -fomit-frame-pointer
-fno-strength-reduce test.c

Reply via email to