Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2016-06

Aarch64-darwin, float-point parameter

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dmitry Boyarintsev

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

Reply by email

Dmitry Boyarintsev
to Jonas Maebe
Jonas Maebe wrote 8 lines
On 07/06/16 14:36, Dmitry Boyarintsev wrote: > Any suggestion what should I pay attention to and/or provide information > about? > Compilable source code + used command line parameters.

A stand-alone test doesn't reproduce the issue.
That suggests that the problem is in the main code, rather than the compiler. Sorry for hustle

thanks,
Dmitry

Reply by email

Dmitry Boyarintsev
to Dmitry Boyarintsev

On Tue, Jun 7, 2016 at 11:31 PM, Dmitry Boyarintsev <

Show quoted text 13 lines
wrote: On Tue, Jun 7, 2016 at 12:00 PM, Jonas Maebe wrote: > > Compilable source code + used command line parameters. > A stand-alone test doesn't reproduce the issue. That suggests that the problem is in the main code, rather than the compiler. Sorry for hustle

The issue appears to be related to -O3 optimization, if switched off it works the app works fine.

The stand-alone test still doesn't show the issue even with -O3 enabled.

thanks,
Dmitry

Reply by email