Patchwork [4/4] tcg-hppa: Don't try to calls to non-constant addresses.

login
register
mail settings
Submitter Richard Henderson
Date April 7, 2010, 11:24 p.m.
Message ID <ecf53b20a7f5bdfe3d88ad3c95f9f6583d9f8849.1270682952.git.rth@twiddle.net>
Download mbox | patch
Permalink /patch/49677/
State New
Headers show

Comments

Richard Henderson - April 7, 2010, 11:24 p.m.
PA-RISC uses procedure descriptors.  We'd need to emit a call to
the millicode routine $$dyncall.  However, this situation doesn't
actually arise, since we always have the descriptor available at
TCG code generation time.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/hppa/tcg-target.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
Aurelien Jarno - April 8, 2010, 9:58 a.m.
On Thu, Apr 08, 2010 at 01:24:35AM +0200, Richard Henderson wrote:
> PA-RISC uses procedure descriptors.  We'd need to emit a call to
> the millicode routine $$dyncall.  However, this situation doesn't
> actually arise, since we always have the descriptor available at
> TCG code generation time.

Thanks, applied.

> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  tcg/hppa/tcg-target.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c
> index aaa39e3..a8cb768 100644
> --- a/tcg/hppa/tcg-target.c
> +++ b/tcg/hppa/tcg-target.c
> @@ -1276,8 +1276,10 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
>          if (const_args[0]) {
>              tcg_out_call(s, (void *)args[0]);
>          } else {
> -            tcg_out32(s, INSN_BLE_SR4 | INSN_R2(args[0]));
> -            tcg_out_mov(s, TCG_REG_RP, TCG_REG_R31);
> +            /* ??? FIXME: the value in the register in args[0] is almost
> +               certainly a procedure descriptor, not a code address.  We
> +               probably need to use the millicode $$dyncall routine.  */
> +            tcg_abort();
>          }
>          break;
>  
> -- 
> 1.6.2.5
> 
> 
> 
>

Patch

diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c
index aaa39e3..a8cb768 100644
--- a/tcg/hppa/tcg-target.c
+++ b/tcg/hppa/tcg-target.c
@@ -1276,8 +1276,10 @@  static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
         if (const_args[0]) {
             tcg_out_call(s, (void *)args[0]);
         } else {
-            tcg_out32(s, INSN_BLE_SR4 | INSN_R2(args[0]));
-            tcg_out_mov(s, TCG_REG_RP, TCG_REG_R31);
+            /* ??? FIXME: the value in the register in args[0] is almost
+               certainly a procedure descriptor, not a code address.  We
+               probably need to use the millicode $$dyncall routine.  */
+            tcg_abort();
         }
         break;