https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80924
Bug ID: 80924
Summary: Value range prediction affected by optimization
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: shane at paga dot moe
Target Milestone: ---
Created attachment 41442
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41442&action=edit
The testing code
This simple c code can successfully compiled in -Wall -Werror
But not in -O2 -Wall -Werror
Here is the output:
‘snprintf’ output between 3 and 6 bytes into a destination of size 5