This is the mail archive of the gcc-bugs@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]

Invalid memory access in loop_p ()


I was trying to figure out why my malloc debugger doesn't like the edge
forwarding stuff (on both the new regalloc branch, and the mainline,
which have different versions, it tells me we have a problem in the
same place.  The original failure i was trying to track down is an
annoying segfault during life analysis, but life analysis isn't the
real cause of the segfault), and noticed this.

I'm not sure what the right fix is here, however, i'm sure the code in
question isn't doing anything weird (it's dwarf2read.c from gdb).

We have an edge from the entry block to 0.
So it goes to access pre[-1].
Whoops.

I don't have time to figure out what the right fix is, i'm just trying
to give someone some context to fix the bug.
the bug.

*************** loop_p ()
*** 2119,2124 ****
--- 2118,2124 ----
        else
        {
           <Right here, src == ENTRY_BLOCK_PTR >
          if (dest != EXIT_BLOCK_PTR              
              && pre[src->index] >= pre[dest->index]
              && post[dest->index] == 0)
            break;
-- 
"I saw a small bottle of cologne and asked if it was for sale.
She said, "It's free with purchase."  I asked her if anyone
bought anything today.
"-Steven Wright


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