Gas64 (no more use of gcc, only gas) WDS / LNX

User projects written in or related to FreeBASIC.
Post Reply
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by SARG »

@srvaldez,deltarho
Thank you for your reports

Since several days I was hunting 2 fuc...ng bugs after self compiling, hence my late reply.
It remains this one :
for i as integer =1 to 5 step 2 --> null pointer error
for i as integer =1 to variable step 2 --> ok

@srvaldez
Bug with printf due to variadic and float.
Fixed in ten minutes, just by adding a line....

@deltarho
Bug with dodicat's pool
A typo v1 instead v2 in a test when converting single to double. Weirdly it passed through all the tests.
By the way when using fbc64_gas64, -gen gas64 is not necessary it's the backend by default.

@robert
This version can not really be used for selfcompiling due to the remaining bug. And a lot of changes for Nulix (joke for TJF) not tested it should be worst.

http://users.freebasic-portal.de/sarg/ir-gas64.zip
.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by dodicat »

SARG
Is that pool bug due to me?
I am trying to trace it.
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by SARG »

@dodicat
No no :-)
deltarho reported a bug with gas64 when he tried to compile your code. Nothing more. The bug is now fixed (a typo).

@all
By the way there are still bugs as gas64 can't self compile twice but all the tests (from test suite) are passed with succes. So for helping, imagine complex codes (not very long but with arrays, structures, calling procedures, etc), compile and report any issue. Thanks in advance..
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by dodicat »

Thanks SARG.
Got your latest, OK.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by dodicat »

small bug

Code: Select all


type vector
    as single x,y,z
end type

static as vector v
v=type(20,30)
print v.x,v.y,v.z
sleep
 
If you pop in the third field it is OK
v=type(20,30,10) for instance.
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by SARG »

Good catch. Thank you dodicat.
Again weird that this sort of bug can succesfully passe through a lot of tests.
Memory clearing of 1, 2, 4, 8 bits inside a structure......

Fixed, I'll check the same for memory copy and then a new version to come.
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by SARG »

Hi all,

I ended up getting rid of all the issues (at least under Windows) : this version self compiles twice and no fail with the test suite.

Now the stripall option is on by default (thanks to deltarho for pointing that). For small programs it's interesting : for example 65K --> 22K.

@robert
NOT YET TESTED under Linux that's my next task but as usualy you are welcome to report any issue. Obviously the others too.

Due to an overflow (too many recursive calls in rtl-string module) when compiling FBC the stack size must be set (at least) at 2560K (-t 2560). I think it can be possible reduce it.

http://users.freebasic-portal.de/sarg/fbc64_gas64.zip
The exe for Linux is outdated. New one to come after testing.
deltarho[1859]
Posts: 4310
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by deltarho[1859] »

Thanks, SARG.

I have no issues with my own stuff but one piece of code isn't working and that is UEZ's Fireworks - a window opens and then immediately closes.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by srvaldez »

@SARG thank you :-)
@deltarho[1859] Fireworks runs ok here compiled with the latest fbc64_gas64
deltarho[1859]
Posts: 4310
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by deltarho[1859] »

> @deltarho[1859] Fireworks runs ok here compiled with the latest fbc64_gas64

It is a bit late here - I'll check tomorrow to see what is going on.
Xusinboy Bekchanov
Posts: 789
Joined: Jul 26, 2018 18:28

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by Xusinboy Bekchanov »

It gives me such an error during the launch of my program.

Code: Select all

(gdb) R
Starting program: D:\GitHub\VisualFBEditor/VisualFBEditor64.exe
[New Thread 13888.0x3098]
[New Thread 13888.0x19fc]
[New Thread 13888.0x2174]
[New Thread 13888.0x2040]

Program received signal SIGSEGV, Segmentation fault.
0x0000000000576999 in MY::SYS::COMPONENTMODEL::MARGINSTYPE::MARGINSTYPE() ()
(gdb) bt
#0  0x0000000000576999 in MY::SYS::COMPONENTMODEL::MARGINSTYPE::MARGINSTYPE() ()
#1  0x0000000000576c3e in MY::SYS::COMPONENTMODEL::COMPONENT::COMPONENT() ()
#2  0x0000000000435ce2 in MY::SYS::FORMS::CONTROL::CONTROL() ()
#3  0x000000000049308b in MY::SYS::FORMS::IMAGEBOX::IMAGEBOX() ()
#4  0x000000000049355b in FRMSPLASH::FRMSPLASH() ()
#5  0x00000000005da1d2 in _GLOBAL(int0_t) ()
#6  0x00000000005eeb85 in __do_global_ctors ()
#7  0x00000000004013bb in __tmainCRTStartup ()
#8  0x0000000000000000 in ?? ()
MarginsType has no constructors and look like this:

Code: Select all

Type MarginsType Extends My.Sys.Object
	Declare Function ToString ByRef As WString
	Left         As Integer
	Top          As Integer
	Right        As Integer
	Bottom       As Integer
End Type

Function MarginsType.ToString ByRef As WString
	WLet FTemp, This.Left & "; " & This.Top & "; " & This.Right & "; " & This.Bottom
	Return *FTemp
End Function
robert
Posts: 169
Joined: Aug 06, 2019 18:45

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by robert »

SARG wrote:
@robert
NOT YET TESTED under Linux that's my next task but as usualy you are welcome to report any issue. Obviously the others too.
Hi SARG:

I just finished building three self-compiles of fbc64gas64 from Github FreeBASIC 1.0.8, on Windows 10, using MSYS2 with the FreeBASIC makefile compiling on Nuwen 17.1 (MinGW-64 9.2.0).

100% success !!

Also, unit-tests and log-tests all passed, 0 fails.

Next step, Linux.
robert
Posts: 169
Joined: Aug 06, 2019 18:45

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by robert »

robert wrote:
SARG wrote:
@robert
NOT YET TESTED under Linux that's my next task but as usualy you are welcome to report any issue. Obviously the others too.
Hi SARG:

I just finished building three self-compiles of fbc64gas64 from Github FreeBASIC 1.0.8, on Windows 10, using MSYS2 with the FreeBASIC makefile compiling on Nuwen 17.1 (MinGW-64 9.2.0).

100% success !!

Also, unit-tests and log-tests all passed, 0 fails.

Next step, Linux.
Linux ??? No luck. Segmentation fault immediately on run of first self-compile.
deltarho[1859]
Posts: 4310
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by deltarho[1859] »

UEZ's Fireworks is a problem for gas64. SARG got it working but then it 'crashed' after a while. I ran an exe and that worked for about 20 seconds and then closed. Another run saw an immediate closure.

A tip

If you can put fbc64_gas64.exe in a gcc 8.3 toolchain then you will get the smallest binaries. Sounds 'barmy' but it is true.

Example: dodicat's 'Spring is in the air'

Code: Select all

    binary   nbody test
5.2 157696     15.40
8.3 153088     15.40
8.4 162816     15.42
The nbody test, average of five runs, indicates no performance advantage between toolchains. We get the same performance result comparing gcc generated binaries.

Added: 8.3 is no longer available from the usual source.
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Post by SARG »

Thank you all for your tests and reports.

Bug found by dodicat in thread " Windowtitle not working when using SetProcessDpiAwareness" is fixed. A 'vicious' one ;-)

@robert
Not a surprise as a lot of changes have been done and only few tests.

@deltarho,UEZ
I'm not confortable with the fireworks code so I don't know where begin and put some traces for following the execution....
Could you modify the code to get a shorter case of the problem ? Thanks in advance.

@xusinboy
What version of VisualFbeditor do you use for testing ? 1.24 (github) can't be compiled even with regular fbc.
  • test_bekchanov\VisualFBEditor-1.2.4\src\Main.bas(364) error 24: Invalid data types in 'WAdd CompileWith, " -gen gcc" & IIf(Project->OptimizationLevel > 0, " -Wc -O" & WStr(Project->OptimizationLevel), IIf(Project->OptimizationFastCode, " -Wc -Ofast", IIf(Project->OptimizationSmallCode, " -Wc -Os", "")))'
    test_bekchanov\VisualFBEditor-1.2.4\src\Main.bas(534) warning 36(0): Mismatching parameter initializer, at parameter 6 (SearchText) of SelectSearchResult()
    test_bekchanov\VisualFBEditor-1.2.4\src\Main.bas(1957) error 24: Invalid data types in 'te->Parameters = typ->Name & IIf(POs4 > 0, Mid(bTrim, Pos4), "()")'
    test_bekchanov\VisualFBEditor-1.2.4\src\Main.bas(2178) error 24: Invalid data types in 'te->Parameters = te->Name & IIf(Pos3 > 0, Mid(bTrim, Pos3), "()")'
    test_bekchanov\VisualFBEditor-1.2.4\src\Main.bas(2202) error 24: Invalid data types in 'te->Parameters = te->Name & IIf(Pos3 > 0, Mid(bTrim, Pos3), "()")'
Post Reply