File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1091,7 +1091,7 @@ impl<'a> Linearizer<'a> {
10911091 if let Some ( func) = & mut self . current_func {
10921092 func. add_pseudo ( high_pseudo) ;
10931093 }
1094- // Always load 8 bytes for the high part - codegen will handle alignment
1094+ // Load up to 8 bytes for the high part (may be less for structs < 16 bytes)
10951095 let high_size = std:: cmp:: min ( 64 , struct_size - 64 ) ;
10961096 self . emit ( Instruction :: load (
10971097 high_temp,
Original file line number Diff line number Diff line change @@ -320,10 +320,10 @@ int main(void) {
320320#[ test]
321321fn struct_return_two_register ( ) {
322322 let code = r#"
323- // 12 -byte struct - uses two-register return (RAX+RDX or X0+X1)
323+ // 16 -byte struct (12 bytes data + 4 bytes padding) - uses two-register return (RAX+RDX or X0+X1)
324324struct medium {
325325 long first; // 8 bytes
326- int second; // 4 bytes (+ 4 padding = 16 total with alignment )
326+ int second; // 4 bytes (+ 4 bytes padding for alignment; total 16 bytes )
327327};
328328
329329struct medium make_medium(long a, int b) {
You can’t perform that action at this time.
0 commit comments