[llvm-bugs] [Bug 48428] New: x32: support variadic functions

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 7 10:11:24 PST 2020


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

            Bug ID: 48428
           Summary: x32: support variadic functions
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: harald at gigawatt.nl
          Reporter: harald at gigawatt.nl
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, pengfei.wang at intel.com,
                    spatel+llvm at rotateright.com

The x86-64 ABI defines va_list as:

  typedef struct {
    unsigned int gp_offset;
    unsigned int fp_offset;
    void *overflow_arg_area;
    void *reg_save_area;
  } va_list[1];

LLVM hardcodes size, alignment and member offsets of this struct based on the
LP64 model, where the pointers have a size and alignment of 8 bytes. In the
ILP32 model, this is not correct. This occurs in X86ISelLowering in at least
LowerVACOPY and X86TargetLowering::EmitVAARG64WithCustomInserter.

I am reporting but self-assigning this to make sure it does not get forgotten.
The fixes for this are already available as part of
<https://github.com/hjl-tools/llvm-x32-old/commit/2eec4c329b38cdedc38e1dbd978f0d927cc4a54e>,
just need to be extracted and possibly cleaned up.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201207/d31ecd68/attachment.html>


More information about the llvm-bugs mailing list