This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Introduce instance discriminators
- From: Alexandre Oliva <oliva at gnu dot org>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 30 Jul 2018 19:35:30 -0300
- Subject: Re: [PATCH] Introduce instance discriminators
- References: <ory3e9nify.fsf@lxoliva.fsfla.org> <CAFiYyc1GyH8+P2t6TNem5MQj4redbLNrmMt4Afx=GajF5NCAeA@mail.gmail.com> <ord0vjn122.fsf@lxoliva.fsfla.org> <CAFiYyc0o=EL-aEfbCgNdMGW7_m+ruoVikWk96RkMA7Xum4i-6A@mail.gmail.com> <oreffs8o3y.fsf@lxoliva.fsfla.org>
On Jul 24, 2018, Alexandre Oliva <oliva@gnu.org> wrote:
> Ok to install the first two patches? (the third is just for reference)
Ping?
https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01419.html
> Introduce instance discriminators
> From: Alexandre Oliva <oliva@adacore.com>
> With -gnateS, the Ada compiler sets itself up to output discriminators
> for different instantiations of generics, but the middle and back ends
> have lacked support for that. This patch introduces the missing bits,
> translating the GNAT-internal representation of the per-file instance
> map to an instance_table that maps decls to instance discriminators.
> From: Alexandre Oliva <oliva@adacore.com>, Olivier Hainque <hainque@adacore.com>
> for gcc/ChangeLog
> * debug.h (decl_to_instance_map_t): New type.
> (decl_to_instance_map): Declare.
> (maybe_create_decl_to_instance_map): New inline function.
> * final.c (bb_discriminator, last_bb_discriminator): New statics,
> to track basic block discriminators.
> (final_start_function_1): Initialize them.
> (final_scan_insn_1): On NOTE_INSN_BASIC_BLOCK, track
> bb_discriminator.
> (decl_to_instance_map): New variable.
> (map_decl_to_instance, maybe_set_discriminator): New functions.
> (notice_source_line): Set discriminator.
> for gcc/ada
> * trans.c: Include debug.h.
> (file_map): New static variable.
> (gigi): Set it. Create decl_to_instance_map when needed.
> (Subprogram_Body_to_gnu): Pass gnu_subprog_decl to...
> (Sloc_to_locus): ... this. Add decl parm, map it to instance.
> * gigi.h (Sloc_to_locus): Adjust declaration.
> for gcc/testsuite/ChangeLog
> * gnat.dg/dinst.adb: New.
> * gnat.dg/dinst_pkg.ads, gnat.dg/dinst_pkg.adb: New.
[...]
> Save discriminator info for LTO
> From: Alexandre Oliva <oliva@adacore.com>
> for gcc/ChangeLog
> * gimple-streamer-in.c (input_bb): Restore BB discriminator.
> * gimple-streamer-out.c (output_bb): Save it.
> * lto-streamer-in.c (input_struct_function_base): Restore
> instance discriminator if available. Create map on demand.
> * lto-streamer-out.c (output_struct_function_base): Save it if
> available.
> * final.c (decl_to_instance_map): Document LTO strategy.
--
Alexandre Oliva, freedom fighter https://FSFLA.org/blogs/lxo
Be the change, be Free! FSF Latin America board member
GNU Toolchain Engineer Free Software Evangelist