On 05/06/2019 15:22, Matthew Flatt wrote:
> Thanks!
>
> It looks like this happens only with -O3, so most users won't run into
> it (with the default -O2).
>
Correct.
>
> I see that changing the declaration
>
> uptr vspace_offsets[vspaces_count+1];
>
> to
>
> uptr vspace_offsets[2*vspaces_count+1];
>
> makes the error go away, but I don't know whether it's just a bug in
> array-bounds checking (in which case extending the array size should be
> harmless) or reflects a miscompilation (in which case extending the
> array size just masks a problem).
>
It is afaict, a bug in the array bounds calculation. So, increasing it
masks the problem.
I have tested latest commit from the gcc 7 branch and it still has the
problem.
/home/pmatos/Projects/gcc-build/gcc/cc1 -fpreprocessed vfasl.i -quiet
-dumpbase vfasl.i -m64 -msse2 -mtune=generic -march=x86-64 -auxbase
vfasl -O3 -Wpointer-arith -Wextra -Werror -Wimplicit-fallthrough=0 -Wall
-version -o /tmp/ccYGabNR.s
GNU C11 (GCC) version 7.4.1 20190605 (x86_64-pc-linux-gnu)
compiled by GNU C version 8.2.1 20181127, GMP version 6.1.2,
MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C11 (GCC) version 7.4.1 20190605 (x86_64-pc-linux-gnu)
compiled by GNU C version 8.2.1 20181127, GMP version 6.1.2,
MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 4c52f0564d8672c9a189665c732e246d
vfasl.c: In function ‘S_vfasl’:
vfasl.c:352:134: error: array subscript is above array bounds
[-Werror=array-bounds]
I will bisect this to see what's going on just out of curiosity.
Will let you know.
> At Wed, 5 Jun 2019 15:04:10 +0200, "'Paulo Matos' via Racket Developers"
> wrote:
>> Hi,
>>
>> This is just to let you know of a GCC bug in GCC7.4.0 (default in Ubuntu
>> 18.04 LTS) when compiling racketcs.
>>
>> GCC complains about
>> vfasl.c:358:134: error: array subscript is above array bounds
>> [-Werror=array-bounds]
>>
>> on vfasl.c of Chez sources. However, this is a false positive fixed on
>> more recent GCC versions. On ubuntu 18.04:
>> racket/racket/src/ChezScheme/ta6le/c$ apt-get install -y gcc-8
>> racket/racket/src/ChezScheme/ta6le/c$ gcc -m64 -msse2 -Wpointer-arith
>> -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 -D_REENTRANT
>> -pthread -march=native -O3 -Wall -DELF_FIND_BOOT_SECTION -pthread -c
>> -DX86_64 -I../boot/ta6le -I../zlib -I../lz4/lib vfasl.c
>> vfasl.c: In function ‘S_vfasl’:
>> vfasl.c:352:134: error: array subscript is above array bounds
>> [-Werror=array-bounds]
>> MAYBE_FIXUP(0);
>> ...
>> cc1: all warnings being treated as errors
>> racket/racket/src/ChezScheme/ta6le/c$ gcc-8 -m64 -msse2 -Wpointer-arith
>> -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 -D_REENTRANT
>> -pthread -march=native -O3 -Wall -DELF_FIND_BOOT_SECTION -pthread -c
>> -DX86_64 -I../boot/ta6le -I../zlib -I../lz4/lib vfasl.c
>> $
>>
>> The broken gcc version:
>> $ gcc --version
>> gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0
>> Copyright (C) 2017 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions. There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>
>> Fixed:
>> $ gcc-8 --version
>> gcc-8 (Ubuntu 8.3.0-6ubuntu1~18.04) 8.3.0
>> Copyright (C) 2018 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions. There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>
>> The might have come in long before 8.3.0 but I haven't run further
>> tests. This is relevant to know because the bug is in the default GCC
>> for Ubuntu LTS.
>>
>> If I find more, I will let you know.
>>
>> Regards,
>> --
>> Paulo Matos
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-dev/72642853-8f01-61a3-033d-b38be5e712
>> 07%40linki.tools.
>> For more options, visit https://groups.google.com/d/optout.
>
--
Paulo Matos
--
You received this message because you are subscribed to the Google Groups
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-dev/768e5035-4b54-ad47-5052-de8453ee06a1%40linki.tools.
For more options, visit https://groups.google.com/d/optout.
Re: [racket-dev] Compilation issues of racketcs with GCC7.4.0
'Paulo Matos' via Racket Developers Wed, 05 Jun 2019 06:36:23 -0700
- [racket-dev] Compilation issues of rac... 'Paulo Matos' via Racket Developers
- Re: [racket-dev] Compilation issu... Matthew Flatt
- Re: [racket-dev] Compilation ... 'Paulo Matos' via Racket Developers
- Re: [racket-dev] Compilat... 'Paulo Matos' via Racket Developers
