[PATCH, Ada] RISC-V: Initial riscv linux Ada port.
Pierre-Marie de Rodat
derodat@adacore.com
Fri Jul 13 05:47:00 GMT 2018
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
(https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/dwarf2out.c;h=c2422e29658b6a101034318deed224271e6f1ca7;hb=HEAD#l24561),
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
More information about the Gcc-patches
mailing list