Hi everyone,

So one of my recent merge requests (https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/516) has been having test failures on arm-linux, and this has confused me for a while because they don't occur on aarch64-linux (the two platforms share the same code in this particular case).  Well, after a lot of debugging and random shots in the dark, I've found the problem.

RegModifiedByInstruction and RegInInstruction doesn't handle NR_DEFAULTFLAGS on the Arm implementation - it always returns False, so calling RegUsedBetween or RegModifiedBetween for the flags register always returns a false negative.  The other fault is that it doesn't check if the input object is an instruction (there's no "if p.typ <> ait_instruction then Exit;" check).

I guess taking a step back and taking a breath can help find the solution, so I'll be fixing this with the merge request.

Kit

P.S. The above compiler methods are only used by the peephole optimizer, and Arm's peephole optimizer is relatively basic currently.

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to