according to www.linux-foundation.org/spec/refspecs/elf/x86_64-SysV-psABI.pdf the registers should be in the order rax, rbx, rcx, rdx, gcc puts them in rax, rdx, rcx, rbx.
-- Summary: config/i386/i386.h rbx and rdx dwarf register numbers are switched. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: npremji at redhat dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32982