https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95857
Bug ID: 95857 Summary: Silencing an unused label warning with (void)&&label; can make gcc segfault Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: pskocik at gmail dot com Target Milestone: --- Created attachment 48777 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48777&action=edit preprocessed reproducer that crashes gcc >= 8.1 at -O2/-O3/-Os In certain more complex contexts and with optimization on (>= -O2), silencing -Wunused-label warnings with (void)&&label; will make gcc segfault. The attached example ( https://gcc.godbolt.org/z/iEhgL2 ) obtained with creduce crashes gcc >= 8.1 when compiled at -O2/-O3/-Os. I haven't observed the bug in older versions of gcc.