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]

squeeze_notes vs. g++.other/loop2.C (resend)


loop2.C has been failing for me on i686-linux for months now.  I finally
got around to investigating it, er, a month ago when I sent this note
before.  A simplified version:

struct A {
  ~A();
};

struct B : public A {
  void f ();
};

bool t;

void q()
{
  while (true)
    {
      B b;
      if (t)
	break;
      b.f();
    }
}

There are two main EH regions: the one around the loop body for cleaning
up b, and inside it the one around the jump fixup to avoid destroying b
twice.  The loop optimizer appropriately notices that it can move the fixup
block outside the loop.  The region start note is in the batch of notes
immediately after the jump_insn, and the region end note is in the batch of
notes after the barrier.  insns_safe_to_move_p sees that the block contains
a complete eh region, and says OK.  So far, so good.

But then we call squeeze_notes, which moves the start note out of the group
of insns to be moved, but leaves the end note because it assumes that its
end parm can't be a movable note.  This causes a crash in scan_regions, and
seems a simple bug.

But it also seems to me that squeeze_notes shouldn't be messing with EH
notes at all; how can it possibly be right to remove EH region notes from
around a block of instructions?  Won't that screw up EH semantics?

What did you intend when you changed squeeze_notes to move EH notes?

Perhaps you're aware of these issues, and plan to ignore this problem until
we've done away with the EH notes entirely, as you've proposed.

Jason

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