This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][pointer-plus] Make x86_64 work
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 15 May 2007 17:13:23 +0200 (CEST)
- Subject: [PATCH][pointer-plus] Make x86_64 work
This makes x86_64 bootstrap and regtest work (java and obj-c++ are still
somewhat broken). But at least c, c++, fortran and ada are clean.
Bootstrapped and tested on x86_64-unknown-linux-gnu.
Richard.
2007-05-15 Richard Guenther <rguenther@suse.de>
* config/i386/i386.c (ix86_gimplify_va_arg): Use POINTER_PLUS_EXPR,
perform BIT_AND_EXPR on sizetype arguments.
* trans-intrinsic.c (gfc_conv_intrinsic_repeat): Likewise.
Index: fortran/trans-intrinsic.c
===================================================================
*** fortran/trans-intrinsic.c (revision 124740)
--- fortran/trans-intrinsic.c (working copy)
*************** gfc_conv_intrinsic_repeat (gfc_se * se,
*** 3457,3464 ****
/* Call memmove (dest + (i*slen), src, slen). */
tmp = fold_build2 (MULT_EXPR, gfc_charlen_type_node, slen,
fold_convert (gfc_charlen_type_node, count));
! tmp = fold_build2 (PLUS_EXPR, pchar_type_node, dest,
! fold_convert (pchar_type_node, tmp));
tmp = build_call_expr (built_in_decls[BUILT_IN_MEMMOVE], 3,
tmp, src, slen);
gfc_add_expr_to_block (&body, tmp);
--- 3457,3464 ----
/* Call memmove (dest + (i*slen), src, slen). */
tmp = fold_build2 (MULT_EXPR, gfc_charlen_type_node, slen,
fold_convert (gfc_charlen_type_node, count));
! tmp = fold_build2 (POINTER_PLUS_EXPR, pchar_type_node, dest,
! fold_convert (sizetype, tmp));
tmp = build_call_expr (built_in_decls[BUILT_IN_MEMMOVE], 3,
tmp, src, slen);
gfc_add_expr_to_block (&body, tmp);
Index: config/i386/i386.c
===================================================================
*** config/i386/i386.c (revision 124740)
--- config/i386/i386.c (working copy)
*************** ix86_gimplify_va_arg (tree valist, tree
*** 4939,4948 ****
else
{
HOST_WIDE_INT align = FUNCTION_ARG_BOUNDARY (VOIDmode, type) / 8;
! t = build2 (PLUS_EXPR, TREE_TYPE (ovf), ovf,
! build_int_cst (TREE_TYPE (ovf), align - 1));
! t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
! build_int_cst (TREE_TYPE (t), -align));
}
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
--- 4939,4949 ----
else
{
HOST_WIDE_INT align = FUNCTION_ARG_BOUNDARY (VOIDmode, type) / 8;
! t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovf),
! ovf, size_int (align - 1));
! t = build2 (BIT_AND_EXPR, sizetype,
! fold_convert (sizetype, t), size_int (-align));
! t = fold_convert (TREE_TYPE (ovf), t);
}
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);