diff options
author | Richard Guenther <rguenther@suse.de> | 2009-07-10 11:45:40 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-07-10 11:45:40 +0000 |
commit | 182e00b1ba05699ef2e161d9282636142471e914 (patch) | |
tree | eec3d64e39a28b6deed071242b6536ae53c208b7 /gcc/tree-ssa-loop-manip.c | |
parent | ac7120ce8aef83a746376463906782476b407e9b (diff) | |
download | gcc-182e00b1ba05699ef2e161d9282636142471e914.zip gcc-182e00b1ba05699ef2e161d9282636142471e914.tar.gz gcc-182e00b1ba05699ef2e161d9282636142471e914.tar.bz2 |
re PR tree-optimization/40496 (ICE in verify_stmts with -fprefetch-loop-arrays)
2009-07-10 Richard Guenther <rguenther@suse.de>
PR tree-optimization/40496
* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Create
the PHI result with a compatible type.
* g++.dg/opt/pr40496.C: New testcase.
From-SVN: r149469
Diffstat (limited to 'gcc/tree-ssa-loop-manip.c')
-rw-r--r-- | gcc/tree-ssa-loop-manip.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c index c1514bf..b891ea6 100644 --- a/gcc/tree-ssa-loop-manip.c +++ b/gcc/tree-ssa-loop-manip.c @@ -990,10 +990,19 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor, /* Prefer using original variable as a base for the new ssa name. This is necessary for virtual ops, and useful in order to avoid losing debug info for real ops. */ - if (TREE_CODE (next) == SSA_NAME) + if (TREE_CODE (next) == SSA_NAME + && useless_type_conversion_p (TREE_TYPE (next), + TREE_TYPE (init))) var = SSA_NAME_VAR (next); - else if (TREE_CODE (init) == SSA_NAME) + else if (TREE_CODE (init) == SSA_NAME + && useless_type_conversion_p (TREE_TYPE (init), + TREE_TYPE (next))) var = SSA_NAME_VAR (init); + else if (useless_type_conversion_p (TREE_TYPE (next), TREE_TYPE (init))) + { + var = create_tmp_var (TREE_TYPE (next), "unrinittmp"); + add_referenced_var (var); + } else { var = create_tmp_var (TREE_TYPE (init), "unrinittmp"); |