public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107931] New: [12 Regression] -Od causes always_inline to fail
@ 2022-11-30  7:52 me at xenu dot pl
  2022-11-30  7:55 ` [Bug c/107931] [12 Regression] -Og " me at xenu dot pl
                   ` (27 more replies)
  0 siblings, 28 replies; 29+ messages in thread
From: me at xenu dot pl @ 2022-11-30  7:52 UTC (permalink / raw)
  To: gcc-bugs

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

            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 ‘fun3’,
    inlined from ‘fun2’ at code.c:15:5:
code.c:26:1: error: inlining failed in call to ‘always_inline’ ‘fun4’: function
not considered for inlining
   26 | fun4(void)
      | ^~~~
code.c:9:5: note: called from here
    9 |     p();
      |     ^~~

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2024-07-03  4:58 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30  7:52 [Bug c/107931] New: [12 Regression] -Od causes always_inline to fail me at xenu dot pl
2022-11-30  7:55 ` [Bug c/107931] [12 Regression] -Og " me at xenu dot pl
2022-11-30 12:30 ` [Bug ipa/107931] [12/13 Regression] -Og causes always_inline to fail since r12-6677-gc952126870c92cf2 marxin at gcc dot gnu.org
2022-11-30 12:52 ` rguenth at gcc dot gnu.org
2022-12-01 15:34 ` jakub at gcc dot gnu.org
2022-12-01 17:59 ` me at xenu dot pl
2022-12-01 18:02 ` jakub at gcc dot gnu.org
2022-12-02  7:22 ` rguenther at suse dot de
2022-12-21 10:44 ` rguenth at gcc dot gnu.org
2023-02-17 10:16 ` sam at gentoo dot org
2023-02-18  6:32 ` ishikawa at yk dot rim.or.jp
2023-02-18  6:35 ` ishikawa at yk dot rim.or.jp
2023-02-18  7:05 ` pinskia at gcc dot gnu.org
2023-02-18  7:10 ` pinskia at gcc dot gnu.org
2023-02-18 23:34 ` ishikawa at yk dot rim.or.jp
2023-02-20  7:49 ` rguenth at gcc dot gnu.org
2023-02-20 10:40 ` jakub at gcc dot gnu.org
2023-02-20 10:51 ` rguenther at suse dot de
2023-02-21  7:33 ` ishikawa at yk dot rim.or.jp
2023-02-21  7:36 ` rguenther at suse dot de
2023-02-21 11:56 ` hubicka at ucw dot cz
2023-05-08 12:26 ` [Bug ipa/107931] [12/13/14 " rguenth at gcc dot gnu.org
2024-01-12 10:11 ` rguenth at gcc dot gnu.org
2024-01-12 10:26 ` jakub at gcc dot gnu.org
2024-01-12 11:56 ` rguenth at gcc dot gnu.org
2024-01-23  8:31 ` rguenth at gcc dot gnu.org
2024-01-23  8:39 ` jakub at gcc dot gnu.org
2024-01-23 10:30 ` rguenther at suse dot de
2024-07-03  4:58 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).