https://bugs.llvm.org/show_bug.cgi?id=40413

            Bug ID: 40413
           Summary: __attribute__((preserve_most)) saves 64-bit registers
                    on 32-bit builds.
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: brian.peter.led...@gmail.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

Building 

```
void foo();

__attribute__((preserve_most))
int bar(int num) {
    foo();
    return 0;
}
```

produces the expected pushl and popl commands for saving registers. However,
they are ranging over the set of 64-bit registers, even when -m32 is passed.

If you inspect at line 290 of llvm/lib/Target/X86/X86RegisterInfo.cpp in the
repository, you will see it is referring to the constant
CSR_64_RT_MostRegs_SaveList, which is the set of 64-bit registers.


This will cause the assembler to fail, citing invalid registers, for all 32-bit
targets that use __attribute__((preserve_most)).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to