From 39d04363053e586b594f31a5e02ea6c4a5b6e7f7 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 9 Apr 2001 13:18:39 +0200 Subject: [PATCH] i386.c (call, call_value): Make sure that resulting call_insn does have proper second operand. * i386.c (call, call_value): Make sure that resulting call_insn does have proper second operand. From-SVN: r41201 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386-protos.h | 1 + gcc/config/i386/i386.h | 13 ++----------- gcc/config/i386/i386.md | 19 +++++++++++++------ 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c95ae3d574..235e319fe90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Sun Apr 8 00:43:27 CEST 2001 Jan Hubicka + + * i386.c (call, call_value): Make sure that resulting call_insn + does have proper second operand. + Sun Apr 8 22:50:49 2001 Christopher Faylor * config/i386/xm-cygwin.h (GET_ENV_PATH_LIST): Eliminate obsolete diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 28fc3ffebfe..f5e93718298 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -118,6 +118,7 @@ extern void ix86_expand_branch PARAMS ((enum rtx_code, rtx)); extern int ix86_expand_setcc PARAMS ((enum rtx_code, rtx)); extern int ix86_expand_int_movcc PARAMS ((rtx[])); extern int ix86_expand_fp_movcc PARAMS ((rtx[])); +extern void x86_initialize_trampoline PARAMS ((rtx, rtx, rtx)); extern void ix86_split_long_move PARAMS ((rtx[])); extern void ix86_split_ashldi PARAMS ((rtx *, rtx)); extern void ix86_split_ashrdi PARAMS ((rtx *, rtx)); diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 8ccf8911212..c44882781bc 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1704,23 +1704,14 @@ pop{l} %0" \ /* Length in units of the trampoline for entering a nested function. */ -#define TRAMPOLINE_SIZE 10 +#define TRAMPOLINE_SIZE (TARGET_64BIT ? 23 : 10) /* Emit RTL insns to initialize the variable parts of a trampoline. FNADDR is an RTX for the address of the function's pure code. CXT is an RTX for the static chain value for the function. */ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ -{ \ - /* Compute offset from the end of the jmp to the target function. */ \ - rtx disp = expand_binop (SImode, sub_optab, FNADDR, \ - plus_constant (TRAMP, 10), \ - NULL_RTX, 1, OPTAB_DIRECT); \ - emit_move_insn (gen_rtx_MEM (QImode, TRAMP), GEN_INT (0xb9)); \ - emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 1)), CXT); \ - emit_move_insn (gen_rtx_MEM (QImode, plus_constant (TRAMP, 5)), GEN_INT (0xe9));\ - emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 6)), disp); \ -} + x86_initialize_trampoline (TRAMP, FNADDR, CXT) /* Definitions for register eliminations. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 5aa3e493ea4..dd104230d5c 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -12882,11 +12882,13 @@ (define_expand "call" [(call (match_operand:QI 0 "" "") - (match_operand 2 "" ""))] + (match_operand 1 "" "")) + (use (match_operand 2 "" ""))] ;; Operand 1 not used on the i386. "" " { + rtx insn; /* Static functions and indirect calls don't need current_function_uses_pic_offset_table. */ if (flag_pic @@ -12898,13 +12900,14 @@ XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, XEXP (operands[0], 0)); if (TARGET_64BIT && INTVAL (operands[2]) >= 0) { - rtx insn; rtx reg = gen_rtx_REG (QImode, 0); emit_move_insn (reg, operands[2]); - insn = emit_call_insn (gen_call_exp (operands[0], operands[2])); + insn = emit_call_insn (gen_call_exp (operands[0], operands[1])); use_reg (&CALL_INSN_FUNCTION_USAGE (insn), reg); DONE; } + insn = emit_call_insn (gen_call_exp (operands[0], operands[1])); + DONE; }") (define_expand "call_exp" @@ -12998,11 +13001,13 @@ (define_expand "call_value" [(set (match_operand 0 "" "") (call (match_operand:QI 1 "" "") - (match_operand:SI 3 "" "")))] + (match_operand:SI 2 "" ""))) + (use (match_operand:SI 3 "" ""))] ;; Operand 2 not used on the i386. "" " { + rtx insn; /* Static functions and indirect calls don't need current_function_uses_pic_offset_table. */ if (flag_pic @@ -13013,14 +13018,16 @@ XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, XEXP (operands[1], 0)); if (TARGET_64BIT && INTVAL (operands[3]) >= 0) { - rtx insn; rtx reg = gen_rtx_REG (QImode, 0); emit_move_insn (reg, operands[3]); insn = emit_call_insn (gen_call_value_exp (operands[0], operands[1], - operands[3])); + operands[2])); use_reg (&CALL_INSN_FUNCTION_USAGE (insn), reg); DONE; } + insn = emit_call_insn (gen_call_value_exp (operands[0], operands[1], + operands[2])); + DONE; }") (define_expand "call_value_exp"