Commit 0526ed2a by Jan Hubicka Committed by Jan Hubicka

re PR middle-end/83718 (ICE: Floating point exception in profile_count::apply_scale)

	PR middle-end/83718
	* tree-inline.c (copy_cfg_body): Adjust num&den for scaling
	after they are computed.
	* g++.dg/torture/pr83718.C: New testcase.

From-SVN: r256544
parent 2a3af45c
2018-01-11 Jan Hubicka <hubicka@ucw.cz>
PR middle-end/83718
* tree-inline.c (copy_cfg_body): Adjust num&den for scaling
after they are computed.
2018-01-11 Bin Cheng <bin.cheng@arm.com> 2018-01-11 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/83695 PR tree-optimization/83695
......
2018-01-11 Jan Hubicka <hubicka@ucw.cz>
PR middle-end/83718
* g++.dg/torture/pr83718.C: New testcase.
2018-01-11 Martin Jambor <mjambor@suse.cz> 2018-01-11 Martin Jambor <mjambor@suse.cz>
PR ipa/83178 PR ipa/83178
......
/* { dg-do compile } */
/* { dg-options "-O2 -std=c++11" } */
class a
{
public:
int c (const char *);
};
class B
{
virtual int *d (a, bool);
};
bool e, f, g;
class: B
{
int ah;
int *
d (a, bool)
{
if (e)
return &ah;
a bj;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (f)
return &ah;
bj.c ("");
if (g)
return &ah;
if (f)
return &ah;
e = a ().c("");
return &ah;
}
} b;
...@@ -2683,8 +2683,6 @@ copy_cfg_body (copy_body_data * id, ...@@ -2683,8 +2683,6 @@ copy_cfg_body (copy_body_data * id,
profile_count den = ENTRY_BLOCK_PTR_FOR_FN (src_cfun)->count; profile_count den = ENTRY_BLOCK_PTR_FOR_FN (src_cfun)->count;
profile_count num = entry_block_map->count; profile_count num = entry_block_map->count;
profile_count::adjust_for_ipa_scaling (&num, &den);
cfun_to_copy = id->src_cfun = DECL_STRUCT_FUNCTION (callee_fndecl); cfun_to_copy = id->src_cfun = DECL_STRUCT_FUNCTION (callee_fndecl);
/* Register specific tree functions. */ /* Register specific tree functions. */
...@@ -2707,6 +2705,8 @@ copy_cfg_body (copy_body_data * id, ...@@ -2707,6 +2705,8 @@ copy_cfg_body (copy_body_data * id,
ENTRY_BLOCK_PTR_FOR_FN (cfun)->count = den; ENTRY_BLOCK_PTR_FOR_FN (cfun)->count = den;
} }
profile_count::adjust_for_ipa_scaling (&num, &den);
/* Must have a CFG here at this point. */ /* Must have a CFG here at this point. */
gcc_assert (ENTRY_BLOCK_PTR_FOR_FN gcc_assert (ENTRY_BLOCK_PTR_FOR_FN
(DECL_STRUCT_FUNCTION (callee_fndecl))); (DECL_STRUCT_FUNCTION (callee_fndecl)));
......
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