OSDN Git Service

Use POINTER_PLUS_EXPR for pointer types.
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Apr 2010 21:02:25 +0000 (21:02 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:17:05 +0000 (14:17 +0900)
2010-04-04  Sebastian Pop  <sebastian.pop@amd.com>

PR middle-end/43519
* graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Use
POINTER_PLUS_EXPR for pointer types.

* gcc.dg/graphite/id-19.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158027 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog.graphite
gcc/graphite-clast-to-gimple.c

index a24f499..89e1a0a 100644 (file)
@@ -1,6 +1,14 @@
 2010-04-04  Sebastian Pop  <sebastian.pop@amd.com>
 
        PR middle-end/43519
+       * graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Use
+       POINTER_PLUS_EXPR for pointer types.
+
+       * gcc.dg/graphite/id-19.c: New.
+
+2010-04-04  Sebastian Pop  <sebastian.pop@amd.com>
+
+       PR middle-end/43519
        * Makefile.in (graphite-clast-to-gimple.o): Depends on langhooks.h.
        * graphite-clast-to-gimple.c: Include langhooks.h.
        (max_signed_precision_type): New.
index 709661d..3b8b946 100644 (file)
@@ -1036,14 +1036,9 @@ graphite_create_new_loop_guard (sese region, edge entry_edge,
   one = gmp_cst_to_tree (type, gmp_one);
   mpz_clear (gmp_one);
 
-  ub_one = fold_build2 (POINTER_TYPE_P (type) ? POINTER_PLUS_EXPR : PLUS_EXPR,
-                       type, ub, one);
-
-  /* When ub + 1 wraps around, use lb <= ub.  */
-  if (integer_zerop (ub_one))
-    cond_expr = fold_build2 (LE_EXPR, boolean_type_node, lb, ub);
-  else
-    cond_expr = fold_build2 (LT_EXPR, boolean_type_node, lb, ub_one);
+  ub = fold_build2 (POINTER_TYPE_P (type) ? POINTER_PLUS_EXPR : PLUS_EXPR,
+                   type, ub, one);
+  cond_expr = fold_build2 (LT_EXPR, boolean_type_node, lb, ub);
 
   exit_edge = create_empty_if_region_on_edge (entry_edge, cond_expr);