This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, Ada] RISC-V: Initial riscv linux Ada port.
- From: Pierre-Marie de Rodat <derodat at adacore dot com>
- To: Jim Wilson <jimw at sifive dot com>
- Cc: Eric Botcazou <ebotcazou at adacore dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 13 Jul 2018 07:47:07 +0200
- Subject: Re: [PATCH, Ada] RISC-V: Initial riscv linux Ada port.
- References: <email@example.com> <3040525.m4Pn2gu4gY@polaris> <CAFyWVaY0_SC+NCj9kkxX57XSRA6B2HCMNd-wmDgZ+vLB=Mxscg@mail.gmail.com> <3639449.hfrN8MdEsi@polaris> <firstname.lastname@example.org> <CAFyWVaa3DPbYiTkkq3x9Kjz-Aq_-qsda4EW1b149=uEf_CLYWg@mail.gmail.com>
On 07/13/2018 01:57 AM, Jim Wilson wrote:
I poked at this a little and noticed a difference between the x86_64
support and the RISC-V support. The RISC-V C language port has char
as unsigned by default. The x86_64 port has char signed by default.
If I add a -fsigned-char option, then the testcase works as expected
for RISC-V. Curiously, the Ada compiler accepts -fsigned-char but not
-funsigned-char. I tried hacking in a -funsigned-char flag, but when
I use it with the x86_64 port the result is still correct. Maybe my
quick hack wasn't quite right. Anyways, the default signedness of
char has something to do with the problem.
Ah, interesting! Last year, we installed specific code in the Ada front
end and the DWARF back end to handle discrepancies between the
INTEGER_TYPE signedness and the signedness to appear in debug info
but ironically here, it seems that we don’t handle properly when
everything is unsigned.
I think the current testcase should work on RISC-V even without
-fsigned-char: Character’s debug type should be unsigned in all cases.
Maybe for some reason we don’t create the correct debug type in the Ada
front end… Do you think I can reproduce this with a x86_64-linux
compiler targetting something like riscv-elf? I don’t have access to a
RISC-V board on which to build GCC.
Pierre-Marie de Rodat