bebbo / gcc

Bebbo's gcc-6-branch for m68k-amigaos
GNU General Public License v2.0
33 stars 11 forks source link

internal compiler error: in elimination_costs_in_insn, at reload1.c:3762 #155

Closed alexalkis closed 3 years ago

alexalkis commented 3 years ago

git clone https://github.com/paladin-t/my_basic cd my_basic m68k-amigaos-gcc -Os -noixemul -o myb shell/main.c core/my_basic.c

if you do without -Os, no error but compiler fails sillently (return code 1 in shell)

bebbo commented 3 years ago

https://franke.ms/cex/z/e7qxoe

bebbo commented 3 years ago

if you do without -Os, no error but compiler fails sillently (return code 1 in shell)

there is a compile error due to missing CLOCK_MONOTONIC.

alexalkis commented 3 years ago

is CLOCK_MONOTONIC somehow referenced in source? (I grep'ed and there was nothing found) Compiler stop reporting internal error after last commit, but there is no executable produced.

Any workarrounds? :)

bebbo commented 3 years ago
$  m68k-amigaos-gcc -Os -noixemul -o myb shell/main.c core/my_basic.c  -lm
shell/main.c: In function '_ticks':
shell/main.c:1270:2: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
  clock_gettime(CLOCK_MONOTONIC, &ts);
  ^~~~~~~~~~~~~
shell/main.c:1270:16: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
  clock_gettime(CLOCK_MONOTONIC, &ts);
...
bebbo commented 3 years ago

-> #define CLOCK_MONOTONIC (clockid_t)4

alexalkis commented 3 years ago

Yeah, that works:

m68k-amigaos-gcc -noixemul -DCLOCK_MONOTONIC="(clockid_t)4" -Wno-multichar -Wno-overflow -Wno-unused-result -Os -o myb shell/main.c core/my_basic.c -lm

the thing is, the interpreter doesn't work. Exe runs, but can't handle (correctly) any bas file. If you compile for linux it works. I suspected unicode, I tried to disable it, still no go. Something else (or even unicode and my test was crap) is messing in libnix?

bebbo commented 3 years ago

there can be many reasons - maybe start with le/be stuff:

typedef union _raw_u { mb_data_e e; char c; int_t i; real_t r; void* p; mb_val_bytes_t b; } _raw_u;