binutils-gdb/sim
Mike Frysinger b2ea48df92 sim: cgen: rework DI macros to avoid signed left shifts
The cgen code uses DI as int64_t and UDI as uint64_t.  The DI macros
are used to construct 64-bit values from 32-bit values (for the low
and high parts).  The MAKEDI macro casts the high 32-bit value to a
signed 32-bit value before shifting.  If this created a negative
value, this would be undefined behavior according to the C standard.
All we care about is shifting the 32-bits as they are to the high
32-bits, not caring about sign extension (since there's nothing left
to shift into), and the low 32-bits being empty.  This is what we
get from shifting an unsigned value, so cast it to unsigned 32-bit
to avoid undefined behavior.

While we're here, change the SETLODI macro to truncate the lower
value to 32-bits before we set it.  If it was passing in a 64-bit
value, those high bits would get included too, and that's not what
we want.

Similarly, tweak the SETHIDI macro to cast the value to an unsigned
64-bit instead of a signed 64-bit.  If the value was only 32-bits,
the behavior would be the same.  If it happened to be signed 64-bit,
it would trigger the undefined behavior too.
2024-01-08 20:01:05 -05:00
..
aarch64 sim: aarch64: fix -Wshadow=local warnings 2023-12-22 23:29:19 -05:00
arm sim: arm: mark local read-only arrays as static const 2024-01-01 10:53:15 -05:00
avr sim: avr: fix -Wimplicit-fallthrough warnings 2023-12-21 01:59:22 -05:00
bfin sim: bfin: fix -Wshadow=local warnings 2023-12-22 23:29:19 -05:00
bpf sim: bpf: fix -Wunused-variable warnings 2023-12-19 05:51:10 -05:00
common sim: cgen: rework DI macros to avoid signed left shifts 2024-01-08 20:01:05 -05:00
cr16 sim: cr16: cleanup unused variable compiler warnings 2024-01-03 01:58:20 -05:00
cris sim: cris: change temp var name slightly to avoid shadowing 2024-01-06 23:30:43 -05:00
d10v
erc32 sim: erc32: fix -Wshadow=local warnings 2023-12-22 23:29:19 -05:00
example-synacor
frv sim: frv: fix cmpb uninitialized variable usage 2024-01-01 10:56:08 -05:00
ft32 sim: ft32: fix -Wunused-variable warnings 2023-12-19 05:51:10 -05:00
h8300 sim: h8300: fix -Wshadow=local warnings 2023-12-22 23:29:19 -05:00
igen sim: igen: clean up headers a bit 2024-01-03 03:13:47 -05:00
iq2000 sim: cgen: regenerate decode tables 2023-12-24 04:07:32 -05:00
lm32 sim: cgen: regenerate decode tables 2023-12-24 04:07:32 -05:00
m4 sim: warnings: enable -Wshadow=local 2024-01-06 23:30:43 -05:00
m32c sim: m32c: fix -Wshadow=local warnings 2023-12-22 23:29:19 -05:00
m32r sim: cgen: regenerate decode tables 2023-12-24 04:07:32 -05:00
m68hc11 sim: m68hc11: fix -Wshadow=local warnings 2023-12-22 23:29:19 -05:00
mcore sim: mcore: fix Wimplicit-fallthrough warnings 2023-12-21 01:59:23 -05:00
microblaze sim: microblaze: fix -Wunused-variable warnings 2023-12-19 05:51:10 -05:00
mips sim: mips: fix -Wshadow=local warnings 2023-12-22 23:29:19 -05:00
mn10300 sim: signal: mark signal callback funcs as noreturn since they don't return 2023-12-21 01:59:22 -05:00
moxie sim: moxie: fix -Wunused-variable warnings 2023-12-19 05:51:11 -05:00
msp430 sim: msp430: fix -Wunused-variable warnings 2023-12-19 05:51:11 -05:00
or1k cpu: or1k: drop unused l.swa flag 2024-01-01 10:51:23 -05:00
ppc sim: ppc: unify igen filter modules 2024-01-03 03:37:13 -05:00
pru sim: pru: Fix emulation of carry bit 2023-12-28 09:09:13 +02:00
riscv sim: riscv: fix -Wshadow=local warnings 2023-12-22 23:29:19 -05:00
rl78 sim: rl78: fix -Wimplicit-fallthrough warnings 2023-12-21 01:59:23 -05:00
rx sim: rx: fix -Wimplicit-fallthrough warnings 2023-12-21 01:59:23 -05:00
sh sim: sh: refine pwsb & pwad nops 2023-12-24 04:00:04 -05:00
testsuite sim: pru: Fix emulation of carry bit 2023-12-28 09:09:13 +02:00
v850 sim: v850: fix -Wunused-variable warnings 2023-12-19 05:51:11 -05:00
.gitignore
aclocal.m4
ChangeLog-2021
config.h.in sim: ppc: move termios probes to top-level 2024-01-02 00:34:15 -05:00
configure sim: warnings: enable -Wshadow=local 2024-01-06 23:30:43 -05:00
configure.ac sim: configure: switch to m4_map 2024-01-03 01:43:14 -05:00
COPYING
gdbinit.in
MAINTAINERS
Makefile.am sim: drop support for automatic subdir recursion 2024-01-03 01:21:48 -05:00
Makefile.in sim: ppc: unify igen filter modules 2024-01-03 03:37:13 -05:00
README-HACKING