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
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
: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gburca-gnu at ebixio dot com
Target Milestone: ---
The following code prints uninitialized garbage when compiled with -O2 or -O3
in all versions of GCC 12 (including trunk). It works correctly in GCC 11.
Replacing strncpy
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gburca-gnu at ebixio dot com
Target Milestone: ---
Created attachment 44265
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44265&action=edit
Bug demo
Linking together librari
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85651
--- Comment #3 from Gabriel Burca ---
Does that also fix the issue with the ignored diagnostic pragmas?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85651
--- Comment #1 from Gabriel Burca ---
I suspect the "for" loop in appendAux() is being optimized and replaced with a
memcpy(), which then leads to the warning.
++
Assignee: unassigned at gcc dot gnu.org
Reporter: gburca-gnu at ebixio dot com
Target Milestone: ---
Created attachment 44069
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44069&action=edit
Code demonstrating issue
https://godbolt.org/g/LmJDVa
When compiled with g+