[Patch] c-format.c/Fortran: Support %wd / host-wide integer in gfc_error (Re: [PATCH] PR fortran/100950 - ICE in output_constructor_regular_field, at varasm.c:5514)

Tobias Burnus tobias@codesourcery.com
Fri Aug 20 11:50:00 GMT 2021


On 20.08.21 11:16, Jakub Jelinek wrote:

> Now, the non-Fortran FE diagnostic code actually has %wd for this (w
> modifier like l modifier), which takes HOST_WIDE_INT/unsigned HOST_WIDE_INT
> argument and prints it.
>
> So, either you get through the hops to support that, unfortunately it isn't
> just adding support for that in fortran/error.c (error_print) and some
> helper functions, which wouldn't be that hard, just add 'w' next to 'l'
> handling, TYPE_* for that and union member etc., but one needs to modify
> c-family/c-format.c too to register the modifier so that gcc doesn't warn
> about it and knows the proper argument type etc.

That's what the attached patch does.

Build on x86-64 GNU Linux; I tried to build it with -m32 (cf. my
previous email) but as I did not run into the original issue, this does
not proof much.

Comments? OK?

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omp-fortran-hwi.diff
Type: text/x-patch
Size: 12585 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210820/d5074c76/attachment-0001.bin>


More information about the Gcc-patches mailing list