Sign in Join

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

Mailing lists / fpc-devel / 2024-04

error target i386 -Cp80486

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Tomas Hajny
to Marģers .
Marģers . wrote 7 lines
1) does not work make clean singlezipinstall OS_TARGET=win32 CPU_TARGET=i386 ALLOW_WARNINGS=1 OPT=" -O2 -vxitl -Cp80486 -Op80486" hangs on system.inc(421,2) Start reading includefile C:\Users\Lietotajs\Downloads\fora\a\486\gh\rtl\inc\generic.inc

.
.

Indeed. This is clearly an issue related to optimizations. The important point missing here is that it happens when compiling with ppc1.exe. I just tried building a trunk compiler (make rtl_all compiler_all) with "OPT=-O- -Cp80486 -Op80486" and then started another compilation round with compiler built this way, but using -O2 this time, in order to make sure that it wasn't an optimization bug in the released 3.2.2 compiler. The new compilation round (using a non-optimized compiler) hangs at an exactly the same place, i.e. it's a bug (probably endless loop?) in the optimization code specific to the trunk compiler. @Gareth, could you please have a look at it?

Tomas

Reply by email

J. Gareth Moreton
to Tomas Hajny

Absolutely I can.  I'll see what I can find.

Gareth aka. Kit

Tomas Hajny wrote 27 lines
On 2024-04-23 11:50, Marģers . via fpc-devel wrote: > 1) does not work > make clean singlezipinstall OS_TARGET=win32 CPU_TARGET=i386 > ALLOW_WARNINGS=1 OPT="  -O2 -vxitl -Cp80486 -Op80486" > > hangs on > system.inc(421,2) Start reading includefile > C:\Users\Lietotajs\Downloads\fora\a\486\gh\rtl\inc\generic.inc  .  . Indeed. This is clearly an issue related to optimizations. The important point missing here is that it happens when compiling with ppc1.exe. I just tried building a trunk compiler (make rtl_all compiler_all) with "OPT=-O- -Cp80486 -Op80486" and then started another compilation round with compiler built this way, but using -O2 this time, in order to make sure that it wasn't an optimization bug in the released 3.2.2 compiler. The new compilation round (using a non-optimized compiler) hangs at an exactly the same place, i.e. it's a bug (probably endless loop?) in the optimization code specific to the trunk compiler. @Gareth, could you please have a look at it? Tomas _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

J. Gareth Moreton
to J. Gareth Moreton

I've reproduced the hang doing "make clean all CPU_TARGET=i386 OS_TARGET=win32 OPT="-Cp80486 -Op80486"" on my x86_64-win64 machine.

So far I haven't found the bad commit - this problem has been here a while.

Kit

I still haven't found the bad commit!

J. Gareth Moreton wrote 36 lines
Absolutely I can.  I'll see what I can find. Gareth aka. Kit On 23/04/2024 12:09, Tomas Hajny via fpc-devel wrote: > On 2024-04-23 11:50, Marģers . via fpc-devel wrote: >> 1) does not work >> make clean singlezipinstall OS_TARGET=win32 CPU_TARGET=i386 >> ALLOW_WARNINGS=1 OPT="  -O2 -vxitl -Cp80486 -Op80486" >> >> hangs on >> system.inc(421,2) Start reading includefile >> C:\Users\Lietotajs\Downloads\fora\a\486\gh\rtl\inc\generic.inc >  . >  . > > Indeed. This is clearly an issue related to optimizations. The > important point missing here is that it happens when compiling with > ppc1.exe. I just tried building a trunk compiler (make rtl_all > compiler_all) with "OPT=-O- -Cp80486 -Op80486" and then started > another compilation round with compiler built this way, but using -O2 > this time, in order to make sure that it wasn't an optimization bug > in the released 3.2.2 compiler. The new compilation round (using a > non-optimized compiler) hangs at an exactly the same place, i.e. it's > a bug (probably endless loop?) in the optimization code specific to > the trunk compiler. @Gareth, could you please have a look at it? > > Tomas > _______________________________________________ > fpc-devel maillist  -  > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel > _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

J. Gareth Moreton
to J. Gareth Moreton

I've gotten back as far as here, and it's still bad:

commit 7fbda0e0e8b1d071e72ccbc5e487dbb1c2173c63 (HEAD) Author: Jonas Maebe
Date:   Wed Mar 24 14:33:09 2021 +0000

      * support building with FPC 3.2.2

    git-svn-id: -

I can't check earlier without difficulty because 3.2.2 doesn't work.  However the hang (and also an eventual out of memory error) doesn't occur if -OoNOPEEPHOLE is specified, meaning the problem is located in the peephole optimizer.  So it looks like I'll have to try to debug this the hard way!

Kit

J. Gareth Moreton wrote 52 lines
I've reproduced the hang doing "make clean all CPU_TARGET=i386 OS_TARGET=win32 OPT="-Cp80486 -Op80486"" on my x86_64-win64 machine. So far I haven't found the bad commit - this problem has been here a while. Kit I still haven't found the bad commit! On 23/04/2024 12:46, J. Gareth Moreton via fpc-devel wrote: > Absolutely I can.  I'll see what I can find. > > Gareth aka. Kit > > On 23/04/2024 12:09, Tomas Hajny via fpc-devel wrote: >> On 2024-04-23 11:50, Marģers . via fpc-devel wrote: >>> 1) does not work >>> make clean singlezipinstall OS_TARGET=win32 CPU_TARGET=i386 >>> ALLOW_WARNINGS=1 OPT="  -O2 -vxitl -Cp80486 -Op80486" >>> >>> hangs on >>> system.inc(421,2) Start reading includefile >>> C:\Users\Lietotajs\Downloads\fora\a\486\gh\rtl\inc\generic.inc >>  . >>  . >> >> Indeed. This is clearly an issue related to optimizations. The >> important point missing here is that it happens when compiling with >> ppc1.exe. I just tried building a trunk compiler (make rtl_all >> compiler_all) with "OPT=-O- -Cp80486 -Op80486" and then started >> another compilation round with compiler built this way, but using >> -O2 this time, in order to make sure that it wasn't an optimization >> bug in the released 3.2.2 compiler. The new compilation round (using >> a non-optimized compiler) hangs at an exactly the same place, i.e. >> it's a bug (probably endless loop?) in the optimization code >> specific to the trunk compiler. @Gareth, could you please have a >> look at it? >> >> Tomas >> _______________________________________________ >> fpc-devel maillist  -  >> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel >> > _______________________________________________ > fpc-devel maillist  -  > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel > _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

J. Gareth Moreton
to J. Gareth Moreton

Got it!  I would have solved this much sooner if I had just dived into the code instead of getting lost with git bisect!

https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/655

It was an infinite loop in the "var13", "var14" and "var15" optimisations that don't trigger on the Pentium II (default option) and later.  They set the Result to True even if no changes were actually made and caused the compiler to check for the same optimisation over and over again without progressing.

Kit

P.S. Admittedly those optimisations could use some maintenance since I shouldn't need to set the operand sizes, but I'll save that for another day.

J. Gareth Moreton wrote 75 lines
I've gotten back as far as here, and it's still bad: commit 7fbda0e0e8b1d071e72ccbc5e487dbb1c2173c63 (HEAD) Author: Jonas Maebe Date:   Wed Mar 24 14:33:09 2021 +0000       * support building with FPC 3.2.2     git-svn-id: - I can't check earlier without difficulty because 3.2.2 doesn't work.  However the hang (and also an eventual out of memory error) doesn't occur if -OoNOPEEPHOLE is specified, meaning the problem is located in the peephole optimizer.  So it looks like I'll have to try to debug this the hard way! Kit On 23/04/2024 17:27, J. Gareth Moreton via fpc-devel wrote: > I've reproduced the hang doing "make clean all CPU_TARGET=i386 > OS_TARGET=win32 OPT="-Cp80486 -Op80486"" on my x86_64-win64 machine. > > So far I haven't found the bad commit - this problem has been here a > while. > > Kit > > I still haven't found the bad commit! > > On 23/04/2024 12:46, J. Gareth Moreton via fpc-devel wrote: >> Absolutely I can.  I'll see what I can find. >> >> Gareth aka. Kit >> >> On 23/04/2024 12:09, Tomas Hajny via fpc-devel wrote: >>> On 2024-04-23 11:50, Marģers . via fpc-devel wrote: >>>> 1) does not work >>>> make clean singlezipinstall OS_TARGET=win32 CPU_TARGET=i386 >>>> ALLOW_WARNINGS=1 OPT="  -O2 -vxitl -Cp80486 -Op80486" >>>> >>>> hangs on >>>> system.inc(421,2) Start reading includefile >>>> C:\Users\Lietotajs\Downloads\fora\a\486\gh\rtl\inc\generic.inc >>>  . >>>  . >>> >>> Indeed. This is clearly an issue related to optimizations. The >>> important point missing here is that it happens when compiling with >>> ppc1.exe. I just tried building a trunk compiler (make rtl_all >>> compiler_all) with "OPT=-O- -Cp80486 -Op80486" and then started >>> another compilation round with compiler built this way, but using >>> -O2 this time, in order to make sure that it wasn't an optimization >>> bug in the released 3.2.2 compiler. The new compilation round >>> (using a non-optimized compiler) hangs at an exactly the same >>> place, i.e. it's a bug (probably endless loop?) in the optimization >>> code specific to the trunk compiler. @Gareth, could you please have >>> a look at it? >>> >>> Tomas >>> _______________________________________________ >>> fpc-devel maillist  -  >>> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel >>> >> _______________________________________________ >> fpc-devel maillist  -  >> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel >> > _______________________________________________ > fpc-devel maillist  -  > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel > _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email