diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-05-21 10:19:32 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2021-05-21 10:21:09 +0200 |
commit | e5bfda020425f22b67936e916f0b284bad108b65 (patch) | |
tree | 94903a334e1554905aaffabf984923a4671e4d02 /gcc/ada/gcc-interface/misc.c | |
parent | dcde81134cb24da8e261a4346c806c676297922b (diff) | |
download | gcc-e5bfda020425f22b67936e916f0b284bad108b65.zip gcc-e5bfda020425f22b67936e916f0b284bad108b65.tar.gz gcc-e5bfda020425f22b67936e916f0b284bad108b65.tar.bz2 |
Use EXACT_DIV_EXPR as much as possible
...when the division is exact, typically dividing TYPE_SIZE by BITS_PER_UNIT.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Replace
CEIL_DIV_EXPR with EXACT_DIV_EXPR.
* gcc-interface/misc.c (gnat_type_max_size): Likewise.
* gcc-interface/utils.c (maybe_pad_type): Likewise.
(finish_record_type): Likewise. And always compute the unit size.
Diffstat (limited to 'gcc/ada/gcc-interface/misc.c')
-rw-r--r-- | gcc/ada/gcc-interface/misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index f302cf0..72a2624 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -752,7 +752,7 @@ gnat_type_max_size (const_tree gnu_type) type's alignment and return the result in units. */ if (tree_fits_uhwi_p (max_ada_size)) max_size_unit - = size_binop (CEIL_DIV_EXPR, + = size_binop (EXACT_DIV_EXPR, round_up (max_ada_size, TYPE_ALIGN (gnu_type)), bitsize_unit_node); } |