This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Are egcs optimizations safe for conservative GC?




  In message <373F1F2B.D0AC8171@swipnet.se>you write:
  > doubly-linked lists) but that is usually not much of a concern.  A more
  > severe problem would be if the compiler obscured the only pointer to a
  > live memory block "behind the programmer's back" as part of a clever
  > optimization or code generation technique.  The block would then risk
  > being freed in error, leading to nasty memory corruption problems which
  > could be very difficult to track down and fix.
This kind of thing can and does happen.  The loop optimizer can create such
addresses as can code to optimize address arithmetic.

  > Boehm says that such problems are extremely rare with current compilers,
  > and that such problems have only been detected in contrived examples
  > especially constructed for the purpose.  But he also suggests that it
  > might become more of a problem with future sophisticated optimization
  > techniques(1).
As a compiler junkie, I would say the opposite.  It does not take a contrived
example.  One just has to know how optimizers work to build such examples :-)

I wrote a fairly extensive writeup of these issues back in 1992 or 1993 when
we were considering Boehm GC for a project I was working on at the UofU, but
I doubt I'd be able to find it in my 1992/1993 outbox :(

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]