Skip to content

Commit ac2978f

Browse files
committed
[cc] comment fixes
1 parent 4bccd66 commit ac2978f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cc/ir/linearize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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,

cc/tests/datatypes/struct_type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,10 @@ int main(void) {
320320
#[test]
321321
fn 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)
324324
struct 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
329329
struct medium make_medium(long a, int b) {

0 commit comments

Comments
 (0)