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

2023-04-11 Thread matthijs at stdin dot nl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26724 Matthijs Kooijman changed: What|Removed |Added CC||matthijs at stdin dot nl ---

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

2020-01-22 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26724 --- Comment #4 from Marc Glisse --- (In reply to pskocik from comment #3) > I don't know if this is related, It isn't, please file a separate bug report. memcmp is optimized to an integer comparison in strlen, much later than the lowering of

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

2020-01-22 Thread pskocik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26724 pskocik at gmail dot com changed: What|Removed |Added CC||pskocik at gmail dot com ---

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

2015-12-03 Thread anton at samba dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26724 --- Comment #2 from Anton Blanchard --- 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))

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

2006-03-17 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2006-03-17 15:20 --- Confirmed, the problem is: /* If this expression has side effects, show we don't know it to be a constant. Likewise if it's a pointer or aggregate type since in those case we only want literals, since