ipa-prop.c (compute_complex_ancestor_jump_func): Replace overzealous assertion with conditional return.

* ipa-prop.c (compute_complex_ancestor_jump_func): Replace overzealous
	assertion with conditional return.

From-SVN: r207838
This commit is contained in:
Eric Botcazou 2014-02-18 11:07:34 +00:00 committed by Eric Botcazou
parent 2a144f64c9
commit 20afe6403b
4 changed files with 48 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2014-02-18 Eric Botcazou <ebotcazou@adacore.com>
* ipa-prop.c (compute_complex_ancestor_jump_func): Replace overzealous
assertion with conditional return.
2014-02-18 Jakub Jelinek <jakub@redhat.com>
Uros Bizjak <ubizjak@gmail.com>

View File

@ -1211,7 +1211,8 @@ compute_complex_ancestor_jump_func (struct ipa_node_params *info,
return;
parm = TREE_OPERAND (expr, 0);
index = ipa_get_param_decl_index (info, SSA_NAME_VAR (parm));
gcc_assert (index >= 0);
if (index < 0)
return;
cond_bb = single_pred (assign_bb);
cond = last_stmt (cond_bb);

View File

@ -1,3 +1,7 @@
2014-02-18 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/opt32.adb: New test.
2014-02-18 Janus Weil <janus@gcc.gnu.org>
PR fortran/60231

View File

@ -0,0 +1,37 @@
-- { dg-do compile }
-- { dg-options "-O2" }
with Ada.Containers; use Ada.Containers;
with Ada.Containers.Vectors;
function Opt32 return Natural is
package My_Vectors
is new Vectors (Index_Type => Natural, Element_Type => Integer);
use My_Vectors;
V : Vector;
function Sign_Changes return Natural is
Cur : Cursor := To_Cursor (V, 0);
R : Natural := 0;
Negative : Boolean;
begin
Negative := Element (Cur) < 0;
loop
Cur := Next (Cur);
exit when R > 100;
if (Element (Cur) < 0) /= Negative then
Negative := not Negative;
R := R + 1;
end if;
end loop;
return R;
end;
begin
return Sign_Changes;
end;