summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2016-09-20 21:49:12 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2016-09-20 21:49:12 +0000
commitc9c81ef3c667aaa14c498a5449ec6d134b4b66ff (patch)
tree0ac440db6513ee01deb5e5dc6142769d1e5b7b2d /gcc/builtins.c
parent12cdcb9d74f55c165366ca1b1eeec013a0ce72ef (diff)
parent891196d7325e4c55d92d5ac5cfe7161c4f36c0ce (diff)
downloadgcc-fortran-dev.tar.gz
Merge from trunk (r239915 to r240230)fortran-dev
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/fortran-dev@240290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index b981bcd281a..189aeac6912 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -305,7 +305,7 @@ get_object_alignment_2 (tree exp, unsigned int *alignp,
{
ptr_bitmask = TREE_INT_CST_LOW (TREE_OPERAND (addr, 1));
ptr_bitmask *= BITS_PER_UNIT;
- align = ptr_bitmask & -ptr_bitmask;
+ align = least_bit_hwi (ptr_bitmask);
addr = TREE_OPERAND (addr, 0);
}
@@ -325,7 +325,7 @@ get_object_alignment_2 (tree exp, unsigned int *alignp,
unsigned HOST_WIDE_INT step = 1;
if (TMR_STEP (exp))
step = TREE_INT_CST_LOW (TMR_STEP (exp));
- align = MIN (align, (step & -step) * BITS_PER_UNIT);
+ align = MIN (align, least_bit_hwi (step) * BITS_PER_UNIT);
}
if (TMR_INDEX2 (exp))
align = BITS_PER_UNIT;
@@ -404,7 +404,7 @@ get_object_alignment (tree exp)
ptr & (align - 1) == bitpos. */
if (bitpos != 0)
- align = (bitpos & -bitpos);
+ align = least_bit_hwi (bitpos);
return align;
}
@@ -502,7 +502,7 @@ get_pointer_alignment (tree exp)
ptr & (align - 1) == bitpos. */
if (bitpos != 0)
- align = (bitpos & -bitpos);
+ align = least_bit_hwi (bitpos);
return align;
}
@@ -862,7 +862,6 @@ expand_builtin_setjmp_receiver (rtx receiver_label)
if (!HARD_FRAME_POINTER_IS_ARG_POINTER && fixed_regs[ARG_POINTER_REGNUM])
{
-#ifdef ELIMINABLE_REGS
/* If the argument pointer can be eliminated in favor of the
frame pointer, we don't need to restore it. We assume here
that if such an elimination is present, it can always be used.
@@ -877,7 +876,6 @@ expand_builtin_setjmp_receiver (rtx receiver_label)
break;
if (i == ARRAY_SIZE (elim_regs))
-#endif
{
/* Now restore our arg pointer from the address at which it
was saved in our stack frame. */
@@ -4089,10 +4087,6 @@ std_canonical_va_list_type (tree type)
{
tree wtype, htype;
- if (INDIRECT_REF_P (type))
- type = TREE_TYPE (type);
- else if (POINTER_TYPE_P (type) && POINTER_TYPE_P (TREE_TYPE (type)))
- type = TREE_TYPE (type);
wtype = va_list_type_node;
htype = type;
/* Treat structure va_list types. */
@@ -5565,7 +5559,7 @@ fold_builtin_atomic_always_lock_free (tree arg0, tree arg1)
/* Either this argument is null, or it's a fake pointer encoding
the alignment of the object. */
- val = val & -val;
+ val = least_bit_hwi (val);
val *= BITS_PER_UNIT;
if (val == 0 || mode_align < val)
@@ -9615,7 +9609,7 @@ fold_builtin_object_size (tree ptr, tree ost)
if (TREE_CODE (ptr) == ADDR_EXPR)
{
- bytes = compute_builtin_object_size (ptr, object_size_type);
+ compute_builtin_object_size (ptr, object_size_type, &bytes);
if (wi::fits_to_tree_p (bytes, size_type_node))
return build_int_cstu (size_type_node, bytes);
}
@@ -9624,9 +9618,8 @@ fold_builtin_object_size (tree ptr, tree ost)
/* If object size is not known yet, delay folding until
later. Maybe subsequent passes will help determining
it. */
- bytes = compute_builtin_object_size (ptr, object_size_type);
- if (bytes != (unsigned HOST_WIDE_INT) (object_size_type < 2 ? -1 : 0)
- && wi::fits_to_tree_p (bytes, size_type_node))
+ if (compute_builtin_object_size (ptr, object_size_type, &bytes)
+ && wi::fits_to_tree_p (bytes, size_type_node))
return build_int_cstu (size_type_node, bytes);
}