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.

I have no idea why.

    smcv

[1] gcc-9 -Q -O2 --help=optimizers > O2
    gcc-9 -Q -O1 --help=optimizers > O1
    diff -u O1 O2
From: Simon McVittie <s...@debian.org>
Date: Fri, 2 Aug 2019 20:13:39 +0100
Subject: Disable an optimization when building with gcc 9

This appears to break the clutter autopkgtest, but I don't know why.

Signed-off-by: Simon McVittie <s...@debian.org>
Bug: https://bugs.debian.org/931921
---
 glib/gtestutils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/glib/gtestutils.c b/glib/gtestutils.c
index c9bc3dd..0908686 100644
--- a/glib/gtestutils.c
+++ b/glib/gtestutils.c
@@ -1607,6 +1607,9 @@ void
     test_built_files_dir = test_argv0_dirname;
 }
 
+#if defined(__GNUC__) && __GNUC__ >= 9 && !defined(__clang__)
+__attribute__((optimize("no-tree-pre")))
+#endif
 static void
 test_run_seed (const gchar *rseed)
 {

Reply via email to