summaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-29 23:35:12 +0000
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-29 23:35:12 +0000
commit4765975cb2f85d61e801d12562b39da2d1e25f2c (patch)
tree94afbeb41e705981bf09d1e0992c8f8c7f911054 /gcc/expmed.c
parent91ae0791cbebaac673e42e53c8b7f000241a0ca1 (diff)
downloadgcc-4765975cb2f85d61e801d12562b39da2d1e25f2c.tar.gz
* cppbuiltin.c (define_builtin_macros_for_type_sizes): Round
pointer size up to a power of two. * defaults.h (DWARF2_ADDR_SIZE): Round up. (POINTER_SIZE_UNITS): New, rounded up value. * dwarf2asm.c (size_of_encoded_value): Use it. (dw2_output_indirect_constant_1): Likewise. * expmed.c (init_expmed_one_conv): We now know the sizes of partial int modes. * loop-iv.c (iv_number_of_iterations): Use precision, not size. * optabs.c (expand_float): Use precision, not size. (expand_fix): Likewise. * simplify-rtx (simplify_unary_operation_1): Likewise. * tree-dfa.c (get_ref_base_and_extent): Likewise. * varasm.c (assemble_addr_to_section): Round up pointer sizes. (default_assemble_integer) Likewise. (dump_tm_clone_pairs): Likewise. * dwarf2out.c (mem_loc_descriptor): Allow partial-int modes also. * var-tracking.c (adjust_mems): Allow partial-int modes also. (prepare_call_arguments): Likewise. * stor-layout.c (finalize_type_size): Preserve precision. (layout_type): Use precision, not size. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214748 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 7b71616a2fa..1eb712e84ba 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -118,13 +118,19 @@ init_expmed_one_conv (struct init_expmed_rtl *all, enum machine_mode to_mode,
int to_size, from_size;
rtx which;
- /* We're given no information about the true size of a partial integer,
- only the size of the "full" integer it requires for storage. For
- comparison purposes here, reduce the bit size by one in that case. */
- to_size = (GET_MODE_BITSIZE (to_mode)
- - (GET_MODE_CLASS (to_mode) == MODE_PARTIAL_INT));
- from_size = (GET_MODE_BITSIZE (from_mode)
- - (GET_MODE_CLASS (from_mode) == MODE_PARTIAL_INT));
+ to_size = GET_MODE_PRECISION (to_mode);
+ from_size = GET_MODE_PRECISION (from_mode);
+
+ /* Most partial integers have a precision less than the "full"
+ integer it requires for storage. In case one doesn't, for
+ comparison purposes here, reduce the bit size by one in that
+ case. */
+ if (GET_MODE_CLASS (to_mode) == MODE_PARTIAL_INT
+ && exact_log2 (to_size) != -1)
+ to_size --;
+ if (GET_MODE_CLASS (from_mode) == MODE_PARTIAL_INT
+ && exact_log2 (from_size) != -1)
+ from_size --;
/* Assume cost of zero-extend and sign-extend is the same. */
which = (to_size < from_size ? all->trunc : all->zext);