Bugzilla – Bug 1213600
gcc13 fails to recognize range of values in switch statement
Last modified: 2023-07-28 07:40:53 UTC
Created attachment 868399 [details] source_genCases_f16.c.i.xz random_ui8 returns an unsigned char. (u8 & 7) means values between zero and seven need to be handled. genCases_f16.c: In function 'f16Random': genCases_f16.c:336:1: error: control reaches end of non-void function [-Werror=return-type]
The diagnostic happens before optimization and thus analysis of all case values and an unreachable 'default' case is emitted by gimplification. Reported upstream.
You can put __builtin_unreachable (); after the switch to silence the diagnostic.