Commit aaa52a96 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/45566 (ICE: in convert_to_eh_region_ranges, at except.c:2446…

re PR middle-end/45566 (ICE: in convert_to_eh_region_ranges, at except.c:2446 with -freorder-blocks-and-partition -fnon-call-exceptions -fprofile-use)

	PR middle-end/45566
	* except.c (convert_to_eh_region_ranges): Emit queued no-region
	notes from other section in hot/cold partitioning even if
	last_action is -3.  Increment call_site_base.

	* g++.dg/tree-prof/partition3.C: New test.

	* g++.dg/tree-prof/tree-prof.exp: Fix a comment.

From-SVN: r169101
parent 7360d2ac
2011-01-21 Jakub Jelinek <jakub@redhat.com> 2011-01-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/45566
* except.c (convert_to_eh_region_ranges): Emit queued no-region
notes from other section in hot/cold partitioning even if
last_action is -3. Increment call_site_base.
PR rtl-optimization/47366 PR rtl-optimization/47366
* fwprop.c (forward_propagate_into): Return bool. If * fwprop.c (forward_propagate_into): Return bool. If
any changes are made, -fnon-call-exceptions is used and any changes are made, -fnon-call-exceptions is used and
......
...@@ -2421,30 +2421,33 @@ convert_to_eh_region_ranges (void) ...@@ -2421,30 +2421,33 @@ convert_to_eh_region_ranges (void)
if (last_action != this_action if (last_action != this_action
|| last_landing_pad != this_landing_pad) || last_landing_pad != this_landing_pad)
{ {
/* If we'd not seen a previous action (-3) or the previous /* If there is a queued no-action region in the other section
action was must-not-throw (-2), then we do not need an with hot/cold partitioning, emit it now. */
end note. */
if (last_action >= -1)
{
/* If we delayed the creation of the begin, do it now. */
if (first_no_action_insn_before_switch) if (first_no_action_insn_before_switch)
{ {
gcc_assert (this_action != -1
&& last_action == (first_no_action_insn
? -1 : -3));
call_site = add_call_site (NULL_RTX, 0, 0); call_site = add_call_site (NULL_RTX, 0, 0);
note note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
= emit_note_before (NOTE_INSN_EH_REGION_BEG,
first_no_action_insn_before_switch); first_no_action_insn_before_switch);
NOTE_EH_HANDLER (note) = call_site; NOTE_EH_HANDLER (note) = call_site;
if (first_no_action_insn) note = emit_note_after (NOTE_INSN_EH_REGION_END,
{
note
= emit_note_after (NOTE_INSN_EH_REGION_END,
last_no_action_insn_before_switch); last_no_action_insn_before_switch);
NOTE_EH_HANDLER (note) = call_site; NOTE_EH_HANDLER (note) = call_site;
gcc_assert (last_action != -3
|| (last_action_insn
== last_no_action_insn_before_switch));
first_no_action_insn_before_switch = NULL_RTX;
last_no_action_insn_before_switch = NULL_RTX;
call_site_base++;
} }
else /* If we'd not seen a previous action (-3) or the previous
gcc_assert (last_action_insn action was must-not-throw (-2), then we do not need an
== last_no_action_insn_before_switch); end note. */
} if (last_action >= -1)
{
/* If we delayed the creation of the begin, do it now. */
if (first_no_action_insn) if (first_no_action_insn)
{ {
call_site = add_call_site (NULL_RTX, 0, cur_sec); call_site = add_call_site (NULL_RTX, 0, cur_sec);
......
2011-01-21 Jakub Jelinek <jakub@redhat.com> 2011-01-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/45566
* g++.dg/tree-prof/partition3.C: New test.
* g++.dg/tree-prof/tree-prof.exp: Fix a comment.
PR rtl-optimization/47366 PR rtl-optimization/47366
* g++.dg/opt/pr47366.C: New test. * g++.dg/opt/pr47366.C: New test.
......
// PR middle-end/45566
// { dg-require-effective-target freorder }
// { dg-options "-O -fnon-call-exceptions -freorder-blocks-and-partition" }
int k;
int
main ()
{
try
{
if (k)
throw 6;
}
catch (...)
{
}
}
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.
# Test the functionality of programs compiled with profile-directed block # Test the functionality of programs compiled with profile-directed block
# ordering using -fprofile-generate followed by -fbranch-use. # ordering using -fprofile-generate followed by -fprofile-use.
load_lib target-supports.exp load_lib target-supports.exp
......
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