MSVC 32-bit generation bug

Started by MrBcx, June 07, 2024, 08:36:20 AM

Previous topic - Next topic

MrBcx

I stated the following when I uploaded BCX version 8.1.0:

Quote

For reasons I've not uncovered, MSVC-2022 would not compile a functional 32-bit version of Bc.exe today.
All other compilers produced functional 32-bit and 64-bit versions.



I'm pleased to report that I've sorted out the problem.

* I am running the latest MS Visual Studio updates: ver.  17.8

* For many years, I have compiled using the /O2 optimization switch for both 32-bit and 64-bit generation

* I discovered today that removing the /O2 optimization produces a functional 32-bit version of BCX 8.1.0

* When I use the latest version of the Clang compiler with the latest version of the Visual Studio headers and libs,
   the resulting 32-bit version of BCX works as it should.  This suggests to me that the issue lies with Microsoft's current
   32-bit compiler or linker.

* I've removed the /O2 switch from my personal VC32.bat, Vw32.bat, and VD32.bat files. 

   


jbk

I am curious about the 32-bit msvc build of BC, what was wrong with it?
did it crash or produce wrong code?

MrBcx

#2
Quote from: jbk on June 07, 2024, 10:31:35 AM
I am curious about the 32-bit msvc build of BC, what was wrong with it?
did it crash or produce wrong code?

Rebuilding BCX requires 3 compiles.  The first translation requires a correctly functioning version of BC.exe.

The first MSVC 32-bit compile/link would generate a flawed Bc.exe executable which was unable to produce any output.

Full stop.  Dead in the water.  Do not pass go, do not collect $200.

When I removed the /O2 optimization switch, I found my bliss.





morgan

it might be a bug in bcx, that arrised in optimization mode.
you can verify this, by building an optimized bcx with g++

MrBcx

Quote from: morgan on June 09, 2024, 01:29:05 AM
it might be a bug in bcx, that arrised in optimization mode.
you can verify this, by building an optimized bcx with g++

Yes ... I did that days ago. 

Pelles, Embarcadero, Mingw, and Clang all successfully compiled BCX as 32-bit model with optimizations enabled.

I'm still sorting things out.