[Bug middle-end/17126] [3.5 Regression] ICE in GC with non-unit-at-a-time

bommar33 at msu dot edu gcc-bugzilla@gcc.gnu.org
Sat Aug 21 16:27:00 GMT 2004


------- Additional Comments From bommar33 at msu dot edu  2004-08-21 16:27 -------
gtype-desc.c:L200

while (x != xlimit)
{
  gt_ggc_m_9tree_node ((*x).decl);
  ...
}

It looks like the error occurs when both x is equal to NULL and xlimit is equal
to 0.  The problem appears to originate from the previous block:

for (;;)
{
  struct cgraph_node * const xprev = ((*x).previous);
  if (xprev == NULL) break;
  x = xprev;
  (void) ggc_test_and_set_mark (xprev);
}

This is just speculation, and I'm still obviously very much in the dark and
rather bogged down in foreign code, but perhaps this rambling will trigger a
thought.

//0x082ac394 <gt_ggc_mx_cgraph_node+84>:  mov    0xfffffff4(%ebp),%eax
//0x082ac397 <gt_ggc_mx_cgraph_node+87>:  mov    %eax,0xfffffffc(%ebp)
x = xprev;

This assigns the pointer x the address of the pointer xprev.  xprev, however, is
declared only within the scope of the for loop.  gcc_test_and_set_mark declares
its argument as const, so I assume that no alteration would occur therein.  Is
xprev's address getting overwritten once the compiler passes its scope and
thinks it's safe to mange its memory?

Either way, the segfault occurs on this op where eax = 0x0:

0x082ac3c7 <gt_ggc_mx_cgraph_node+135>: cmpl   $0x0,(%eax)

...which, I believe, matches up to the NULL check in the macro's declaration.

Anyway, I'm off to lunch, so I help this was more helpful than a waste of space.


-- 


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



More information about the Gcc-bugs mailing list