diff options
Diffstat (limited to 'gcc/ada/utils2.c')
-rw-r--r-- | gcc/ada/utils2.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c index 4f38e15fdf3..ee8dec57d43 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))) |