From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C99D03858D28; Wed, 30 Nov 2022 07:52:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C99D03858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669794779; bh=6QKW00tGrS7nfjWh1MTj9oIldCnsCxdzGtytZrQkZig=; h=From:To:Subject:Date:From; b=RDRwm7VEQtONOlmQu+8lnLlMZ7KKfxrhCskmjdgZdJkZZQOPQe2vqJYYUtIMcuqDs +IYxjsc86cq2UnoRUrGYd5ZICmjebYWYzsFO5WqJT33oilKLp/5puPsyuLW4d6/zXy vG3/b9OVMn88Gt6gmiBgG5XCPGhX0tzbBAdZISzw= From: "me at xenu dot pl" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107931] New: [12 Regression] -Od causes always_inline to fail Date: Wed, 30 Nov 2022 07:52:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: me at xenu dot pl X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107931 Bug ID: 107931 Summary: [12 Regression] -Od causes always_inline to fail Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: me at xenu dot pl Target Milestone: --- The error below occurs only with -Od. The code is accepted if one of -O0, -O1, -O2, -O3 or -Os is used instead. This happens with GCC 12.1 and 12.2, it doesn't with 11.3. $ cat code.c typedef int (*fptr_t) (void); static inline int __attribute__((always_inline)) fun4(void); static inline void __attribute__((always_inline)) fun3(fptr_t p) { p(); } static void fun2(void) { fun3(fun4); } void fun1(void) { fun2(); } static inline int __attribute__((always_inline)) fun4(void) { return 1; } $ /opt/gcc-12.2.0/bin/gcc -c -Og code.c In function =E2=80=98fun3=E2=80=99, inlined from =E2=80=98fun2=E2=80=99 at code.c:15:5: code.c:26:1: error: inlining failed in call to =E2=80=98always_inline=E2=80= =99 =E2=80=98fun4=E2=80=99: function not considered for inlining 26 | fun4(void) | ^~~~ code.c:9:5: note: called from here 9 | p(); | ^~~=