diff mbox

[3/3] Avoid use of lang_hooks.types.type_for_size.

Message ID 1311492333-30309-4-git-send-email-sebpop@gmail.com
State New
Headers show

Commit Message

Sebastian Pop July 24, 2011, 7:25 a.m. UTC
2011-07-23  Sebastian Pop  <sebastian.pop@amd.com>

	* tree-data-ref.c (max_stmt_executions_tree): Do not call
	lang_hooks.types.type_for_size.
---
 gcc/ChangeLog       |    5 +++++
 gcc/tree-data-ref.c |    5 ++++-
 2 files changed, 9 insertions(+), 1 deletions(-)

Comments

Richard Biener July 24, 2011, 11:05 a.m. UTC | #1
On Sun, Jul 24, 2011 at 9:25 AM, Sebastian Pop <sebpop@gmail.com> wrote:
> 2011-07-23  Sebastian Pop  <sebastian.pop@amd.com>
>
>        * tree-data-ref.c (max_stmt_executions_tree): Do not call
>        lang_hooks.types.type_for_size.
> ---
>  gcc/ChangeLog       |    5 +++++
>  gcc/tree-data-ref.c |    5 ++++-
>  2 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index e32034f..0d3905f 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,5 +1,10 @@
>  2011-07-23  Sebastian Pop  <sebastian.pop@amd.com>
>
> +       * tree-data-ref.c (max_stmt_executions_tree): Do not call
> +       lang_hooks.types.type_for_size.
> +
> +2011-07-23  Sebastian Pop  <sebastian.pop@amd.com>
> +
>        * 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.
> diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
> index 3e18e8d..800bd27 100644
> --- a/gcc/tree-data-ref.c
> +++ b/gcc/tree-data-ref.c
> @@ -1613,13 +1613,16 @@ analyze_ziv_subscript (tree chrec_a,
>  static tree
>  max_stmt_executions_tree (struct loop *loop)
>  {
> +  enum machine_mode mode;
>   double_int nit;
>   tree type;
>
>   if (!max_stmt_executions (loop, true, &nit))
>     return chrec_dont_know;
>
> -  type = lang_hooks.types.type_for_size (INT_TYPE_SIZE, true);
> +  mode = smallest_mode_for_size (INT_TYPE_SIZE, MODE_INT);
> +  type = build_nonstandard_integer_type (GET_MODE_PRECISION (mode), true);
> +

I think you simply want to use unsigned_type_node here.

Okw ith that change.

Thanks,
Richard.

>   if (!double_int_fits_to_tree_p (type, nit))
>     return chrec_dont_know;
>
> --
> 1.7.4.1
>
>
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e32034f..0d3905f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@ 
 2011-07-23  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* tree-data-ref.c (max_stmt_executions_tree): Do not call
+	lang_hooks.types.type_for_size.
+
+2011-07-23  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* 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.
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 3e18e8d..800bd27 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -1613,13 +1613,16 @@  analyze_ziv_subscript (tree chrec_a,
 static tree
 max_stmt_executions_tree (struct loop *loop)
 {
+  enum machine_mode mode;
   double_int nit;
   tree type;
 
   if (!max_stmt_executions (loop, true, &nit))
     return chrec_dont_know;
 
-  type = lang_hooks.types.type_for_size (INT_TYPE_SIZE, true);
+  mode = smallest_mode_for_size (INT_TYPE_SIZE, MODE_INT);
+  type = build_nonstandard_integer_type (GET_MODE_PRECISION (mode), true);
+
   if (!double_int_fits_to_tree_p (type, nit))
     return chrec_dont_know;