[PATCH] D61224: Fix i386 stack alignment for parameter type with breakdowns

Wei Xiao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 27 08:22:46 PDT 2019


wxiao3 created this revision.
wxiao3 added reviewers: annita.zhang, LuoYuanke, smaslov, craig.topper, rnk, hjl.tools.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Parameters are broken down to register types for value passing. E.g,
__float128 is broken to 4Xi32. But current implementation doesn't
take the alignment of original type into account when allocating
stack space for the first piece of the broken down parameter. E.g,
__float128 parameter is passed as 4 byte-aligned instead of 16
byte-aligned which is inconsistent with i386 ABI. This will cause
runtime failure if generated code calling to libraries built by
other compiler such as GCC which follows i386 ABI.

This patch fixes the bug by taking original alignment into account.


Repository:
  rL LLVM

https://reviews.llvm.org/D61224

Files:
  include/llvm/Target/TargetCallingConv.td
  lib/Target/X86/X86CallingConv.td
  test/CodeGen/X86/add.ll
  test/CodeGen/X86/bool-vector.ll
  test/CodeGen/X86/cmovcmov.ll
  test/CodeGen/X86/extract-store.ll
  test/CodeGen/X86/gather-addresses.ll
  test/CodeGen/X86/legalize-shift-64.ll
  test/CodeGen/X86/legalize-shl-vec.ll
  test/CodeGen/X86/masked_gather_scatter.ll
  test/CodeGen/X86/mmx-arg-passing.ll
  test/CodeGen/X86/movtopush.ll
  test/CodeGen/X86/sadd_sat.ll
  test/CodeGen/X86/scalar-fp-to-i64.ll
  test/CodeGen/X86/select.ll
  test/CodeGen/X86/smul_fix.ll
  test/CodeGen/X86/sse1.ll
  test/CodeGen/X86/ssub_sat.ll
  test/CodeGen/X86/uadd_sat.ll
  test/CodeGen/X86/umul_fix.ll
  test/CodeGen/X86/usub_sat.ll
  test/CodeGen/X86/win32-pic-jumptable.ll
  utils/TableGen/CallingConvEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61224.196970.patch
Type: text/x-patch
Size: 64053 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190427/812816b1/attachment-0001.bin>


More information about the llvm-commits mailing list