[Bug middle-end/109609] [12/13 Regression] tail call for function even when passing a ptr which references a local array still

2023-04-25 Thread gburca-gnu at ebixio dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109609 --- Comment #17 from Gabriel Burca --- Speaking of the size parameter, my workaround for the original issue was to pre-compute the size argument a different way. This however resulted in a warning that's both right and wrong. Here's the sample c

[Bug middle-end/109609] [12/13/14 Regression] tail call for function even when passing a ptr which references a local array still

2023-04-24 Thread gburca-gnu at ebixio dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109609 --- Comment #7 from Gabriel Burca --- Here's the code that still fails with -O3 -fno-optimize-sibling-calls: ``` #include #include #define N 23 #define MAX_LEN 13 char dst[N + 1]; void stringify(uint64_t id) { char buf[MAX_LEN]; char *pt

[Bug c++/109609] New: Invalid strncpy/strncat optimization in GCC 12

2023-04-24 Thread gburca-gnu at ebixio dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109609 Bug ID: 109609 Summary: Invalid strncpy/strncat optimization in GCC 12 Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: