public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: GC changes
@ 2001-01-15 11:16 Mike Stump
  0 siblings, 0 replies; 19+ messages in thread
From: Mike Stump @ 2001-01-15 11:16 UTC (permalink / raw)
  To: bernds, egcs; +Cc: amylaar, gcc, geoffk, tej

> Date: Mon, 15 Jan 2001 12:32:34 +0000 (GMT)
> From: Bernd Schmidt <bernds@redhat.com>

> On Mon, 15 Jan 2001, Jamie Lokier wrote:

> > Mike Stump wrote:
> > > > That is not safe.  You can't predict what kind of address arithmetic
> > > > the compiler will make.  For example, strength reduction could cause
> > > > a pointer to be pointing into the middle of an array, or worse,
> > > > somewhere beyond it (incorporating some constant adjustments).
> > >
> > > We already need a switch to disable GC unfriendly optimizations.

> Which ones would that be?

-mgc-safe, -fgc-safe or something along those lines.  I don't know why
 you ask, unless someone has the patches, picking the name is
a bit  premature.

> And how can we verify that the generated code is indeed GC friendly?

When all the GC applications verify that they work 100% all the time
and they never report any bugs, we can know that the code is
reasonably GC friendly.  When the experts conditionalize all the known
optimizations on this flag, we can be obtain more comfort that it is.

``Given enough eyeballs, all bugs are shallow''
http://www.tuxedo.org/~esr/writings/cathedral-bazaar/cathedral-bazaar/ .

> If it can't be verified with a testsuite, such a switch might as
> well not be there, since it won't work in practice.

Sounds kinda defeatist to me.  The software already doesn't work in
practice, why should we bother to work on it?  Answer, because the
level that it works at today is good enough for some, and those that
work on it, only need it to work a little bit better, not perfection,
but just a tad bit better.  This is easy enough to achieve.

Also, there are tons of features in the compiler that don't have
testsuites, that work on a routine basis.  Are you saying that we
should rip out all features that haven't been put through a testsuite
in the past 30 days?

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: GC changes
@ 2001-01-15 10:30 dewar
  2001-01-15 10:42 ` Jamie Lokier
  0 siblings, 1 reply; 19+ messages in thread
From: dewar @ 2001-01-15 10:30 UTC (permalink / raw)
  To: bernds, egcs; +Cc: amylaar, gcc, geoffk, mrs, tej

<<Actually there is another approach.  You could generate unwind stubs
similar to exception handling, with a table indexed by program counter
to the stubs.  For most program addresses the stub would be empty, but
for certain places where only an offset address is present, the stub
would generate the non-offset address.

This has the advantage that no optimisation is penalised.  It's quite
complex to implement though.
>>

Well it's a step along the route to type accurate GC, and really if you
even contemplate going this far, you may as well go all the way.

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: GC changes
@ 2001-01-14 18:55 Mike Stump
  2001-01-15  1:05 ` Jamie Lokier
  0 siblings, 1 reply; 19+ messages in thread
From: Mike Stump @ 2001-01-14 18:55 UTC (permalink / raw)
  To: amylaar, egcs; +Cc: gcc, geoffk, tej

> From: Joern Rennecke <amylaar@cambridge.redhat.com>
> To: egcs@tantalophile.demon.co.uk (Jamie Lokier)
> Date: Sun, 14 Jan 2001 23:03:51 +0000 (GMT)

> That is not safe.  You can't predict what kind of address arithmetic
> the compiler will make.  For example, strength reduction could cause
> a pointer to be pointing into the middle of an array, or worse,
> somewhere beyond it (incorporating some constant adjustments).

We already need a switch to disable GC unfriendly optimizations.

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: GC changes
@ 2001-01-11 12:38 Tim Josling
  2001-01-11 13:18 ` Geoff Keating
  2001-01-14 13:37 ` Jamie Lokier
  0 siblings, 2 replies; 19+ messages in thread
From: Tim Josling @ 2001-01-11 12:38 UTC (permalink / raw)
  To: Geoff Keating, gcc

Geoff,

Hopefully you will provide good documentation on the changes. I
had a lot of unnecessary work due to the paucity of documentation
on the GC when I originally implemented it.

By the way, a question on gc...

I see a lot of code like this:

maintree->x=build_x(build_y(build_z("foo")));

Here is a real example in c-decl.c:
  array_domain_type = build_index_type (build_int_2 (200, 0));

Another:
  ptr_ftype_ptr
    = build_function_type (ptr_type_node,
                           tree_cons (NULL_TREE, ptr_type_node,
endlink));

Here we are building a GCable structure. Once it is all linked
into the main trees under the roots and visible to the mark
routines, it will not disappear during GC. But until then, it is
vulnerable to GC, which can be triggered on any memory
allocation. Here there seem to be several memory allocations and
the early ones are unprotected.

Two things:

1. Have I missed something here? If I have and it is OK this
makes life easier but I would like to understand how it works.

2. What is a good way to make things GC proof for a while until
they get into the main tree structure? At the moment I define
various roots to handle the intermediate allocations. 
  
Thanks,
Tim Josling

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2001-01-16  5:46 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-15 11:16 GC changes Mike Stump
  -- strict thread matches above, loose matches on Subject: below --
2001-01-15 10:30 dewar
2001-01-15 10:42 ` Jamie Lokier
2001-01-14 18:55 Mike Stump
2001-01-15  1:05 ` Jamie Lokier
2001-01-15  4:33   ` Bernd Schmidt
2001-01-15  6:40     ` Jamie Lokier
2001-01-15 10:28       ` Jamie Lokier
2001-01-15 11:34     ` Fergus Henderson
2001-01-16  3:27       ` Bernd Schmidt
2001-01-16  5:37         ` Fergus Henderson
2001-01-16  5:46           ` Jamie Lokier
2001-01-15 11:34   ` Fergus Henderson
2001-01-11 12:38 Tim Josling
2001-01-11 13:18 ` Geoff Keating
2001-01-14 13:37 ` Jamie Lokier
2001-01-14 15:03   ` Joern Rennecke
2001-01-14 16:59     ` Jamie Lokier
2001-01-15  3:23       ` Joern Rennecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).