Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Issues: 32-Bit Windows w/SSE2 active #2936

Closed
Tafoid opened this issue Dec 14, 2017 · 6 comments
Closed

Compile Issues: 32-Bit Windows w/SSE2 active #2936

Tafoid opened this issue Dec 14, 2017 · 6 comments

Comments

@Tafoid
Copy link
Contributor

Tafoid commented Dec 14, 2017

Using:
make -j9 -k OPTIMIZE=3 SYMBOLS=1 SYMLEVEL=1 STRIP_SYMBOLS=1 PTR64=0 NOWERROR=1 ARCHOPTS="-msse2 -mfpmath=sse"

Results:
GCC 7.2.0 detected
Compiling 3rdparty/sqlite3/sqlite3.c...
Compiling src/devices/cpu/saturn/saturn.cpp...
In function 'vdbePmaReadBlob.part.308',
inlined from 'vdbePmaReadBlob',
inlined from 'vdbePmaReadVarint.part.309' at ../../../../../3rdparty/sqlite3/sqlite3.c:85435:12,
inlined from 'vdbePmaReadVarint',
inlined from 'vdbePmaReaderNext' at ../../../../../3rdparty/sqlite3/sqlite3.c:85546:8:
../../../../../3rdparty/sqlite3/sqlite3.c:85392:5: error: 'memcpy': specified size between 2147483648 and 4294967295 exceeds maximum object size 2147483647 [-Werror=stringop-overflow=]
memcpy(p->aAlloc, &p->aBuffer[iBuf], nAvail);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'vdbePmaReadBlob.part.308',
inlined from 'vdbePmaReadBlob',
inlined from 'vdbePmaReadVarint.part.309' at ../../../../../3rdparty/sqlite3/sqlite3.c:85435:12,
inlined from 'vdbePmaReadVarint',
inlined from 'vdbePmaReaderInit.constprop' at ../../../../../3rdparty/sqlite3/sqlite3.c:85583:8,
inlined from 'vdbeMergeEngineLevel0' at ../../../../../3rdparty/sqlite3/sqlite3.c:87159:8:
../../../../../3rdparty/sqlite3/sqlite3.c:85392:5: error: 'memcpy': specified size between 2147483648 and 4294967295 exceeds maximum object size 2147483647 [-Werror=stringop-overflow=]
memcpy(p->aAlloc, &p->aBuffer[iBuf], nAvail);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../../../src/devices/cpu/saturn/saturn.cpp:84:0:
../../../../../src/devices/cpu/saturn/satops.hxx: In member function 'void saturn_device::saturn_exchange(int, int, int, int)':
../../../../../src/devices/cpu/saturn/satops.hxx:806:6: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
void saturn_device::saturn_exchange(int left, int begin, int count, int right)
^~~~~~~~~~~~~
../../../../../src/devices/cpu/saturn/satops.hxx:806:6: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
../../../../../src/devices/cpu/saturn/satops.hxx: In member function 'void saturn_device::saturn_copy(int, int, int, int)':
../../../../../src/devices/cpu/saturn/satops.hxx:824:6: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
void saturn_device::saturn_copy(int dest, int begin, int count, int src)
^~~~~~~~~~~~~
../../../../../src/devices/cpu/saturn/satops.hxx:824:6: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
../../../../../src/devices/cpu/saturn/satops.hxx: In member function 'void saturn_device::saturn_or(int, int, int, int)':
../../../../../src/devices/cpu/saturn/satops.hxx:1040:6: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
void saturn_device::saturn_or(int dest, int begin, int count, int src)
^~~~~~~~~~~~~
../../../../../src/devices/cpu/saturn/satops.hxx:1040:6: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
../../../../../src/devices/cpu/saturn/satops.hxx: In member function 'void saturn_device::saturn_and(int, int, int, int)':
../../../../../src/devices/cpu/saturn/satops.hxx:1055:6: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
void saturn_device::saturn_and(int dest, int begin, int count, int src)
^~~~~~~~~~~~~
../../../../../src/devices/cpu/saturn/satops.hxx:1055:6: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
cc1plus.exe: all warnings being treated as errors
optional.make:16209: recipe for target '../../../../mingw-gcc/obj/x32/Release/src/devices/cpu/saturn/saturn.o' failed
make[2]: *** [../../../../mingw-gcc/obj/x32/Release/src/devices/cpu/saturn/saturn.o] Error 1
make[2]: Target 'all' not remade because of errors.
makefile:91: recipe for target 'optional' failed
make[1]: *** [optional] Error 2
cc1.exe: all warnings being treated as errors
sqlite3.make:277: recipe for target '../../../../mingw-gcc/obj/x32/Release/3rdparty/sqlite3/sqlite3.o' failed
make[2]: *** [../../../../mingw-gcc/obj/x32/Release/3rdparty/sqlite3/sqlite3.o] Error 1
make[2]: Target 'all' not remade because of errors.
makefile:58: recipe for target 'sqlite3' failed
make[1]: *** [sqlite3] Error 2
make[1]: Target 'all' not remade because of errors.
makefile:1015: recipe for target 'windows_x86' failed
make: *** [windows_x86] Error 2
make: Target 'all' not remade because of errors.

@katananja
Copy link
Contributor

katananja commented Dec 14, 2017

This works for me.
CPU: AMD FX-8350 Vishera
gcc version 6.3.0 20170516 (GCC)
OPT_FLAGS="-msse -msse2 -msse3 -msse4.1 -msse4.2 -mmmx -mavx -maes -mpclmul -m3dnow -mfma4 -mxop -mlwp -mpopcnt -mabm -m32 -mfpmath=sse"

@katananja
Copy link
Contributor

@cuavas
Copy link
Member

cuavas commented Dec 15, 2017

That's got to be a compiler bug. This is the line in question:

    memcpy(p->aAlloc, &p->aBuffer[iBuf], nAvail);

If you look for the declaration of nAvail it's an int so it can't possibly have a value over 2^32.

The question is whether it's just a warning going screwy or it's actually miscompiling things. If you add NOWERROR=1 to the make options to get past the error, do the data plugin features still work? (Stuff like history.dat display in the info panel.)

@Robbbert
Copy link
Contributor

Similar to #2866 which was closed.

@Robbbert
Copy link
Contributor

Is this still a problem with later GCC?

@cuavas
Copy link
Member

cuavas commented Jan 13, 2021

This was fixed in later GCC versions.

@cuavas cuavas closed this as completed Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants