re PR tree-optimization/41661 (ICE due to IPCP trying to create/fold a REAL typed comparision)
2009-10-13 Martin Jambor <mjambor@suse.cz> PR tree-optimization/41661 * ipa-prop.c (compute_complex_pass_through): Allow only operations that are tcc_comparisons or do not change the type in any un-usleless way. * ipa-cp.c (ipcp_lattice_from_jfunc): Request boolean type when folding tcc_comparison operations. * testsuite/gcc.c-torture/compile/pr41661.c: New test. From-SVN: r152702
This commit is contained in:
parent
3525f49b5a
commit
c4e5fe4b51
5 changed files with 46 additions and 3 deletions
|
@ -1,3 +1,12 @@
|
|||
2009-10-13 Martin Jambor <mjambor@suse.cz>
|
||||
|
||||
PR tree-optimization/41661
|
||||
* ipa-prop.c (compute_complex_pass_through): Allow only operations
|
||||
that are tcc_comparisons or do not change the type in any
|
||||
un-usleless way.
|
||||
* ipa-cp.c (ipcp_lattice_from_jfunc): Request boolean type when
|
||||
folding tcc_comparison operations.
|
||||
|
||||
2009-10-13 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
|
||||
|
||||
* config/s390/s390.c (s390_encode_section_info): Handle BLKmode
|
||||
|
|
11
gcc/ipa-cp.c
11
gcc/ipa-cp.c
|
@ -299,9 +299,16 @@ ipcp_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat,
|
|||
cst = caller_lat->constant;
|
||||
|
||||
if (jfunc->value.pass_through.operation != NOP_EXPR)
|
||||
{
|
||||
tree restype;
|
||||
if (TREE_CODE_CLASS (jfunc->value.pass_through.operation)
|
||||
== tcc_comparison)
|
||||
restype = boolean_type_node;
|
||||
else
|
||||
restype = TREE_TYPE (cst);
|
||||
cst = fold_binary (jfunc->value.pass_through.operation,
|
||||
TREE_TYPE (cst), cst,
|
||||
jfunc->value.pass_through.operand);
|
||||
restype, cst, jfunc->value.pass_through.operand);
|
||||
}
|
||||
if (!cst || !is_gimple_ip_invariant (cst))
|
||||
lat->type = IPA_BOTTOM;
|
||||
lat->constant = cst;
|
||||
|
|
|
@ -357,6 +357,9 @@ compute_complex_pass_through (struct ipa_node_params *info,
|
|||
{
|
||||
if (TREE_CODE (op1) != SSA_NAME
|
||||
|| !SSA_NAME_IS_DEFAULT_DEF (op1)
|
||||
|| (TREE_CODE_CLASS (gimple_expr_code (stmt)) != tcc_comparison
|
||||
&& !useless_type_conversion_p (TREE_TYPE (name),
|
||||
TREE_TYPE (op1)))
|
||||
|| !is_gimple_ip_invariant (op2))
|
||||
return;
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2009-10-13 Martin Jambor <mjambor@suse.cz>
|
||||
|
||||
* gcc.c-torture/compile/pr41661.c: New test.
|
||||
|
||||
2009-10-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libgfortran/41683
|
||||
|
|
20
gcc/testsuite/gcc.c-torture/compile/pr41661.c
Normal file
20
gcc/testsuite/gcc.c-torture/compile/pr41661.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
/* PR tree-optimization/41661 */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fno-early-inlining" } */
|
||||
|
||||
int g;
|
||||
|
||||
void foo (int x)
|
||||
{
|
||||
g = x;
|
||||
}
|
||||
|
||||
void bar (double d)
|
||||
{
|
||||
foo (d == 1);
|
||||
}
|
||||
|
||||
void baz (int a)
|
||||
{
|
||||
bar (1);
|
||||
}
|
Loading…
Add table
Reference in a new issue