https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57583

--- Comment #11 from John Paul Adrian Glaubitz <glaubitz at physik dot 
fu-berlin.de> ---
Ok, the patch does indeed work. Tested by compiling the offending source code
file in mednafen which currently fails to build from source [1]:

Without "-mlong-jump-table-offsets", I get:

(sid-m68k-sbuild)root@ikarus:/tmp/mednafen-0.9.39.2+dfsg/src/hw_cpu/m68k# g++-7
-c -std=c++11 m68k.cpp -o m68k.o -I../../../include -DMSB_FIRST
-DSIZEOF_DOUBLE=8
(...)
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x22374) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x22374) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x22374) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x22374) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x22374) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x22374) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x2237a) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x2237a) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x2237a) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x2237a) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x2237a) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x2237a) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x2237a) overflows:
`switch'-statement too large.
/tmp/cclNgtni.s:2848: Error: Adjusted signed .word (0x2237a) overflows:
`switch'-statement too large.
(sid-m68k-sbuild)root@ikarus:/tmp/mednafen-0.9.39.2+dfsg/src/hw_cpu/m68k#
With the option set, it works:

(sid-m68k-sbuild)root@ikarus:/tmp/mednafen-0.9.39.2+dfsg/src/hw_cpu/m68k# g++-7
-c -std=c++11 m68k.cpp -mlong-jump-table-offsets -o m68k.o -I../../../include
-DMSB_FIRST -DSIZEOF_DOUBLE=8
(sid-m68k-sbuild)root@ikarus:/tmp/mednafen-0.9.39.2+dfsg/src/hw_cpu/m68k# ls -l
total 4100
-rw-r--r-- 1 glaubitz glaubitz   21029 Jul 31 19:22 gen.cpp
-rw-r--r-- 1 glaubitz glaubitz   41754 Aug 23 05:26 m68k.cpp
-rw-r--r-- 1 glaubitz glaubitz   11780 Aug 22 22:13 m68k.h
-rw-r--r-- 1 root     root     3242396 Jan  6 10:18 m68k.o
-rw-r--r-- 1 glaubitz glaubitz  868437 Jul 31 19:22 m68k_instr.inc
(sid-m68k-sbuild)root@ikarus:/tmp/mednafen-0.9.39.2+dfsg/src/hw_cpu/m68k#

Anything that speaks against applying this patch against gcc-7 and gcc-6?

> [1] 
> https://buildd.debian.org/status/fetch.php?pkg=mednafen&arch=m68k&ver=0.9.39.2%2Bdfsg-1&stamp=1482769622

Reply via email to