https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91491
Bug ID: 91491
Summary: [9 Regression] glib2.0 build not working when built
with -O2 on x86_64-linux-gnu
Product: gcc
Version: 9.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: doko at debian dot org
Target Milestone: ---
Created attachment 46731
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46731&action=edit
preprocessed source
[forwarded from https://bugs.debian.org/931921]
Seen with 9.2.0 on x86_64-linux-gnu, works with GCC 8, or with GCC 9 -O1.
Further tracked down to:
On Fri, 02 Aug 2019 at 19:49:20 +0100, Simon McVittie wrote:
> If you compile test_run_seed() with -O1, and the rest of gtestutils.c
> with -O2, the clutter test hangs.
Binary-searching through the extra optimizations enabled by -O2 [1]
led me to the minimal change being: if you modify test_run_seed() to add
__attribute__((optimize("no-tree-pre")))
then the clutter test passes. Without that attribute it fails.
Attaching the preprocessed gtestutils source.