This is an archive of the discontinued LLVM Phabricator instance.

Avoid losing Hi part when expanding VAARG nodes on big endian machines
ClosedPublic

Authored by dcederman on Jun 26 2018, 8:29 AM.

Details

Summary

If the high part of the load is not used the offset to the next element will not be set correctly.

For example, on Sparc V8, the following code will read val2 from offset 4 instead of 8.

int val = __builtin_va_arg(va, long long);
int val2 = __builtin_va_arg(va, int);

Diff Detail

Event Timeline

dcederman created this revision.Jun 26 2018, 8:29 AM
jyknight accepted this revision.Jul 13 2018, 11:32 AM

Chain bugs are evil. =)

This revision is now accepted and ready to land.Jul 13 2018, 11:32 AM
This revision was automatically updated to reflect the committed changes.