From d25f3b83ce00e7b7750bcfb9d564a318313b60ab Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 10 Nov 2005 16:24:54 +0000 Subject: [PATCH] tree.c (int_fits_type_p): Only look at the base type if it has the same precision as the original type. * tree.c (int_fits_type_p): Only look at the base type if it has the same precision as the original type. From-SVN: r106738 --- gcc/ChangeLog | 5 +++++ gcc/tree.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3bc2fde69cf4..9e133b12073a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-11-10 Eric Botcazou + + * tree.c (int_fits_type_p): Only look at the base type + if it has the same precision as the original type. + 2005-11-10 Jakub Jelinek PR other/4372 diff --git a/gcc/tree.c b/gcc/tree.c index 4edccd5c2322..d5ce531300a7 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -5558,8 +5558,11 @@ int_fits_type_p (tree c, tree type) return 0; /* If we haven't been able to decide at this point, there nothing more we - can check ourselves here. Look at the base type if we have one. */ - if (TREE_CODE (type) == INTEGER_TYPE && TREE_TYPE (type) != 0) + can check ourselves here. Look at the base type if we have one and it + has the same precision. */ + if (TREE_CODE (type) == INTEGER_TYPE + && TREE_TYPE (type) != 0 + && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (type))) return int_fits_type_p (c, TREE_TYPE (type)); /* Or to force_fit_type, if nothing else. */ -- 2.47.3