diff mbox series

[v4,04/16] cputlb: Use optimize_away in load/store_helpers

Message ID 20190923230004.9231-5-richard.henderson@linaro.org
State Superseded
Headers show
Series Move rom and notdirty handling to cputlb | expand

Commit Message

Richard Henderson Sept. 23, 2019, 10:59 p.m. UTC
Increase the current runtime assert to a compile-time assert.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 accel/tcg/cputlb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
2.17.1

Comments

David Hildenbrand Sept. 24, 2019, 7:47 a.m. UTC | #1
On 24.09.19 00:59, Richard Henderson wrote:
> Increase the current runtime assert to a compile-time assert.

> 

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  accel/tcg/cputlb.c | 5 ++---

>  1 file changed, 2 insertions(+), 3 deletions(-)

> 

> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c

> index 2222b87764..e529af6d09 100644

> --- a/accel/tcg/cputlb.c

> +++ b/accel/tcg/cputlb.c

> @@ -1396,7 +1396,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,

>          res = ldq_le_p(haddr);

>          break;

>      default:

> -        g_assert_not_reached();

> +        optimize_away();

>      }

>  

>      return res;

> @@ -1680,8 +1680,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,

>          stq_le_p(haddr, val);

>          break;

>      default:

> -        g_assert_not_reached();

> -        break;

> +        optimize_away();

>      }

>  }

>  

> 


Reviewed-by: David Hildenbrand <david@redhat.com>


-- 

Thanks,

David / dhildenb
Alex Bennée Sept. 24, 2019, 3:47 p.m. UTC | #2
Richard Henderson <richard.henderson@linaro.org> writes:

> Increase the current runtime assert to a compile-time assert.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


> ---

>  accel/tcg/cputlb.c | 5 ++---

>  1 file changed, 2 insertions(+), 3 deletions(-)

>

> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c

> index 2222b87764..e529af6d09 100644

> --- a/accel/tcg/cputlb.c

> +++ b/accel/tcg/cputlb.c

> @@ -1396,7 +1396,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,

>          res = ldq_le_p(haddr);

>          break;

>      default:

> -        g_assert_not_reached();

> +        optimize_away();

>      }

>

>      return res;

> @@ -1680,8 +1680,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,

>          stq_le_p(haddr, val);

>          break;

>      default:

> -        g_assert_not_reached();

> -        break;

> +        optimize_away();

>      }

>  }



--
Alex Bennée
diff mbox series

Patch

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 2222b87764..e529af6d09 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1396,7 +1396,7 @@  load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
         res = ldq_le_p(haddr);
         break;
     default:
-        g_assert_not_reached();
+        optimize_away();
     }
 
     return res;
@@ -1680,8 +1680,7 @@  store_helper(CPUArchState *env, target_ulong addr, uint64_t val,
         stq_le_p(haddr, val);
         break;
     default:
-        g_assert_not_reached();
-        break;
+        optimize_away();
     }
 }