Commit 3e27aa84 by Eric Botcazou

optabs.c (maybe_encapsulate_block): New function extracted from...

	* optabs.c (maybe_encapsulate_block): New function extracted from...
	(emit_libcall_block): ...here.  Invoke it on the block of insns to
	maybe emit REG_LIBCALL/REG_RETVAL notes around the block.
	(emit_no_conflict_block): Likewise.

From-SVN: r115498
parent c5ee132b
2006-07-16 Eric Botcazou <ebotcazou@adacore.com>
* optabs.c (maybe_encapsulate_block): New function extracted from...
(emit_libcall_block): ...here. Invoke it on the block of insns to
maybe emit REG_LIBCALL/REG_RETVAL notes around the block.
(emit_no_conflict_block): Likewise.
2006-07-16 Eric Botcazou <ebotcazou@libertysurf.fr>
* doc/install.texi (sparc-sun-solaris2*): Add GMP version number.
......
......@@ -3218,6 +3218,38 @@ no_conflict_move_test (rtx dest, rtx set, void *p0)
p->must_stay = true;
}
/* Encapsulate the block starting at FIRST and ending with LAST, which is
logically equivalent to EQUIV, so it gets manipulated as a unit if it
is possible to do so. */
static void
maybe_encapsulate_block (rtx first, rtx last, rtx equiv)
{
if (!flag_non_call_exceptions || !may_trap_p (equiv))
{
/* We can't attach the REG_LIBCALL and REG_RETVAL notes when the
encapsulated region would not be in one basic block, i.e. when
there is a control_flow_insn_p insn between FIRST and LAST. */
bool attach_libcall_retval_notes = true;
rtx insn, next = NEXT_INSN (last);
for (insn = first; insn != next; insn = NEXT_INSN (insn))
if (control_flow_insn_p (insn))
{
attach_libcall_retval_notes = false;
break;
}
if (attach_libcall_retval_notes)
{
REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
REG_NOTES (first));
REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first,
REG_NOTES (last));
}
}
}
/* Emit code to perform a series of operations on a multi-word quantity, one
word at a time.
......@@ -3339,10 +3371,7 @@ emit_no_conflict_block (rtx insns, rtx target, rtx op0, rtx op1, rtx equiv)
else
first = NEXT_INSN (prev);
/* Encapsulate the block so it gets manipulated as a unit. */
REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
REG_NOTES (first));
REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last));
maybe_encapsulate_block (first, last, equiv);
return last;
}
......@@ -3496,30 +3525,7 @@ emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv)
else
first = NEXT_INSN (prev);
/* Encapsulate the block so it gets manipulated as a unit. */
if (!flag_non_call_exceptions || !may_trap_p (equiv))
{
/* We can't attach the REG_LIBCALL and REG_RETVAL notes
when the encapsulated region would not be in one basic block,
i.e. when there is a control_flow_insn_p insn between FIRST and LAST.
*/
bool attach_libcall_retval_notes = true;
next = NEXT_INSN (last);
for (insn = first; insn != next; insn = NEXT_INSN (insn))
if (control_flow_insn_p (insn))
{
attach_libcall_retval_notes = false;
break;
}
if (attach_libcall_retval_notes)
{
REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
REG_NOTES (first));
REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first,
REG_NOTES (last));
}
}
maybe_encapsulate_block (first, last, equiv);
}
/* Nonzero if we can perform a comparison of mode MODE straightforwardly.
......
2006-07-16 Olivier Hainque <hainque@adacore.com>
* gnat.dg/assert.ads: New file.
* gnat.dg/controlled_record.ads: Likewise.
* gnat.dg/controlled_record.adb: Likewise.
2006-07-15 Lee Millward <lee.millward@gmail.com>
PR c++/28292
package Assert is
procedure Assert (Condition : Boolean);
end Assert;
-- { dg-do compile }
-- { dg-options "-O2" }
with Ada.Text_IO; use Ada.Text_IO;
with Assert;
package body Controlled_Record is
procedure Assert_Invariants (PA : Point_T) is
PB : Point_T;
begin
Assert.Assert (PB.Pos = PA.Pos);
end;
end Controlled_Record;
with Ada.Finalization;
package Controlled_Record is
type Point_T is limited private;
procedure Assert_Invariants (PA : Point_T);
private
type Coords_T is array (1 .. 2) of Natural;
type Point_T is new Ada.Finalization.Controlled with record
Pos : Coords_T := (0, 0);
end record;
end Controlled_Record;
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