re PR ipa/85549 (Infinite loop in ilmbase package)

PR ipa/85549
	* ipa-cp.c (find_aggregate_values_for_callers_subset): Make sure
	the jump function allows for passing through aggregate values.

	* g++.dg/ipa/pr85549.C: New test.

From-SVN: r259730
This commit is contained in:
Martin Jambor 2018-04-27 22:32:18 +02:00 committed by Jakub Jelinek
parent b2b1ea3455
commit cf25444273
4 changed files with 42 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2018-04-27 Martin Jambor <mjambor@suse.cz>
PR ipa/85549
* ipa-cp.c (find_aggregate_values_for_callers_subset): Make sure
the jump function allows for passing through aggregate values.
2018-04-27 David Malcolm <dmalcolm@redhat.com>
* input.h (in_system_header_at): Convert from macro to inline

View File

@ -4372,7 +4372,9 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node,
{
struct ipa_jump_func *jfunc
= ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
if (self_recursive_pass_through_p (cs, jfunc, i))
if (self_recursive_pass_through_p (cs, jfunc, i)
&& (!plats->aggs_by_ref
|| ipa_get_jf_pass_through_agg_preserved (jfunc)))
continue;
inter = intersect_aggregates_with_edge (cs, i, inter);

View File

@ -1,3 +1,8 @@
2018-04-27 Martin Jambor <mjambor@suse.cz>
PR ipa/85549
* g++.dg/ipa/pr85549.C: New test.
2018-04-27 Jakub Jelinek <jakub@redhat.com>
PR c++/85553

View File

@ -0,0 +1,28 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
#include <vector>
#define N 10
static void visit(int &level, int n, int k, std::vector< int > &value) {
level = level + 1;
value[k] = level;
for (int i = 0 ; i < n; i++)
if (value[i] == 0)
visit(level, n, i, value);
}
void permutations()
{
std::vector< int > value(N);
int level = -1;
visit(level, N, 0, value);
}
void testExtendByBox() {
permutations();
}
int main() {
testExtendByBox();
return 0;
}