Internal error 2009112601 lazarus / 64-FPC development ---------------------------------------------------------------------- winni · 2022-03-01 21:11 Hi! Compiler versions increase - but some errors remain the same. Inlining this function results in the Internal error 2009112601 since years. In fpc 3.0, 3.04, 3.2.2 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function SolveCassini  (r1,d,b: single) : TPointF; inline;var x,y,r2,tmp : single;begin r2:= sqr (b)/r1; x := (sqr(d)-sqr(r2)+sqr(r1) ) / (2*d); tmp := sqr(r1) - sqr(x); if tmp < 0 then result := EmptyPointF else // point not valid      begin       y := sqrt (tmp);       result := PointF(x,y);      end;    end;                                                   No problems without inline. But this  function is  called a lot of times for a whole Cassini curve. Any ideas? Winni ---------------------------------------------------------------------- Thaddy · 2022-03-01 21:26 winni, platform? 32/64? ---------------------------------------------------------------------- winni · 2022-03-01 22:22 Sorry Thaddy Lin64, now fpc 3.2.2 Not tested on other OS or 32 bit Winni ---------------------------------------------------------------------- winni · 2022-03-01 22:46 By the way: The Cassini curve needs the eye specialist See attachment Winni ---------------------------------------------------------------------- Thaddy · 2022-03-02 05:55 The error is defined in ncgld.pas (in trunk line 999) and there is already a test that reproduced it in tw36381.pp. But that test passes in my very recent trunk, compiled with -CpCOREAVX2 -OpCOREAVX2 -CfAVX2 Meaning the devs are aware of it... Or that they think it is fixed. That's all that grep could tell me  That code is too complex for me to touch. Did you try different FPU modes? What FPU mode are you using? E.g. assuming Intel  -CfAVX2 (It seems vector related and AVX2 can handle unaligned data. I may be totally wrong. Anyway, does not hurt to try it) ---------------------------------------------------------------------- PascalDragon · 2022-03-02 08:09 Quote from: winni on March 01, 2022, 10:11:37 pmHi! Compiler versions increase - but some errors remain the same. Inlining this function results in the Internal error 2009112601 since years. In fpc 3.0, 3.04, 3.2.2 And did you ever report it? If not then how do you expect us to know about it? Quote from: Thaddy on March 02, 2022, 06:55:17 amMeaning the devs are aware of it... Or that they think it is fixed. An internal error isn't necessarily triggered by only one code path. So this can very well be a different issue that triggers the same error. ---------------------------------------------------------------------- JuhaManninen · 2022-03-02 08:29 Quote from: winni on March 01, 2022, 10:11:37 pmInlining this function results in the Internal error 2009112601 since years. Your function SolveCassini is complex with many variables. Inlining it may not be beneficial even after the bug gets fixed. It depends on how complex the caller function is, and on CPU architecture. Typically big functions must use stack for some variables. Maybe FPC can optimize register usage better now. I don't know. PascalDragon has more knowledge. Is inlining a good idea here? ---------------------------------------------------------------------- Bart · 2022-03-02 08:33 Quote from: PascalDragon on March 02, 2022, 09:09:13 amAnd did you ever report it? If not then how do you expect us to know about it? In defence of winni: Inline function causes internal compiler error 2009112601 . Given winni's use case I would also have concluded that the issue was already reported. Bart ---------------------------------------------------------------------- winni · 2022-03-02 08:50 Hi! The Internal compiler error 2009112601 was in the old Bugreport system - unsolved. As the error number tells us it is from 26. November 2009 - more than  12 years ago. Winni ---------------------------------------------------------------------- Thaddy · 2022-03-02 10:51 Quote from: PascalDragon on March 02, 2022, 09:09:13 amAn internal error isn't necessarily triggered by only one code path. So this can very well be a different issue that triggers the same error. I am aware of that. Could it be an alignment issue? Because the test passes. ---------------------------------------------------------------------- PascalDragon · 2022-03-02 12:37 Quote from: Bart on March 02, 2022, 09:33:03 amQuote from: PascalDragon on March 02, 2022, 09:09:13 amAnd did you ever report it? If not then how do you expect us to know about it? In defence of winni: Inline function causes internal compiler error 2009112601 . I take it you mean Internal error 2009112601 and not the one you linked, cause that one was reported by someone else. Quote from: winni on March 02, 2022, 09:50:35 amThe Internal compiler error 2009112601 was in the old Bugreport system - unsolved. There exist only two bug reports that mention internal error 2009112601, both are mentioned above and both were already closed before the conversion from Mantis to GitLab. I also wasn't able to reproduce this issue with the uncompilable fragment you had added to your own report (which is why it's always important to provide a full example), neither with 3.2.2 nor with 3.3.1. So if you have something that triggers that internal error, then please provide a full, small, self contained example together with any special options you use for compilation as well as the target platform you compile for. If we can't reproduce something then we can't fix it. Quote from: winni on March 02, 2022, 09:50:35 amAs the error number tells us it is from 26. November 2009 - more than  12 years ago. That has nothing to do with that, the bug itself can be much older or much younger. The internal error number simply shows when this error was added and more often than not the internal error is correct where it is, it's just that the compiler should not reach that part and thus a bug happened in another place of the compiler leading it down a path it should not take (that's why internal errors exist after all).