<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi everyone,</p>
<p>So I had some difficulty reproducing a regression with my latest
optimisation patch, but a couple of days ago I finally reproduced
it and isolated the cause. As explained in the topic, my
optimisation was faulty with the instruction pair "movb $-63,%al;
movsbw %al,%ax" and other similar constructs - negative constants
weren't handled properly.</p>
<p>It seems that not all regressions are caught when you run the
test suite conventionally, and you have to specify additional
options like "-O4", which may cause other failures to occur if a
test is not expecting any kind of intense optimisation, for
example. In response, over here at
<a class="moz-txt-link-freetext" href="https://bugs.freepascal.org/view.php?id=36687">https://bugs.freepascal.org/view.php?id=36687</a>, I've introduced two
new tests that are copies of the ones that failed, but which
explicitly add -O4 to the default compiler options. Besides
covering the fault in my patch, I can see these tests proving
useful later on because I can see future peephole optimisations in
the compiled assembly language (e.g. the following triplet
appears... "movw $65280,%ax; cmp $65280,%ax; je @lbl"... logical
analysis shows that the conditional branch is always taken).<br>
</p>
<p>Long story short, the patch <i>finally</i> works and a full run
of the regression suite on i386-win32 and x86_64-win64, including
the two new tests, show no new failures.</p>
<p>Gareth aka. Kit<br>
</p>
</body>
</html>