This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/26724] __builtin_constant_p fails to recognise function with constant return
- From: "anton at samba dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 Dec 2015 05:12:26 +0000
- Subject: [Bug middle-end/26724] __builtin_constant_p fails to recognise function with constant return
- Auto-submitted: auto-generated
- References: <bug-26724-4 at http dot gcc dot gnu dot org/bugzilla/>
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();
}