On 11/3/23 12:07, Peter Maydell wrote:
On Thu, 26 Oct 2023 at 01:25, Richard Henderson
<richard.hender...@linaro.org> wrote:

Tested-by: Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk>
Acked-by: Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>


+static TCGv do_rdgsr(DisasContext *dc, TCGv dst)
+{
+    gen_trap_ifnofpu(dc);
+    return cpu_gsr;
+}
+
+TRANS(RDGSR, 64, do_rd_special, true, a->rd, do_rdgsr)

Hi; Coverity complains (CID 1523706) that we don't check
the return value from this call to gen_trap_ifnofpu(),
whereas we do check it on all but one other call.
Is this OK?

Yes.

While gen_trap_ifnofpu may or may not trap, we must return a legal value for the calling wrapper function. If a trap is generated, the read of cpu_gsr will be removed as dead code.

For do_wrgsr, we *could* avoid generating the dead store to cpu_gsr, but avoiding that is not critical.


r~

Reply via email to