------- Comment #71 from rguenth at gcc dot gnu dot org  2007-05-16 13:05 
-------
But it doesn't fix the POOMA miscompilations if I change its Pool allocator to
use placement new instead of this

  // Release a block to the pool.
  inline void free(void *b)
    {
      // Record a free.
      outstandingAllocs_m -= 1;

      // Cast the pointer to the right type.
      Link *p = (Link*)b;

      // Make it point to the current head of the free list.
      p->next_m = head_m;

      // Make the next one the new head of the list.
      // We can't do head_m = p->next_m since p will soon be treated
      // as something other than a Link.  By doing this assignment
      // with memcpy, we ensure that p->next_m will be read before
      // it is clobbered.
      memcpy(&p->next_m, &head_m, sizeof(head_m));

      // Make it the head of the free list.
      head_m = p;
    }

memcpy hack.  I'll try to investigate...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286

Reply via email to