Re: [fpc-devel] 68k question

2020-12-21 Thread J. Gareth Moreton via fpc-devel

Hi Karoly,

Don't worry, I know I don't need a disassembler.  It's more to build the 
cross compiler on an x86_64 machine and compare the assembly sources 
with -a as you mention, since an internal error gers generated for some 
reason via one of my new optimisations.


Gareth aka. Kit

On 21/12/2020 23:18, Karoly Balogh (Charlie/SGR) wrote:

Hi,

On Mon, 21 Dec 2020, J. Gareth Moreton via fpc-devel wrote:


That should be fine - thanks Marcus.  I need to reproduce the internal
error that's being reported, and so I can compare the disassembly of
ppcross68k to see where my optimisation is going wrong.

To bould any cross compiler, you don't even need the assembler for that
particular platform, and you don't need to disassemble, you can just ask
the compiler to generate an assembly source for you instead.

Here's how I'd build in this case:

make crossall CPU_TARGET=m68k OS_TARGET=amiga OPT="-al" CROSSOPT="-al -sh"

The OPT="-al" part will make sure that an external assembler is used to
generate the crosscompiler assembly sources, and the compiler source lines
are intermixed as comments with the generated assembly. Then resulting
files will be placed in compiler/m68k/units/*.s

The code for the particular IE you're looking for will be in
compiler/m68k/units/cgcpu.s, but of course it's possible the wrong code is
not there, but somewhere where this function is called from, or in
optimize_op_const() which is called right before that IE occurs.

You'll probably need Windows binutils to compile the compiler like this,
because the use of the internal assembler is omitted. But I find this much
more useful than digging into disassemblies...

Then CROSSOPT="-al -sh"  is for triggering the crosscompiler part, "-al"
will make sure again, that assembly sources are generated, and "-sh" will
skip the assembling (and potentially linking, but that's not used for this
particular build) for the target platform, which means you won't need any
external utilities for the target platform. The generated m68k assembly
files will be in rtl/units/m68k-amiga, and in the respective packages
directories.

Cheers,
--
Charlie


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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


Re: [fpc-devel] 68k question

2020-12-21 Thread Karoly Balogh (Charlie/SGR) via fpc-devel
Hi,

On Mon, 21 Dec 2020, J. Gareth Moreton via fpc-devel wrote:

> That should be fine - thanks Marcus.  I need to reproduce the internal
> error that's being reported, and so I can compare the disassembly of
> ppcross68k to see where my optimisation is going wrong.

To bould any cross compiler, you don't even need the assembler for that
particular platform, and you don't need to disassemble, you can just ask
the compiler to generate an assembly source for you instead.

Here's how I'd build in this case:

make crossall CPU_TARGET=m68k OS_TARGET=amiga OPT="-al" CROSSOPT="-al -sh"

The OPT="-al" part will make sure that an external assembler is used to
generate the crosscompiler assembly sources, and the compiler source lines
are intermixed as comments with the generated assembly. Then resulting
files will be placed in compiler/m68k/units/*.s

The code for the particular IE you're looking for will be in
compiler/m68k/units/cgcpu.s, but of course it's possible the wrong code is
not there, but somewhere where this function is called from, or in
optimize_op_const() which is called right before that IE occurs.

You'll probably need Windows binutils to compile the compiler like this,
because the use of the internal assembler is omitted. But I find this much
more useful than digging into disassemblies...

Then CROSSOPT="-al -sh"  is for triggering the crosscompiler part, "-al"
will make sure again, that assembly sources are generated, and "-sh" will
skip the assembling (and potentially linking, but that's not used for this
particular build) for the target platform, which means you won't need any
external utilities for the target platform. The generated m68k assembly
files will be in rtl/units/m68k-amiga, and in the respective packages
directories.

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


Re: [fpc-devel] 68k question

2020-12-21 Thread Marcus Sackrow via fpc-devel

maybe you need this:

http://build.alb42.de/fpcbinint/VasmVlinkForFPCLinuxx64.tar.gz

;)


Am 21.12.20 um 21:13 schrieb J. Gareth Moreton via fpc-devel:


I'll try my Ubuntu virtual machine first and get back to you. I'll get
to the bottom of this!

Gareth aka. Kit

On 21/12/2020 20:01, Marcus Sackrow via fpc-devel wrote:

Hi,

I have a docker container with Lazarus/fpc3.2 and these vlink/vasm
installed if it would help?

Greetings,
Marcus

Am 21.12.20 um 20:54 schrieb J. Gareth Moreton via fpc-devel:


No, I'm using 3.2.0 as well.  It might be that it only shows up if
you cross-build from Linux.  I'll keep investigating.

Gareth aka. Kit

On 21/12/2020 19:50, Marcus Sackrow via fpc-devel wrote:

Hi,

no, nothing special the server just do a

make distclean
make distclean
echo '## start AMIGA making 68020'
make zipinstall PACKDIR=/tmp/jenkins-FPC_m68k-amiga-6948 OS_TARGET=amiga 
CPU_TARGET=m68k 'CROSSOPT=-Avasm -XV -Cp68020'

but the CPU options should do no difference because atari is
compiled for 68000 and shows the same error

maybe the starting compiler is different?

the build server uses 3.2.0 as starting compiler

Greetings,
Marcus


Am 21.12.20 um 20:32 schrieb J. Gareth Moreton via fpc-devel:

So far under Windows, it compiled successfully:

make crossinstall CPU_TARGET=m68k OS_TARGET=amiga CROSSOPT="-Avasm
-XV"
CROSSBINDIR=C:\Users\garet\Documents\programming\fpc\VasmVLinkforFPCWin32

Is there anything particular that I need to do?

Gareth aka. Kit

On 21/12/2020 18:44, Marcus Sackrow via fpc-devel wrote:

Hi Gareth,

btw it was catched by the build server

http://build.alb42.de:8080/job/FPC_m68k-amiga/6948/console
http://build.alb42.de:8080/job/FPC_m68k-atari/6659/console
http://build.alb42.de:8080/job/FPC_m68k-linux/6941/console


you can see if you get the same error message

Good luck.

Am 21.12.20 um 19:40 schrieb J. Gareth Moreton via fpc-devel:

That should be fine - thanks Marcus.  I need to reproduce the
internal
error that's being reported, and so I can compare the
disassembly of
ppcross68k to see where my optimisation is going wrong.

Gareth aka. Kit

On 21/12/2020 18:29, Marcus Sackrow via fpc-devel wrote:

Hi Graeth,

Am 21.12.20 um 19:01 schrieb J. Gareth Moreton via fpc-devel:

I need to fix a bug with one of my optimisations that causes
ppcross68k to raise an internal error.  What target platform
should I
specify (cross-building from x86_64-win64)?



for example your could compile for m68k-amiga with


make crossall OS_TARGET=amiga CPU_TARGET=m68k CROSSOPT="-Avasm
-XV"


you will need vasm and vlink (assembler and linker) I created
them once
already

you can download them here

http://build.alb42.de/fpcbinint/VasmVLinkforFPCWin32.zip


is that what you mean?


Greetings,

Marcus



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


Re: [fpc-devel] 68k question

2020-12-21 Thread J. Gareth Moreton via fpc-devel
I'll try my Ubuntu virtual machine first and get back to you. I'll get 
to the bottom of this!


Gareth aka. Kit

On 21/12/2020 20:01, Marcus Sackrow via fpc-devel wrote:

Hi,

I have a docker container with Lazarus/fpc3.2 and these vlink/vasm 
installed if it would help?


Greetings,
Marcus

Am 21.12.20 um 20:54 schrieb J. Gareth Moreton via fpc-devel:


No, I'm using 3.2.0 as well.  It might be that it only shows up if 
you cross-build from Linux.  I'll keep investigating.


Gareth aka. Kit

On 21/12/2020 19:50, Marcus Sackrow via fpc-devel wrote:

Hi,

no, nothing special the server just do a

make distclean
make distclean
echo '## start AMIGA making 68020'
make zipinstall PACKDIR=/tmp/jenkins-FPC_m68k-amiga-6948 OS_TARGET=amiga 
CPU_TARGET=m68k 'CROSSOPT=-Avasm -XV -Cp68020'

but the CPU options should do no difference because atari is 
compiled for 68000 and shows the same error


maybe the starting compiler is different?

the build server uses 3.2.0 as starting compiler

Greetings,
Marcus


Am 21.12.20 um 20:32 schrieb J. Gareth Moreton via fpc-devel:

So far under Windows, it compiled successfully:

make crossinstall CPU_TARGET=m68k OS_TARGET=amiga CROSSOPT="-Avasm 
-XV" 
CROSSBINDIR=C:\Users\garet\Documents\programming\fpc\VasmVLinkforFPCWin32


Is there anything particular that I need to do?

Gareth aka. Kit

On 21/12/2020 18:44, Marcus Sackrow via fpc-devel wrote:

Hi Gareth,

btw it was catched by the build server

http://build.alb42.de:8080/job/FPC_m68k-amiga/6948/console
http://build.alb42.de:8080/job/FPC_m68k-atari/6659/console
http://build.alb42.de:8080/job/FPC_m68k-linux/6941/console


you can see if you get the same error message

Good luck.

Am 21.12.20 um 19:40 schrieb J. Gareth Moreton via fpc-devel:
That should be fine - thanks Marcus.  I need to reproduce the 
internal

error that's being reported, and so I can compare the disassembly of
ppcross68k to see where my optimisation is going wrong.

Gareth aka. Kit

On 21/12/2020 18:29, Marcus Sackrow via fpc-devel wrote:

Hi Graeth,

Am 21.12.20 um 19:01 schrieb J. Gareth Moreton via fpc-devel:

I need to fix a bug with one of my optimisations that causes
ppcross68k to raise an internal error.  What target platform 
should I

specify (cross-building from x86_64-win64)?



for example your could compile for m68k-amiga with


make crossall OS_TARGET=amiga CPU_TARGET=m68k CROSSOPT="-Avasm -XV"


you will need vasm and vlink (assembler and linker) I created 
them once

already

you can download them here

http://build.alb42.de/fpcbinint/VasmVLinkforFPCWin32.zip


is that what you mean?


Greetings,

Marcus


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





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






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


 
	Virus-free. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

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




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



--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] 68k question

2020-12-21 Thread Marcus Sackrow via fpc-devel

Hi,

I have a docker container with Lazarus/fpc3.2 and these vlink/vasm
installed if it would help?

Greetings,
Marcus

Am 21.12.20 um 20:54 schrieb J. Gareth Moreton via fpc-devel:


No, I'm using 3.2.0 as well.  It might be that it only shows up if you
cross-build from Linux.  I'll keep investigating.

Gareth aka. Kit

On 21/12/2020 19:50, Marcus Sackrow via fpc-devel wrote:

Hi,

no, nothing special the server just do a

make distclean
make distclean
echo '## start AMIGA making 68020'
make zipinstall PACKDIR=/tmp/jenkins-FPC_m68k-amiga-6948 OS_TARGET=amiga 
CPU_TARGET=m68k 'CROSSOPT=-Avasm -XV -Cp68020'

but the CPU options should do no difference because atari is compiled
for 68000 and shows the same error

maybe the starting compiler is different?

the build server uses 3.2.0 as starting compiler

Greetings,
Marcus


Am 21.12.20 um 20:32 schrieb J. Gareth Moreton via fpc-devel:

So far under Windows, it compiled successfully:

make crossinstall CPU_TARGET=m68k OS_TARGET=amiga CROSSOPT="-Avasm
-XV"
CROSSBINDIR=C:\Users\garet\Documents\programming\fpc\VasmVLinkforFPCWin32

Is there anything particular that I need to do?

Gareth aka. Kit

On 21/12/2020 18:44, Marcus Sackrow via fpc-devel wrote:

Hi Gareth,

btw it was catched by the build server

http://build.alb42.de:8080/job/FPC_m68k-amiga/6948/console
http://build.alb42.de:8080/job/FPC_m68k-atari/6659/console
http://build.alb42.de:8080/job/FPC_m68k-linux/6941/console


you can see if you get the same error message

Good luck.

Am 21.12.20 um 19:40 schrieb J. Gareth Moreton via fpc-devel:

That should be fine - thanks Marcus.  I need to reproduce the
internal
error that's being reported, and so I can compare the disassembly of
ppcross68k to see where my optimisation is going wrong.

Gareth aka. Kit

On 21/12/2020 18:29, Marcus Sackrow via fpc-devel wrote:

Hi Graeth,

Am 21.12.20 um 19:01 schrieb J. Gareth Moreton via fpc-devel:

I need to fix a bug with one of my optimisations that causes
ppcross68k to raise an internal error.  What target platform
should I
specify (cross-building from x86_64-win64)?



for example your could compile for m68k-amiga with


make crossall OS_TARGET=amiga CPU_TARGET=m68k CROSSOPT="-Avasm -XV"


you will need vasm and vlink (assembler and linker) I created
them once
already

you can download them here

http://build.alb42.de/fpcbinint/VasmVLinkforFPCWin32.zip


is that what you mean?


Greetings,

Marcus


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





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






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



Virus-free. www.avast.com



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

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



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


Re: [fpc-devel] 68k question

2020-12-21 Thread J. Gareth Moreton via fpc-devel
No, I'm using 3.2.0 as well.  It might be that it only shows up if you 
cross-build from Linux.  I'll keep investigating.


Gareth aka. Kit

On 21/12/2020 19:50, Marcus Sackrow via fpc-devel wrote:

Hi,

no, nothing special the server just do a

make distclean
make distclean
echo '## start AMIGA making 68020'
make zipinstall PACKDIR=/tmp/jenkins-FPC_m68k-amiga-6948 OS_TARGET=amiga 
CPU_TARGET=m68k 'CROSSOPT=-Avasm -XV -Cp68020'

but the CPU options should do no difference because atari is compiled 
for 68000 and shows the same error


maybe the starting compiler is different?

the build server uses 3.2.0 as starting compiler

Greetings,
Marcus


Am 21.12.20 um 20:32 schrieb J. Gareth Moreton via fpc-devel:

So far under Windows, it compiled successfully:

make crossinstall CPU_TARGET=m68k OS_TARGET=amiga CROSSOPT="-Avasm 
-XV" 
CROSSBINDIR=C:\Users\garet\Documents\programming\fpc\VasmVLinkforFPCWin32


Is there anything particular that I need to do?

Gareth aka. Kit

On 21/12/2020 18:44, Marcus Sackrow via fpc-devel wrote:

Hi Gareth,

btw it was catched by the build server

http://build.alb42.de:8080/job/FPC_m68k-amiga/6948/console
http://build.alb42.de:8080/job/FPC_m68k-atari/6659/console
http://build.alb42.de:8080/job/FPC_m68k-linux/6941/console


you can see if you get the same error message

Good luck.

Am 21.12.20 um 19:40 schrieb J. Gareth Moreton via fpc-devel:

That should be fine - thanks Marcus. I need to reproduce the internal
error that's being reported, and so I can compare the disassembly of
ppcross68k to see where my optimisation is going wrong.

Gareth aka. Kit

On 21/12/2020 18:29, Marcus Sackrow via fpc-devel wrote:

Hi Graeth,

Am 21.12.20 um 19:01 schrieb J. Gareth Moreton via fpc-devel:

I need to fix a bug with one of my optimisations that causes
ppcross68k to raise an internal error.  What target platform 
should I

specify (cross-building from x86_64-win64)?



for example your could compile for m68k-amiga with


make crossall OS_TARGET=amiga CPU_TARGET=m68k CROSSOPT="-Avasm -XV"


you will need vasm and vlink (assembler and linker) I created them 
once

already

you can download them here

http://build.alb42.de/fpcbinint/VasmVLinkforFPCWin32.zip


is that what you mean?


Greetings,

Marcus


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





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






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



--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] 68k question

2020-12-21 Thread Marcus Sackrow via fpc-devel

Hi,

no, nothing special the server just do a

make distclean
make distclean
echo '## start AMIGA making 68020'
make zipinstall PACKDIR=/tmp/jenkins-FPC_m68k-amiga-6948 OS_TARGET=amiga 
CPU_TARGET=m68k 'CROSSOPT=-Avasm -XV -Cp68020'


but the CPU options should do no difference because atari is compiled
for 68000 and shows the same error

maybe the starting compiler is different?

the build server uses 3.2.0 as starting compiler

Greetings,
Marcus


Am 21.12.20 um 20:32 schrieb J. Gareth Moreton via fpc-devel:

So far under Windows, it compiled successfully:

make crossinstall CPU_TARGET=m68k OS_TARGET=amiga CROSSOPT="-Avasm
-XV"
CROSSBINDIR=C:\Users\garet\Documents\programming\fpc\VasmVLinkforFPCWin32

Is there anything particular that I need to do?

Gareth aka. Kit

On 21/12/2020 18:44, Marcus Sackrow via fpc-devel wrote:

Hi Gareth,

btw it was catched by the build server

http://build.alb42.de:8080/job/FPC_m68k-amiga/6948/console
http://build.alb42.de:8080/job/FPC_m68k-atari/6659/console
http://build.alb42.de:8080/job/FPC_m68k-linux/6941/console


you can see if you get the same error message

Good luck.

Am 21.12.20 um 19:40 schrieb J. Gareth Moreton via fpc-devel:

That should be fine - thanks Marcus.  I need to reproduce the internal
error that's being reported, and so I can compare the disassembly of
ppcross68k to see where my optimisation is going wrong.

Gareth aka. Kit

On 21/12/2020 18:29, Marcus Sackrow via fpc-devel wrote:

Hi Graeth,

Am 21.12.20 um 19:01 schrieb J. Gareth Moreton via fpc-devel:

I need to fix a bug with one of my optimisations that causes
ppcross68k to raise an internal error.  What target platform should I
specify (cross-building from x86_64-win64)?



for example your could compile for m68k-amiga with


make crossall OS_TARGET=amiga CPU_TARGET=m68k CROSSOPT="-Avasm -XV"


you will need vasm and vlink (assembler and linker) I created them
once
already

you can download them here

http://build.alb42.de/fpcbinint/VasmVLinkforFPCWin32.zip


is that what you mean?


Greetings,

Marcus


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





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





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


Re: [fpc-devel] 68k question

2020-12-21 Thread J. Gareth Moreton via fpc-devel

So far under Windows, it compiled successfully:

make crossinstall CPU_TARGET=m68k OS_TARGET=amiga CROSSOPT="-Avasm -XV" 
CROSSBINDIR=C:\Users\garet\Documents\programming\fpc\VasmVLinkforFPCWin32


Is there anything particular that I need to do?

Gareth aka. Kit

On 21/12/2020 18:44, Marcus Sackrow via fpc-devel wrote:

Hi Gareth,

btw it was catched by the build server

http://build.alb42.de:8080/job/FPC_m68k-amiga/6948/console
http://build.alb42.de:8080/job/FPC_m68k-atari/6659/console
http://build.alb42.de:8080/job/FPC_m68k-linux/6941/console


you can see if you get the same error message

Good luck.

Am 21.12.20 um 19:40 schrieb J. Gareth Moreton via fpc-devel:

That should be fine - thanks Marcus.  I need to reproduce the internal
error that's being reported, and so I can compare the disassembly of
ppcross68k to see where my optimisation is going wrong.

Gareth aka. Kit

On 21/12/2020 18:29, Marcus Sackrow via fpc-devel wrote:

Hi Graeth,

Am 21.12.20 um 19:01 schrieb J. Gareth Moreton via fpc-devel:

I need to fix a bug with one of my optimisations that causes
ppcross68k to raise an internal error.  What target platform should I
specify (cross-building from x86_64-win64)?



for example your could compile for m68k-amiga with


make crossall OS_TARGET=amiga CPU_TARGET=m68k CROSSOPT="-Avasm -XV"


you will need vasm and vlink (assembler and linker) I created them once
already

you can download them here

http://build.alb42.de/fpcbinint/VasmVLinkforFPCWin32.zip


is that what you mean?


Greetings,

Marcus


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





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



--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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


Re: [fpc-devel] 68k question

2020-12-21 Thread Marcus Sackrow via fpc-devel

Hi Gareth,

btw it was catched by the build server

http://build.alb42.de:8080/job/FPC_m68k-amiga/6948/console
http://build.alb42.de:8080/job/FPC_m68k-atari/6659/console
http://build.alb42.de:8080/job/FPC_m68k-linux/6941/console


you can see if you get the same error message

Good luck.

Am 21.12.20 um 19:40 schrieb J. Gareth Moreton via fpc-devel:

That should be fine - thanks Marcus.  I need to reproduce the internal
error that's being reported, and so I can compare the disassembly of
ppcross68k to see where my optimisation is going wrong.

Gareth aka. Kit

On 21/12/2020 18:29, Marcus Sackrow via fpc-devel wrote:

Hi Graeth,

Am 21.12.20 um 19:01 schrieb J. Gareth Moreton via fpc-devel:

I need to fix a bug with one of my optimisations that causes
ppcross68k to raise an internal error.  What target platform should I
specify (cross-building from x86_64-win64)?



for example your could compile for m68k-amiga with


make crossall OS_TARGET=amiga CPU_TARGET=m68k CROSSOPT="-Avasm -XV"


you will need vasm and vlink (assembler and linker) I created them once
already

you can download them here

http://build.alb42.de/fpcbinint/VasmVLinkforFPCWin32.zip


is that what you mean?


Greetings,

Marcus


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





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


Re: [fpc-devel] 68k question

2020-12-21 Thread J. Gareth Moreton via fpc-devel
That should be fine - thanks Marcus.  I need to reproduce the internal 
error that's being reported, and so I can compare the disassembly of 
ppcross68k to see where my optimisation is going wrong.


Gareth aka. Kit

On 21/12/2020 18:29, Marcus Sackrow via fpc-devel wrote:

Hi Graeth,

Am 21.12.20 um 19:01 schrieb J. Gareth Moreton via fpc-devel:

I need to fix a bug with one of my optimisations that causes
ppcross68k to raise an internal error.  What target platform should I
specify (cross-building from x86_64-win64)?



for example your could compile for m68k-amiga with


make crossall OS_TARGET=amiga CPU_TARGET=m68k CROSSOPT="-Avasm -XV"


you will need vasm and vlink (assembler and linker) I created them once
already

you can download them here

http://build.alb42.de/fpcbinint/VasmVLinkforFPCWin32.zip


is that what you mean?


Greetings,

Marcus


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



--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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


Re: [fpc-devel] 68k question

2020-12-21 Thread Marcus Sackrow via fpc-devel

Hi Graeth,

Am 21.12.20 um 19:01 schrieb J. Gareth Moreton via fpc-devel:

I need to fix a bug with one of my optimisations that causes
ppcross68k to raise an internal error.  What target platform should I
specify (cross-building from x86_64-win64)?



for example your could compile for m68k-amiga with


make crossall OS_TARGET=amiga CPU_TARGET=m68k CROSSOPT="-Avasm -XV"


you will need vasm and vlink (assembler and linker) I created them once
already

you can download them here

http://build.alb42.de/fpcbinint/VasmVLinkforFPCWin32.zip


is that what you mean?


Greetings,

Marcus


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


[fpc-devel] 68k question

2020-12-21 Thread J. Gareth Moreton via fpc-devel

Hi everyone,

I need to fix a bug with one of my optimisations that causes ppcross68k 
to raise an internal error.  What target platform should I specify 
(cross-building from x86_64-win64)?


Gareth aka. Kit


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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


Re: [fpc-devel] Local classes and interfaces

2020-12-21 Thread Blaise--- via fpc-devel

On 19.12.2020 16:51, Sven Barth wrote:

Considering that it's only intended for internal use, yes I'm aboard with that.


Here is the first change: http://hg.blaise.ru/public/fpc/rev/7c78bfdaed9a 
(attached).

Strictly speaking, some local classes and interfaces can be compiled without 
that -- the ICE 200204175 only occurs when they have their own entities such as 
nested classes (not used for Closures) and non-abstract methods:
---8<---
function Foo: TClass;
type Local = class
type Nested = class end;
procedure Method;
end;
procedure Local.Method;
begin
end;
begin
result := Local
end;

begin
Foo
end.
---8<---

To observe the effect, one could temporarily use the second attached patch to 
force FPC to compile the above test case. The following internal names are 
generated for it:
VMT_$P$PROGRAM$_$FOO_$$_LOCAL // no change
VMT_$P$PROGRAM$_$FOO_$LOCAL_$__$$_NESTED // was: ICE
P$PROGRAM$_$FOO_$LOCAL_$__$$_METHOD // was: ICE
Please check that such names are in line with the intended format.


I'd say in this case the bug is that the declaration of those two Cls<> types 
is allowed.


Looking at the excerpt from object_dec:

{ objects and class types can't be declared local }
if not(symtablestack.top.symtabletype in 
[globalsymtable,staticsymtable,objectsymtable,recordsymtable]) and
   not assigned(genericlist) then
  Message(parser_e_no_local_objects);

"assigned(genericlist)" seems intentional. Maybe, it misses a check for generic 
instantiation; however:


If I remember correctly *specializations* are already placed in the more nested 
scope if they use local types.


Judging solely by the internal names, that is not what happens.


or at least that was the plan


If you were to implement that, you would encounter the same ICE.

--
βþ
# HG changeset patch
# User Blaise.ru
+ make_mangledname: allow for local classes & interfaces

diff -r 7b102c2fd615 -r 4990da1ff00c symdef.pas
--- a/symdef.pas
+++ b/symdef.pas
@@ -1535,36 +1535,42 @@
 prefix:='';
 if not assigned(st) then
  internalerror(200204212);
-{ sub procedures }
-while (st.symtabletype in [localsymtable,parasymtable]) do
- begin
-   if st.defowner.typ<>procdef then
-internalerror(200204173);
-   { Add the full mangledname of procedure to prevent
- conflicts with 2 overloads having both a nested procedure
- with the same name, see tb0314 (PFV) }
-   s:=tprocdef(st.defowner).procsym.name;
-   s:=s+tprocdef(st.defowner).mangledprocparanames(Length(s));
-   if prefix<>'' then
- prefix:=s+'_'+prefix
-   else
- prefix:=s;
-   if length(prefix)>100 then
- begin
-   crc:=0;
-   crc:=UpdateCrc32(crc,prefix[1],length(prefix));
-   prefix:='$CRC'+hexstr(crc,8);
- end;
-   st:=st.defowner.owner;
- end;
-{ object/classes symtable, nested type definitions in classes require 
the while loop }
-while st.symtabletype in [ObjectSymtable,recordsymtable] do
- begin
-   if not (st.defowner.typ in [objectdef,recorddef]) then
-internalerror(200204174);
-   prefix:=tabstractrecorddef(st.defowner).objname^+'_$_'+prefix;
-   st:=st.defowner.owner;
- end;
+repeat
+  { sub procedures }
+  while (st.symtabletype in [localsymtable,parasymtable]) do
+   begin
+ if st.defowner.typ<>procdef then
+  internalerror(200204173);
+ { Add the full mangledname of the routine to prevent
+   conflicts with two overloads both having a local entity
+   -- routine (tb0314), class, interface -- with the same name }
+ s:=tprocdef(st.defowner).procsym.name;
+ s:=s+tprocdef(st.defowner).mangledprocparanames(Length(s));
+ if prefix<>'' then
+   prefix:=s+'_'+prefix
+ else
+   prefix:=s;
+ if length(prefix)>100 then
+   begin
+ crc:=0;
+ crc:=UpdateCrc32(crc,prefix[1],length(prefix));
+ prefix:='$CRC'+hexstr(crc,8);
+   end;
+ st:=st.defowner.owner;
+   end;
+  { object/classes symtable, nested type definitions in classes 
require the while loop }
+  while st.symtabletype in [ObjectSymtable,recordsymtable] do
+   begin
+ if not (st.defowner.typ in [objectdef,recorddef]) then
+  internalerror(200204174);
+ prefix:=tabstractrecorddef(st.defowner).objname^+'_$_'+prefix;
+ st:=st.defowner.owner;
+   end;
+  { local classes & interfaces are possible (because of closures) }
+  if st.symtabletype<>localsymtable