target/arm: Free TCG temps in trans_VMOV_64_sp()
PATCH 1/1 target/arm: Free TCG temps in trans_VMOV_64_sp()
The function neon_store_reg32() doesn't free the TCG temp that it is passed, so the caller must do that. We got this right in most places but forgot to free the TCG temps in trans_VMOV_64_sp().
--- target/arm/translate-vfp.inc.c | 2 ++ 1 file changed, 2 insertions(+)
target/arm/translate-vfp.inc.c +2 -0
@@ -880,8 +880,10 @@ static bool trans_VMOV_64_sp(DisasContext *s, arg_VMOV_64_sp *a)/* gpreg to fpreg */ tmp =load_reg (s, a->rt);neon_store_reg32 (tmp, a->vm); +tcg_temp_free_i32 (tmp); tmp =load_reg (s, a->rt2);neon_store_reg32 (tmp, a->vm +1 ); +tcg_temp_free_i32 (tmp); }return true;
Signature · 1 line
2.20.1
Quoted 9 lines · Peter Maydell
The function
neon_store_reg32()doesn't free the TCG temp that it is passed, so the caller must do that. We got this right in most places but forgot to free the TCG temps intrans_VMOV_64_sp().Signed-off-by Peter Maydell <[email protected]>--- target/arm/translate-vfp.inc.c | 2 ++ 1 file changed, 2 insertions(+)
r~
Quoted 15 lines · Peter Maydell
The function
neon_store_reg32()doesn't free the TCG temp that it is passed, so the caller must do that. We got this right in most places but forgot to free the TCG temps intrans_VMOV_64_sp().Signed-off-by Peter Maydell <[email protected]>--- target/arm/translate-vfp.inc.c | 2 ++ 1 file changed, 2 insertions(+)target/arm/translate-vfp.inc.c +0
-0
target/arm/translate-vfp.inc.c static bool trans_VMOV_64_sp(DisasContext *s, arg_VMOV_64_sp *a) · line 889
Quoted 10 lines
target/arm/translate-vfp.inc.c +2
-0@@ -880,8 +880,10 @@ static bool trans_VMOV_64_sp(DisasContext *s, arg_VMOV_64_sp *a)/* gpreg to fpreg */ tmp =load_reg (s, a->rt);neon_store_reg32 (tmp, a->vm); +tcg_temp_free_i32 (tmp); tmp =load_reg (s, a->rt2);neon_store_reg32 (tmp, a->vm +1 ); +tcg_temp_free_i32 (tmp); }return true;
27.08.2019. 14.20, "Peter Maydell" <[email protected]> је написао/ла:
Quoted 8 lines
The function
neon_store_reg32()doesn't free the TCG temp that it is passed, so the caller must do that. We got this right in most places but forgot to free the TCG temps intrans_VMOV_64_sp().Signed-off-by Peter Maydell <[email protected]>---
Hello, Peter,
I am just curious if you found this by manual code inspection, or perhaps using a tool?
Yours,
Aleksandar
Review
Quoted 4 lines
target/arm/translate-vfp.inc.c | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/target/arm/translate-vfp.inc.c
target/arm/translate-vfp.inc.c static bool trans_VMOV_64_sp(DisasContext *s,
Quoted 4 lines
index
3e8ea80493b..9ae980bef63100644target/arm/translate-vfp.inc.c +0
-0@@ -880,8 +880,10 @@ static bool trans_VMOV_64_sp(DisasContext *s,
arg_VMOV_64_sp *a)
Quoted 14 lines
target/arm/translate-vfp.inc.c +2
-1/* gpreg to fpreg */ tmp =load_reg (s, a->rt);neon_store_reg32 (tmp, a->vm); +tcg_temp_free_i32 (tmp); tmp =load_reg (s, a->rt2);neon_store_reg32 (tmp, a->vm +1 ); +tcg_temp_free_i32 (tmp); }return true; --2.20.1
Quoted 6 lines · Aleksandar Markovic
27.08.2019. 14.20, "Peter Maydell" <[email protected]> је написао/ла:
Quoted 5 lines
The function
neon_store_reg32()doesn't free the TCG temp that it is passed, so the caller must do that. We got this right in most places but forgot to free the TCG temps intrans_VMOV_64_sp().
Quoted 8 lines
Quoted 3 lines
Signed-off-by Peter Maydell <[email protected]>---
Hello, Peter,
I am just curious if you found this by manual code inspection, or perhaps using a tool?
I'm guessing that if you run code that exercises this while built with --enable-tcg-debug then TCG's sanity checking complains about unfreed temps.
Quoted 7 lines
Yours,
AleksandarQuoted 3 lines
target/arm/translate-vfp.inc.c | 2 ++ 1 file changed, 2 insertions(+)
Quoted 21 lines
Review
Quoted 1 line
(quoted diff) +0
-0
b/target/arm/translate-vfp.inc.ctarget/arm/translate-vfp.inc.c static bool trans_VMOV_64_sp(DisasContext *s,
Quoted 4 lines
index
3e8ea80493b..9ae980bef63100644target/arm/translate-vfp.inc.c +0
-0@@ -880,8 +880,10 @@ static bool trans_VMOV_64_sp(DisasContext *s,
arg_VMOV_64_sp*a)Quoted 14 lines
target/arm/translate-vfp.inc.c +2
-1/* gpreg to fpreg */ tmp =load_reg (s, a->rt);neon_store_reg32 (tmp, a->vm); +tcg_temp_free_i32 (tmp); tmp =load_reg (s, a->rt2);neon_store_reg32 (tmp, a->vm +1 ); +tcg_temp_free_i32 (tmp); }return true; --2.20.1
--
Alex Bennée
Quoted 9 lines · Alex Bennée
Quoted 2 lines · Aleksandar Markovic
I am just curious if you found this by manual code inspection, or perhaps using a tool?
I'm guessing that if you run code that exercises this while built with --enable-tcg-debug then TCG's sanity checking complains about unfreed temps.
Yes, exactly -- this was producing warnings for a random bit of guest code I happened to be running. (I run most of my testing with an --enable-debug build, which includes the TCG debug).
thanks
-- PMM