aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2011-07-27 16:53:09 +0000
committerSebastian Pop <spop@gcc.gnu.org>2011-07-27 16:53:09 +0000
commit3689198db0121443b06f1bbe4e1c34286acb3f32 (patch)
treee1b8b759d9b426b961abafcc38d68c6a098bae4d
parent27165eddf6cd08f66d24bfd7751675cfb84c6a6c (diff)
downloadgcc-3689198db0121443b06f1bbe4e1c34286acb3f32.zip
gcc-3689198db0121443b06f1bbe4e1c34286acb3f32.tar.gz
gcc-3689198db0121443b06f1bbe4e1c34286acb3f32.tar.bz2
Fix PR49471: canonicalize_loop_ivs should not generate unsigned types.
2011-07-27 Sebastian Pop <sebastian.pop@amd.com> PR tree-optimization/49471 * tree-ssa-loop-manip.c (canonicalize_loop_ivs): Build an unsigned iv only when the largest type is unsigned. Do not call lang_hooks.types.type_for_size. * testsuite/libgomp.graphite/force-parallel-1.c: Un-xfail. * testsuite/libgomp.graphite/force-parallel-2.c: Adjust pattern. From-SVN: r176838
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-ssa-loop-manip.c24
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.graphite/force-parallel-1.c2
-rw-r--r--libgomp/testsuite/libgomp.graphite/force-parallel-2.c2
5 files changed, 35 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 46e8c0e..b07d494 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2011-07-27 Sebastian Pop <sebastian.pop@amd.com>
+ PR tree-optimization/49471
+ * tree-ssa-loop-manip.c (canonicalize_loop_ivs): Build an unsigned
+ iv only when the largest type is unsigned. Do not call
+ lang_hooks.types.type_for_size.
+
+2011-07-27 Sebastian Pop <sebastian.pop@amd.com>
+
PR middle-end/45450
* graphite-poly.c (apply_poly_transforms): Disable legality check
after an openscop read.
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index 8176ed8..0cec787 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -1200,18 +1200,36 @@ canonicalize_loop_ivs (struct loop *loop, tree *nit, bool bump_in_latch)
gimple stmt;
edge exit = single_dom_exit (loop);
gimple_seq stmts;
+ enum machine_mode mode;
+ bool unsigned_p = false;
for (psi = gsi_start_phis (loop->header);
!gsi_end_p (psi); gsi_next (&psi))
{
gimple phi = gsi_stmt (psi);
tree res = PHI_RESULT (phi);
+ bool uns;
- if (is_gimple_reg (res) && TYPE_PRECISION (TREE_TYPE (res)) > precision)
- precision = TYPE_PRECISION (TREE_TYPE (res));
+ type = TREE_TYPE (res);
+ if (!is_gimple_reg (res)
+ || (!INTEGRAL_TYPE_P (type)
+ && !POINTER_TYPE_P (type))
+ || TYPE_PRECISION (type) < precision)
+ continue;
+
+ uns = POINTER_TYPE_P (type) | TYPE_UNSIGNED (type);
+
+ if (TYPE_PRECISION (type) > precision)
+ unsigned_p = uns;
+ else
+ unsigned_p |= uns;
+
+ precision = TYPE_PRECISION (type);
}
- type = lang_hooks.types.type_for_size (precision, 1);
+ mode = smallest_mode_for_size (precision, MODE_INT);
+ precision = GET_MODE_PRECISION (mode);
+ type = build_nonstandard_integer_type (precision, unsigned_p);
if (original_precision != precision)
{
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index c6d9ffd..b9455b4 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-23 Sebastian Pop <sebastian.pop@amd.com>
+
+ * testsuite/libgomp.graphite/force-parallel-1.c: Un-xfail.
+ * testsuite/libgomp.graphite/force-parallel-2.c: Adjust pattern.
+
2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR libgomp/45351
diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-1.c b/libgomp/testsuite/libgomp.graphite/force-parallel-1.c
index 71ed332..7f043d8 100644
--- a/libgomp/testsuite/libgomp.graphite/force-parallel-1.c
+++ b/libgomp/testsuite/libgomp.graphite/force-parallel-1.c
@@ -23,7 +23,7 @@ int main(void)
}
/* Check that parallel code generation part make the right answer. */
-/* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 2 "graphite" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 2 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
/* { dg-final { cleanup-tree-dump "parloops" } } */
diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-2.c b/libgomp/testsuite/libgomp.graphite/force-parallel-2.c
index 1ce0feb..03d8236 100644
--- a/libgomp/testsuite/libgomp.graphite/force-parallel-2.c
+++ b/libgomp/testsuite/libgomp.graphite/force-parallel-2.c
@@ -23,7 +23,7 @@ int main(void)
}
/* Check that parallel code generation part make the right answer. */
-/* { dg-final { scan-tree-dump-times "2 loops carried no dependency" 1 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "2 loops carried no dependency" 2 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
/* { dg-final { cleanup-tree-dump "parloops" } } */