[fpc-devel] Aarch64-darwin, float-point parameter

Dmitry Boyarintsev skalogryz.lists at gmail.com
Tue Jun 7 14:36:39 CEST 2016


Hello,

I'm observing a weird behavior in a generated code (fpc-trunk, last night
revision).
A routine looks like this:

procedure some_paint(...  ; x, y, w, h: Single; ...)
var
  f1, f2 : Single; // local variable

..  // all operands are Single type
  f1 := 1 / Data.t1 / Data.v1;    // <-- the line corrupts value of
parameters x,y,w,h
  f2 := 1 / Data.t2 / Data.v2;

In fact, it feels like any multiplication or division operations corrupts
float-point parameters.

The same code works for all other darwin targets (i386, x86_64 and arm7).

I was thinking it might have something to do with Apple's specific ABI and
even specified -Ca parameter explicitly (which didn't make any difference,
as expected.)

Sorry, I didn't get any assembler code, but will do it later today.
Any suggestion what should I pay attention to and/or provide information
about?

thanks
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160607/033a4ddc/attachment.html>


More information about the fpc-devel mailing list