aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils2.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2006-02-17 17:05:46 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2006-02-17 17:05:46 +0100
commitaea625ddaee76c08abeb3d1eccd7bcd63dc455de (patch)
tree04e5ca2a80a1640835e53e495bd47c66b25f210d /gcc/ada/utils2.c
parent69e6a03e46224219467e99564de4f370656931a5 (diff)
downloadgcc-aea625ddaee76c08abeb3d1eccd7bcd63dc455de.zip
gcc-aea625ddaee76c08abeb3d1eccd7bcd63dc455de.tar.gz
gcc-aea625ddaee76c08abeb3d1eccd7bcd63dc455de.tar.bz2
re PR ada/26315 (ACATS failures c43208b c85006a c85006d cd92001)
2006-02-17 Eric Botcazou <botcazou@adacore.com> PR ada/26315 * utils2.c (find_common_type): If both input types are BLKmode and have the same constant size, keep using the first one. * bindgen.adb: (Gen_Versions_Ada): Revert previous workaround. * decl.c (gnat_to_gnu_entity): Only check TREE_OVERFLOW for a constant. * misc.c (gnat_handle_option): New case for -Woverlength-strings. From-SVN: r111183
Diffstat (limited to 'gcc/ada/utils2.c')
-rw-r--r--gcc/ada/utils2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index 4f38e15..ee8dec5 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -232,9 +232,10 @@ find_common_type (tree t1, tree t2)
else if (TYPE_MODE (t2) != BLKmode)
return t2;
- /* If both types have constant size, use the smaller one. */
+ /* If both types have constant size, use the smaller one. Keep returning
+ T1 if we have a tie, to be consistent with the other cases. */
if (TREE_CONSTANT (TYPE_SIZE (t1)) && TREE_CONSTANT (TYPE_SIZE (t2)))
- return tree_int_cst_lt (TYPE_SIZE (t1), TYPE_SIZE (t2)) ? t1 : t2;
+ return tree_int_cst_lt (TYPE_SIZE (t2), TYPE_SIZE (t1)) ? t2 : t1;
/* Otherwise, if either type has a constant size, use it. */
else if (TREE_CONSTANT (TYPE_SIZE (t1)))