Hi Bernhard,

> > Should be fixed with the attached patch

This was untested, was it? Because in a gnulib testdir, 'test-verify'
now crashes immediately. The reason is that the compiler eliminated the
entire code of the main() function, because it was told that it is
on a dead branch:
  state s = { 0 }
implies
  s.halt = 0;
and
  assume (s->halt);
means that if the 'halt' field is zero, the code flow cannot get here.

This patch fixes it.


2020-11-03  Bruno Haible  <[email protected]>

        verify tests: Fix crash with GCC (regression 2020-11-02).
        * tests/test-verify.c (main): Fix initializer of s.

diff --git a/tests/test-verify.c b/tests/test-verify.c
index a141417..fe7599c 100644
--- a/tests/test-verify.c
+++ b/tests/test-verify.c
@@ -112,7 +112,7 @@ test_assume_noreturn (void)
 int
 main (void)
 {
-  state s = { 0 };
+  state s = { 0, 1 };
   test_assume_expressions (&s);
   test_assume_optimization (5);
   return !(function (0) == 0 && function (1) == 8);


Reply via email to