https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88317

--- Comment #2 from Arseny Solokha <asolokha at gmx dot com> ---
(In reply to Richard Biener from comment #1)
> Running via valgrind makes it succeed (eh).

You'll likely have different results w/ different revisions of the compiler
under test. One may want to tweak various expressions one by one, or change
variables in random expressions, or change iteration count of some random loop
in order to observe various failure modes.

Valgrind output in comment 0 demonstrates that the tool in principle can catch
this memory corruption. I had to make the following change in the testcase just
before submission exactly because Valgrind stopped detecting corruption w/ it
after switching from r266441 to r266729:

--- ovoyxfol.c.jj       2018-12-04 17:28:33.212143512 +0700
+++ ovoyxfol.c  2018-12-04 17:28:48.214979208 +0700
@@ -638,7 +638,7 @@
     while (si) {
       int j5;
       while (*gd)
-        for (n4 = 4; n4 < 1000; n4++)
+        for (n4 = 4; n4; n4++)
           if (*gd) {
             vm = j5;
             mr = vm;

Reply via email to