This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
S/390: Use ISO C syntax for function pointer calls
- From: "Ulrich Weigand" <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 23 Aug 2003 17:41:47 +0200 (CEST)
- Subject: S/390: Use ISO C syntax for function pointer calls
Hello,
as we no longer require K&R compatibility, this patch removes the
awkward K&R syntax for calling function pointers.
Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux.
Bye,
Ulrich
ChangeLog:
* config/s390/s390.c (s390_expand_movstr, s390_expand_clrstr,
s390_expand_cmpmem, s390_output_constant_pool, s390_build_va_list,
s390_function_profiler, s390_output_mi_thunk): Use ISO C syntax
for function pointer calls.
* config/s390/s390.md ("*negdi2_31"): Likewise.
Index: gcc/config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.108
diff -c -p -r1.108 s390.c
*** gcc/config/s390/s390.c 23 Aug 2003 00:17:35 -0000 1.108
--- gcc/config/s390/s390.c 23 Aug 2003 00:34:32 -0000
*************** s390_expand_movstr (rtx dst, rtx src, rt
*** 2855,2861 ****
if (GET_CODE (len) == CONST_INT && INTVAL (len) >= 0 && INTVAL (len) <= 256)
{
if (INTVAL (len) > 0)
! emit_insn ((*gen_short) (dst, src, GEN_INT (INTVAL (len) - 1)));
}
else if (TARGET_MVCLE)
--- 2855,2861 ----
if (GET_CODE (len) == CONST_INT && INTVAL (len) >= 0 && INTVAL (len) <= 256)
{
if (INTVAL (len) > 0)
! emit_insn (gen_short (dst, src, GEN_INT (INTVAL (len) - 1)));
}
else if (TARGET_MVCLE)
*************** s390_expand_movstr (rtx dst, rtx src, rt
*** 2873,2879 ****
convert_move (gen_lowpart (single_mode, reg0), len, 1);
convert_move (gen_lowpart (single_mode, reg1), len, 1);
! emit_insn ((*gen_long) (reg0, reg1, reg0, reg1));
}
else
--- 2873,2879 ----
convert_move (gen_lowpart (single_mode, reg0), len, 1);
convert_move (gen_lowpart (single_mode, reg1), len, 1);
! emit_insn (gen_long (reg0, reg1, reg0, reg1));
}
else
*************** s390_expand_movstr (rtx dst, rtx src, rt
*** 2887,2893 ****
if (mode == VOIDmode)
mode = word_mode;
! type = (*lang_hooks.types.type_for_mode) (mode, 1);
if (!type)
abort ();
--- 2887,2893 ----
if (mode == VOIDmode)
mode = word_mode;
! type = lang_hooks.types.type_for_mode (mode, 1);
if (!type)
abort ();
*************** s390_expand_movstr (rtx dst, rtx src, rt
*** 2918,2924 ****
make_tree (type, blocks),
make_tree (type, const0_rtx)));
! emit_insn ((*gen_short) (dst, src, GEN_INT (255)));
s390_load_address (dst_addr,
gen_rtx_PLUS (Pmode, dst_addr, GEN_INT (256)));
s390_load_address (src_addr,
--- 2918,2924 ----
make_tree (type, blocks),
make_tree (type, const0_rtx)));
! emit_insn (gen_short (dst, src, GEN_INT (255)));
s390_load_address (dst_addr,
gen_rtx_PLUS (Pmode, dst_addr, GEN_INT (256)));
s390_load_address (src_addr,
*************** s390_expand_movstr (rtx dst, rtx src, rt
*** 2930,2936 ****
expand_end_loop ();
! emit_insn ((*gen_short) (dst, src, convert_to_mode (word_mode, count, 1)));
emit_label (end_label);
}
}
--- 2930,2936 ----
expand_end_loop ();
! emit_insn (gen_short (dst, src, convert_to_mode (word_mode, count, 1)));
emit_label (end_label);
}
}
*************** s390_expand_clrstr (rtx dst, rtx len)
*** 2949,2955 ****
if (GET_CODE (len) == CONST_INT && INTVAL (len) >= 0 && INTVAL (len) <= 256)
{
if (INTVAL (len) > 0)
! emit_insn ((*gen_short) (dst, GEN_INT (INTVAL (len) - 1)));
}
else if (TARGET_MVCLE)
--- 2949,2955 ----
if (GET_CODE (len) == CONST_INT && INTVAL (len) >= 0 && INTVAL (len) <= 256)
{
if (INTVAL (len) > 0)
! emit_insn (gen_short (dst, GEN_INT (INTVAL (len) - 1)));
}
else if (TARGET_MVCLE)
*************** s390_expand_clrstr (rtx dst, rtx len)
*** 2966,2972 ****
emit_move_insn (gen_highpart (single_mode, reg1), const0_rtx);
emit_move_insn (gen_lowpart (single_mode, reg1), const0_rtx);
! emit_insn ((*gen_long) (reg0, reg1, reg0));
}
else
--- 2966,2972 ----
emit_move_insn (gen_highpart (single_mode, reg1), const0_rtx);
emit_move_insn (gen_lowpart (single_mode, reg1), const0_rtx);
! emit_insn (gen_long (reg0, reg1, reg0));
}
else
*************** s390_expand_clrstr (rtx dst, rtx len)
*** 2980,2986 ****
if (mode == VOIDmode)
mode = word_mode;
! type = (*lang_hooks.types.type_for_mode) (mode, 1);
if (!type)
abort ();
--- 2980,2986 ----
if (mode == VOIDmode)
mode = word_mode;
! type = lang_hooks.types.type_for_mode (mode, 1);
if (!type)
abort ();
*************** s390_expand_clrstr (rtx dst, rtx len)
*** 3009,3015 ****
make_tree (type, blocks),
make_tree (type, const0_rtx)));
! emit_insn ((*gen_short) (dst, GEN_INT (255)));
s390_load_address (dst_addr,
gen_rtx_PLUS (Pmode, dst_addr, GEN_INT (256)));
--- 3009,3015 ----
make_tree (type, blocks),
make_tree (type, const0_rtx)));
! emit_insn (gen_short (dst, GEN_INT (255)));
s390_load_address (dst_addr,
gen_rtx_PLUS (Pmode, dst_addr, GEN_INT (256)));
*************** s390_expand_clrstr (rtx dst, rtx len)
*** 3019,3025 ****
expand_end_loop ();
! emit_insn ((*gen_short) (dst, convert_to_mode (word_mode, count, 1)));
emit_label (end_label);
}
}
--- 3019,3025 ----
expand_end_loop ();
! emit_insn (gen_short (dst, convert_to_mode (word_mode, count, 1)));
emit_label (end_label);
}
}
*************** s390_expand_cmpmem (rtx target, rtx op0,
*** 3045,3052 ****
{
if (INTVAL (len) > 0)
{
! emit_insn ((*gen_short) (op0, op1, GEN_INT (INTVAL (len) - 1)));
! emit_insn ((*gen_result) (target));
}
else
emit_move_insn (target, const0_rtx);
--- 3045,3052 ----
{
if (INTVAL (len) > 0)
{
! emit_insn (gen_short (op0, op1, GEN_INT (INTVAL (len) - 1)));
! emit_insn (gen_result (target));
}
else
emit_move_insn (target, const0_rtx);
*************** s390_expand_cmpmem (rtx target, rtx op0,
*** 3067,3074 ****
convert_move (gen_lowpart (single_mode, reg0), len, 1);
convert_move (gen_lowpart (single_mode, reg1), len, 1);
! emit_insn ((*gen_long) (reg0, reg1, reg0, reg1));
! emit_insn ((*gen_result) (target));
}
#if 0
--- 3067,3074 ----
convert_move (gen_lowpart (single_mode, reg0), len, 1);
convert_move (gen_lowpart (single_mode, reg1), len, 1);
! emit_insn (gen_long (reg0, reg1, reg0, reg1));
! emit_insn (gen_result (target));
}
#if 0
*************** s390_expand_cmpmem (rtx target, rtx op0,
*** 3085,3091 ****
if (mode == VOIDmode)
mode = word_mode;
! type = (*lang_hooks.types.type_for_mode) (mode, 1);
if (!type)
abort ();
--- 3085,3091 ----
if (mode == VOIDmode)
mode = word_mode;
! type = lang_hooks.types.type_for_mode (mode, 1);
if (!type)
abort ();
*************** s390_expand_cmpmem (rtx target, rtx op0,
*** 3116,3122 ****
make_tree (type, blocks),
make_tree (type, const0_rtx)));
! emit_insn ((*gen_short) (op0, op1, GEN_INT (255)));
temp = gen_rtx_NE (VOIDmode, gen_rtx_REG (CCSmode, 33), const0_rtx);
temp = gen_rtx_IF_THEN_ELSE (VOIDmode, temp,
gen_rtx_LABEL_REF (VOIDmode, end_label), pc_rtx);
--- 3116,3122 ----
make_tree (type, blocks),
make_tree (type, const0_rtx)));
! emit_insn (gen_short (op0, op1, GEN_INT (255)));
temp = gen_rtx_NE (VOIDmode, gen_rtx_REG (CCSmode, 33), const0_rtx);
temp = gen_rtx_IF_THEN_ELSE (VOIDmode, temp,
gen_rtx_LABEL_REF (VOIDmode, end_label), pc_rtx);
*************** s390_expand_cmpmem (rtx target, rtx op0,
*** 3134,3143 ****
expand_end_loop ();
! emit_insn ((*gen_short) (op0, op1, convert_to_mode (word_mode, count, 1)));
emit_label (end_label);
! emit_insn ((*gen_result) (target));
}
#endif
}
--- 3134,3143 ----
expand_end_loop ();
! emit_insn (gen_short (op0, op1, convert_to_mode (word_mode, count, 1)));
emit_label (end_label);
! emit_insn (gen_result (target));
}
#endif
}
*************** s390_output_constant_pool (rtx start_lab
*** 4696,4708 ****
{
readonly_data_section ();
ASM_OUTPUT_ALIGN (asm_out_file, 3);
! (*targetm.asm_out.internal_label) (asm_out_file, "L",
! CODE_LABEL_NUMBER (start_label));
}
else
{
! (*targetm.asm_out.internal_label) (asm_out_file, "L",
! CODE_LABEL_NUMBER (start_label));
ASM_OUTPUT_ALIGN (asm_out_file, 2);
}
--- 4696,4708 ----
{
readonly_data_section ();
ASM_OUTPUT_ALIGN (asm_out_file, 3);
! targetm.asm_out.internal_label (asm_out_file, "L",
! CODE_LABEL_NUMBER (start_label));
}
else
{
! targetm.asm_out.internal_label (asm_out_file, "L",
! CODE_LABEL_NUMBER (start_label));
ASM_OUTPUT_ALIGN (asm_out_file, 2);
}
*************** s390_output_constant_pool (rtx start_lab
*** 4714,4721 ****
else
{
ASM_OUTPUT_ALIGN (asm_out_file, 1);
! (*targetm.asm_out.internal_label) (asm_out_file, "L",
! CODE_LABEL_NUMBER (end_label));
}
}
--- 4714,4721 ----
else
{
ASM_OUTPUT_ALIGN (asm_out_file, 1);
! targetm.asm_out.internal_label (asm_out_file, "L",
! CODE_LABEL_NUMBER (end_label));
}
}
*************** s390_build_va_list (void)
*** 5883,5889 ****
{
tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl;
! record = (*lang_hooks.types.make_type) (RECORD_TYPE);
type_decl =
build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
--- 5883,5889 ----
{
tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl;
! record = lang_hooks.types.make_type (RECORD_TYPE);
type_decl =
build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
*************** s390_function_profiler (FILE *file, int
*** 6401,6407 ****
output_asm_insn ("bras\t%2,%l6", op);
output_asm_insn (".long\t%4", op);
output_asm_insn (".long\t%3", op);
! (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[6]));
output_asm_insn ("l\t%0,0(%2)", op);
output_asm_insn ("l\t%2,4(%2)", op);
output_asm_insn ("basr\t%0,%0", op);
--- 6401,6407 ----
output_asm_insn ("bras\t%2,%l6", op);
output_asm_insn (".long\t%4", op);
output_asm_insn (".long\t%3", op);
! targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (op[6]));
output_asm_insn ("l\t%0,0(%2)", op);
output_asm_insn ("l\t%2,4(%2)", op);
output_asm_insn ("basr\t%0,%0", op);
*************** s390_function_profiler (FILE *file, int
*** 6414,6423 ****
output_asm_insn ("st\t%0,%1", op);
output_asm_insn ("bras\t%2,%l6", op);
! (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[5]));
output_asm_insn (".long\t%4-%l5", op);
output_asm_insn (".long\t%3-%l5", op);
! (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[6]));
output_asm_insn ("lr\t%0,%2", op);
output_asm_insn ("a\t%0,0(%2)", op);
output_asm_insn ("a\t%2,4(%2)", op);
--- 6414,6423 ----
output_asm_insn ("st\t%0,%1", op);
output_asm_insn ("bras\t%2,%l6", op);
! targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (op[5]));
output_asm_insn (".long\t%4-%l5", op);
output_asm_insn (".long\t%3-%l5", op);
! targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (op[6]));
output_asm_insn ("lr\t%0,%2", op);
output_asm_insn ("a\t%0,0(%2)", op);
output_asm_insn ("a\t%2,4(%2)", op);
*************** s390_output_mi_thunk (FILE *file, tree t
*** 6562,6580 ****
if (op[5])
{
output_asm_insn (".align\t4", op);
! (*targetm.asm_out.internal_label) (file, "L",
! CODE_LABEL_NUMBER (op[5]));
}
if (op[6])
{
! (*targetm.asm_out.internal_label) (file, "L",
! CODE_LABEL_NUMBER (op[6]));
output_asm_insn (".long\t%2", op);
}
if (op[7])
{
! (*targetm.asm_out.internal_label) (file, "L",
! CODE_LABEL_NUMBER (op[7]));
output_asm_insn (".long\t%3", op);
}
}
--- 6562,6580 ----
if (op[5])
{
output_asm_insn (".align\t4", op);
! targetm.asm_out.internal_label (file, "L",
! CODE_LABEL_NUMBER (op[5]));
}
if (op[6])
{
! targetm.asm_out.internal_label (file, "L",
! CODE_LABEL_NUMBER (op[6]));
output_asm_insn (".long\t%2", op);
}
if (op[7])
{
! targetm.asm_out.internal_label (file, "L",
! CODE_LABEL_NUMBER (op[7]));
output_asm_insn (".long\t%3", op);
}
}
*************** s390_output_mi_thunk (FILE *file, tree t
*** 6589,6596 ****
{
op[5] = gen_label_rtx ();
output_asm_insn ("basr\t%4,0", op);
! (*targetm.asm_out.internal_label) (file, "L",
! CODE_LABEL_NUMBER (op[5]));
}
/* Add DELTA to this pointer. */
--- 6589,6596 ----
{
op[5] = gen_label_rtx ();
output_asm_insn ("basr\t%4,0", op);
! targetm.asm_out.internal_label (file, "L",
! CODE_LABEL_NUMBER (op[5]));
}
/* Add DELTA to this pointer. */
*************** s390_output_mi_thunk (FILE *file, tree t
*** 6640,6647 ****
Re-setup the base pointer (with a different base). */
op[5] = gen_label_rtx ();
output_asm_insn ("basr\t%4,0", op);
! (*targetm.asm_out.internal_label) (file, "L",
! CODE_LABEL_NUMBER (op[5]));
}
/* Jump to target. */
--- 6640,6647 ----
Re-setup the base pointer (with a different base). */
op[5] = gen_label_rtx ();
output_asm_insn ("basr\t%4,0", op);
! targetm.asm_out.internal_label (file, "L",
! CODE_LABEL_NUMBER (op[5]));
}
/* Jump to target. */
*************** s390_output_mi_thunk (FILE *file, tree t
*** 6679,6685 ****
SYMBOL_REF_FLAGS (op[0]) = SYMBOL_FLAG_LOCAL;
}
! (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[8]));
if (!flag_pic)
output_asm_insn (".long\t%0", op);
else
--- 6679,6685 ----
SYMBOL_REF_FLAGS (op[0]) = SYMBOL_FLAG_LOCAL;
}
! targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (op[8]));
if (!flag_pic)
output_asm_insn (".long\t%0", op);
else
*************** s390_output_mi_thunk (FILE *file, tree t
*** 6687,6700 ****
if (op[6])
{
! (*targetm.asm_out.internal_label) (file, "L",
! CODE_LABEL_NUMBER (op[6]));
output_asm_insn (".long\t%2", op);
}
if (op[7])
{
! (*targetm.asm_out.internal_label) (file, "L",
! CODE_LABEL_NUMBER (op[7]));
output_asm_insn (".long\t%3", op);
}
}
--- 6687,6700 ----
if (op[6])
{
! targetm.asm_out.internal_label (file, "L",
! CODE_LABEL_NUMBER (op[6]));
output_asm_insn (".long\t%2", op);
}
if (op[7])
{
! targetm.asm_out.internal_label (file, "L",
! CODE_LABEL_NUMBER (op[7]));
output_asm_insn (".long\t%3", op);
}
}
Index: gcc/config/s390/s390.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.md,v
retrieving revision 1.68
diff -c -p -r1.68 s390.md
*** gcc/config/s390/s390.md 23 Aug 2003 00:17:35 -0000 1.68
--- gcc/config/s390/s390.md 23 Aug 2003 00:34:34 -0000
***************
*** 5265,5271 ****
output_asm_insn ("lcr\t%N0,%N1", operands);
output_asm_insn ("je\t%l0", xop);
output_asm_insn ("bctr\t%0,0", operands);
! (*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (xop[0]));
return "";
}
--- 5265,5271 ----
output_asm_insn ("lcr\t%N0,%N1", operands);
output_asm_insn ("je\t%l0", xop);
output_asm_insn ("bctr\t%0,0", operands);
! targetm.asm_out.internal_label (asm_out_file, "L",
CODE_LABEL_NUMBER (xop[0]));
return "";
}
--
Dr. Ulrich Weigand
weigand@informatik.uni-erlangen.de