Bug 1213600 - gcc13 fails to recognize range of values in switch statement
Summary: gcc13 fails to recognize range of values in switch statement
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: x86-64 Linux
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Richard Biener
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-24 12:32 UTC by Olaf Hering
Modified: 2023-07-28 07:40 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
source_genCases_f16.c.i.xz (5.58 KB, application/x-xz)
2023-07-24 12:32 UTC, Olaf Hering
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olaf Hering 2023-07-24 12:32:06 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]
Comment 1 Richard Biener 2023-07-28 07:36:59 UTC
The diagnostic happens before optimization and thus analysis of all case values
and an unreachable 'default' case is emitted by gimplification.

Reported upstream.
Comment 2 Richard Biener 2023-07-28 07:40:53 UTC
You can put __builtin_unreachable (); after the switch to silence the diagnostic.