mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-27 04:30:25 +08:00
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
This commit is contained in:
parent
830bc5507b
commit
3ed7d068d9
@ -1,3 +1,9 @@
|
|||||||
|
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>
|
2010-01-28 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
* tree-ssa-ccp.c (ccp_fold_stmt): Fold calls and propagate
|
* tree-ssa-ccp.c (ccp_fold_stmt): Fold calls and propagate
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
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>
|
2010-01-28 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
* gcc.dg/Wobjsize-1.h: New testcase.
|
* gcc.dg/Wobjsize-1.h: New testcase.
|
||||||
|
40
gcc/testsuite/g++.dg/torture/pr42871.C
Normal file
40
gcc/testsuite/g++.dg/torture/pr42871.C
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
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);
|
translated = phi_translate (expr, set, NULL, pred, phiblock);
|
||||||
|
|
||||||
/* Don't add empty translations to the cache */
|
/* Don't add empty translations to the cache */
|
||||||
if (translated)
|
if (!translated)
|
||||||
phi_trans_add (expr, translated, pred);
|
continue;
|
||||||
|
|
||||||
if (translated != NULL)
|
phi_trans_add (expr, translated, pred);
|
||||||
|
|
||||||
|
/* 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);
|
bitmap_value_insert_into_set (dest, translated);
|
||||||
}
|
}
|
||||||
VEC_free (pre_expr, heap, exprs);
|
VEC_free (pre_expr, heap, exprs);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user