Code: Select all
/usr/m68k-atari-mint/sys-root/usr/include/stdio.h:30:11: fatal error: features.h: No such file or directory
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
Code: Select all
/usr/m68k-atari-mint/sys-root/usr/include/stdio.h:30:11: fatal error: features.h: No such file or directory
Ok, thanks for the info. It was not clear what files I really need. No, I haven't compiled mintlib yet. I just took the development package and copied the include folder to the appropriate path. Now it runs through but ends up with an error 2 code.ThorstenOtto wrote: ↑Fri Aug 07, 2020 9:53 am features.h is built from features.h.in when you compile mintlib. The only thing that is done there is to substitute the version number. But how did you install mintlib? I just checked, and the snapshot versions have that file.
BTW i already compiled gcc 10.1.0, available at http://tho-otto.de/crossmint.php However there are some things that i couldn't solve yet, it generates rather sub-optimal code in some cases.
But then features.h should be there?I just took the development package and copied the include folder to the appropriate path
Ok in the sense that the code is correct. But for example in https://github.com/freemint/freemint/bl ... der.c#L108 i had to add a workaround, because gcc 10 suddenly generates a call to memset(), although only 4 bytes at max are initialized there. There are also other constructs which suddenly emit a call to memcpy() even when only a few bytes are copied. In a lot of cases, that is really sub-optimal, because the code will be both slower and larger.Didn't check in detail but the gcc compiler seems to be ok so far.
Your're right. My sentence is quite a bit misleading: it should begin with: "After reading your message".
That explains it
Just out of curiosity - do you have a link to that bug report?ThorstenOtto wrote: ↑Sat Aug 08, 2020 12:23 am BTW, i just compiled gcc 10.2.0, and the problem reported above persists (also in a vanilla m68k-elf target, without any mint specific patches, so it is not caused by our changes). I filed a bug report about this, maybe some gcc guru can help with this.
That's because in that case the loop is already unrolled by the "cunrolli" optimizer step which happens before "ldist". Thus "ldist" does not get the chance to insert a builtin_memset call. If you disable the "cunrolli" pass (-fdisable-tree-cunrolli), you can see the memset in the intermediary output, again, until it is finally eliminated by an RTL pass.ThorstenOtto wrote: ↑Sat Aug 08, 2020 1:03 pm Thanks for the info, that is definitely worth a look. But i guess there must also something else going wrong, because a) the memset is not emitted when i remove the first loop in the example, only leaving the loop that initializes the array
Hard to say without a MWE, but this could be an entirely different bug.ThorstenOtto wrote: ↑Sat Aug 08, 2020 1:03 pm and b) similar things sometimes seem to happen with structure assignments of small sizes, when a call to memcpy() is issued.
That could be yet another different bug...ThorstenOtto wrote: ↑Sat Aug 08, 2020 1:03 pm There are also, more complicated cases where gcc seems to generate strange code (remember that rectfill performance problem i reported some times ago, when i accidentely used the wrong compiler; when you look at the assembly you have even hard times to find the code for the inner loop, because he jumps around like mad)
Code: Select all
[...]
.L13:
move.l (%sp)+,%d2
move.l (%sp)+,%d3
rts
.L7:
moveq #3,%d0
move.b #32,(%a0,%d0.l)
dbra %d0,.L6
clr.w %d0
subq.l #1,%d0
jcc .L6
jra .L13
[...]
Code: Select all
void benchmark(void);
long measuretime(void)
{
int k;
long start, stop;
start = *(volatile long*)0x4BAul;
for (k=0; k<100; k++)
benchmark();
stop = *(volatile long*)0x4BAul;
return stop-start;
}
Code: Select all
idnt "bench.c"
opt o+,ol+,op+,oc+,ot+,oj+,ob+,om+
section "CODE",code
public _measuretime
cnop 0,4
_measuretime
movem.l l11,-(a7)
moveq #0,d2
l9
jsr _benchmark
addq.l #1,d2
moveq #100,d0
cmp.l d2,d0
bgt l9
moveq #0,d0
l11 reg d2
movem.l (a7)+,d2
l13 equ 4
rts
public _benchmark
I think it is less of the C compiler than the Devpac compatible assembler which they like.