How to force gcc to blackhole registers so that things maybe garbage collected?

Andrew Haley aph@redhat.com
Thu May 16 12:46:00 GMT 2019


On 5/14/19 3:31 PM, Hamad Ahmed wrote:
> Should not be too hard to put in? Gcc does know when 
> a variable won’t be used anymore. So you coul compile with something
> like -fgarbage so it inserts an extra assembly instruction
> that zeros out those registers containing pointers to these
> dead variables. 

Possibly, but there are several passes of dead code elimination and
each time the zeroing instruction would be deleted. Bohem is a
conservative GC, not a precise one, and you have to live with the
consequences of that.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the Gcc-help mailing list