Sorry for the new topic, but just for visibility.
Pulled the latest hare master
(74719e1e76ba307582a3f7cbaa8dddfb316bcb19) and am getting:
~/src/hare$ make clean; make check
...
qbe:.cache/bytes.ssa:2402: ssa temporary %ifc.1135 is used undefined
in @matches.995
Clearly an if-conversion snafu cos of the temporary name "%ifc.*".
Ooops, and will investigate...
R
Another observation from this test case - see below code snippet - is
that QBE code generated by hare frequently uses jnz+phi's to combine
cmp (boolean) conditions.
Quentin and I noticed cproc doing something similar and after some
attempts to "fix this" in QBE, Quentin came up with a neat
cproc patch - https://lists.sr.ht/~mcf/cproc/patches/53742 - instead.
The general-purpose if-conversion in this patch can be simplified for
boolean-only values (and/or condition combining), and/but there (also)
might be better ways in general of wrangling either the hare code-gen
or early QBE CFG manipulation.
> @.897> dbgloc 96, 14> dbgloc 96, 32> dbgloc 96, 27> dbgloc 96, 27> %field.913 =l add %s, 48> %.914 =l load %field.913> dbgloc 96, 32> %.911 =w csltl %.914, 0> dbgloc 97, 14> dbgloc 97, 25> dbgloc 97, 34> dbgloc 97, 37> dbgloc 97, 50> %ifc.1128 =l extuw %.911> %ifc.1129 =l neg %ifc.1128 <--- true mask> %ifc.1130 =l sub %ifc.1128, 1 <--- false mask> %ifc.1131 =l and %ifc.1130, $bytes.index> %ifc.1132 =l and %ifc.1129, $bytes.rindex> %.916.985 =l or %ifc.1131, %ifc.1132> @.919> dbgloc 99, 14> dbgloc 100, 52> dbgloc 99, 57> dbgloc 99, 35> dbgloc 99, 57> dbgloc 99, 38> dbgloc 99, 38> %.930 =w cnel %.914, -9223372036854775808> %ifc.1133 =w and %ifc.1130, %.911 <--- %.911 =w csltl %.914, 0> %ifc.1134 =w and %ifc.1129, %.930 <--- %.930 =w cnel %.914, -9223372036854775808> %.926.988 =w or %ifc.1133, %ifc.1134> @.928> ...>> Will fix real soon now...>> R