diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-08-28 14:20:04 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-08-31 21:25:00 +0000 |
commit | 53e6e5be47fcce76275bba6cdf63753e1c854ad1 (patch) | |
tree | c480c6d96adac13d420497d38b55ae9d7f9c5185 /gcc/rust/hir | |
parent | 4d49db696bc79a9a9b33c1817bfd372dcc46ac61 (diff) | |
download | gcc-53e6e5be47fcce76275bba6cdf63753e1c854ad1.zip gcc-53e6e5be47fcce76275bba6cdf63753e1c854ad1.tar.gz gcc-53e6e5be47fcce76275bba6cdf63753e1c854ad1.tar.bz2 |
gccrs: Fix bad uninit intrinsic
We were using the DECL_RESULT but this just contains the TREE_TYPE of the
retval. It was also missing taking the address of the destination for the
memset call. This changes the code to create a temp variable for the return
value and asserts the destination size is the same as the size of the
template param.
Fixes #2583
gcc/rust/ChangeLog:
* backend/rust-compile-intrinsic.cc (enter_intrinsic_block): take the locals vector
(uninit_handler): make a temp variable and use the address of it
gcc/testsuite/ChangeLog:
* rust/execute/torture/issue-2583.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/hir')
0 files changed, 0 insertions, 0 deletions