This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/26724] __builtin_constant_p fails to recognise function with constant return


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

--- Comment #2 from Anton Blanchard <anton at samba dot org> ---
This issue is still present. The workaround Andrew suggests is good:

static inline int baz(void)
{
        return 0;
}

void bad()
{
        int i = baz();
        if (!__builtin_constant_p(i))
                FAIL();
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]