Commit 3ed7d068 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/42871 (g++: Internal error: Segmentation fault (program cc1plus))

2010-01-28  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/42871
	* tree-ssa-pre.c (phi_translate_set): Make sure to retain
	leaders.

	* g++.dg/torture/pr42871.C: New testcase.

From-SVN: r156324
parent 830bc550
2010-01-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42871
* tree-ssa-pre.c (phi_translate_set): Make sure to retain
leaders.
2010-01-28 Richard Guenther <rguenther@suse.de>
* tree-ssa-ccp.c (ccp_fold_stmt): Fold calls and propagate
into call arguments.
......
2010-01-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42871
* g++.dg/torture/pr42871.C: New testcase.
2010-01-28 Richard Guenther <rguenther@suse.de>
* gcc.dg/Wobjsize-1.h: New testcase.
* gcc.dg/Wobjsize-1.c: Likewise.
......
struct C
{
~C ();
int c3;
};
C *b2;
static void
b1 (const C &x, unsigned b3, unsigned b4)
{
unsigned i = 0;
for (; i < b3; i++)
if (i < b4)
{
b2[0].c3 = x.c3;
return;
}
}
int a ();
void
bar (unsigned b3, unsigned b4)
{
C c[100];
for (int i = 0; i < 100; i++)
{
c[i].c3 = i;
for (int j = 0; j < b3; j++)
if (j < b4)
{
b2[0].c3 = 0;
break;
}
b1 (c[i], b3, b4);
a ();
}
}
......@@ -1836,10 +1836,18 @@ phi_translate_set (bitmap_set_t dest, bitmap_set_t set, basic_block pred,
translated = phi_translate (expr, set, NULL, pred, phiblock);
/* Don't add empty translations to the cache */
if (translated)
phi_trans_add (expr, translated, pred);
if (!translated)
continue;
phi_trans_add (expr, translated, pred);
if (translated != NULL)
/* We might end up with multiple expressions from SET being
translated to the same value. In this case we do not want
to retain the NARY or REFERENCE expression but prefer a NAME
which would be the leader. */
if (translated->kind == NAME)
bitmap_value_replace_in_set (dest, translated);
else
bitmap_value_insert_into_set (dest, translated);
}
VEC_free (pre_expr, heap, exprs);
......
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