-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzilladuplicateResolved as duplicateResolved as duplicate
Description
Bugzilla Link | 50635 |
Resolution | DUPLICATE |
Resolved on | Jun 09, 2021 11:13 |
Version | unspecified |
OS | Linux |
Blocks | #48661 |
Reporter | LLVM Bugzilla Contributor |
CC | @jyknight,@RKSimon,@tstellar |
Extended Description
To reproduce:
#include <stdint.h>
struct S1 {
uint8_t val1;
uint8_t this_gets_clobbered;
uint16_t val2;
};
void test(S1 src, S1* dest) {
dest->val1 = src.val1;
dest->val2 = src.val2;
}
Compile with -O1 or higher, with Clang 12.0.0 or higher (codegen is proper on 11.0.1).
Expected result:
test(S1, S1*): # @test(S1, S1*)
mov byte ptr [rsi], dil
shr edi, 16
mov word ptr [rsi + 2], di
ret
Actual result:
test(S1, S1*): # @test(S1, S1*)
mov dword ptr [rsi], edi
ret
Compiler Explorer: https://godbolt.org/z/1W1oKdfcG
Found by user @fifty#1323 on Discord.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzilladuplicateResolved as duplicateResolved as duplicate