From 195b8a572e7c45d991906fd5b4e9fbbf5567abfd Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Fri, 17 Jun 2005 03:13:07 +0000 Subject: [PATCH] * gencode.c (tab): Avoid lvalue casts. Suggested by Ralf Corsepius . --- sim/sh/ChangeLog | 5 +++++ sim/sh/gencode.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog index 8a6d6ff1ad6..5d6a1461bca 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,3 +1,8 @@ +2005-06-16 Daniel Jacobowitz + + * gencode.c (tab): Avoid lvalue casts. Suggested by + Ralf Corsepius . + 2005-04-12 Jonathan Larmour * gencode.c (tab): Avoid inserting code before variables all declared. diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c index c3c8c055b77..e86bd298f68 100644 --- a/sim/sh/gencode.c +++ b/sim/sh/gencode.c @@ -215,7 +215,9 @@ op tab[] = "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();", "if (R0 == 0)", " R[n] = 0xffffffff;", - "else (unsigned int) R[n] = (unsigned int) R[n] / (unsigned int) R0;", + "/* FIXME: The result may be implementation-defined if it is outside */", + "/* the range of signed int (i.e. if R[n] was negative and R0 == 1). */", + "else R[n] = R[n] / (unsigned int) R0;", "L (n);", }, { "n", "0n", "mulr R0,", "0100nnnn10000000", -- 2.30.2