Commit 79f00c53 authored by jakub's avatar jakub
Browse files

* cfgcleanup.c (outgoing_edges_match): Check REG_EH_REGION notes

	even if nehedges1 is 0.

	* g++.dg/eh/crossjump1.C: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70080 138bc75d-0d04-0410-961f-82ee72b054a4
parent a95bcb36
2003-08-01 Jakub Jelinek <jakub@redhat.com>
* cfgcleanup.c (outgoing_edges_match): Check REG_EH_REGION notes
even if nehedges1 is 0.
2003-08-01 Nathanael Nerode <neroden@gcc.gnu.org>
* fixinc/fixfixes.c, fixinc/fixlib.c, fixinc/fixlib.h,
......
......@@ -1337,15 +1337,17 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
return false;
}
/* In case we do have EH edges, ensure we are in the same region. */
if (nehedges1)
{
rtx n1 = find_reg_note (bb1->end, REG_EH_REGION, 0);
rtx n2 = find_reg_note (bb2->end, REG_EH_REGION, 0);
/* Ensure the same EH region. */
{
rtx n1 = find_reg_note (bb1->end, REG_EH_REGION, 0);
rtx n2 = find_reg_note (bb2->end, REG_EH_REGION, 0);
if (XEXP (n1, 0) != XEXP (n2, 0))
return false;
}
if (!n1 && n2)
return false;
if (n1 && (!n2 || XEXP (n1, 0) != XEXP (n2, 0)))
return false;
}
/* We don't need to match the rest of edges as above checks should be enough
to ensure that they are equivalent. */
......
2003-08-01 Jakub Jelinek <jakub@redhat.com>
* g++.dg/eh/crossjump1.C: New test.
2003-08-01 Mark Mitchell <mark@codesourcery.com>
 
PR c++/11697
......
// This testcase failed on s390, because cross-jumping merged 2 calls,
// one with REG_EH_REGION note with no handlers (ie. termination)
// and one without REG_EH_REGION note.
// { dg-do run }
// { dg-options "-O2" }
#include <exception>
#include <string>
struct E : public std::exception
{
std::string m;
E () : m ("test") { }
~E () throw() { }
};
struct C : public E { };
void foo ()
{
throw C ();
}
int main ()
{
try
{
foo ();
}
catch (...) { }
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment