diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-08-28 14:20:04 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:00:34 +0100 |
commit | ad1c244dd607fd7607ef95eecc2718e98578a70c (patch) | |
tree | c4298be092da264079443dbe5a811ee3339a0060 /gcc/rust/rust-gcc.cc | |
parent | 11963393d073a4e54d2e25fccac2962cb66b2dd3 (diff) | |
download | gcc-ad1c244dd607fd7607ef95eecc2718e98578a70c.zip gcc-ad1c244dd607fd7607ef95eecc2718e98578a70c.tar.gz gcc-ad1c244dd607fd7607ef95eecc2718e98578a70c.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/rust-gcc.cc')
0 files changed, 0 insertions, 0 deletions