[PATCH][RFC] Respect alignment when loading up a coerced function argument

Ulrich Weigand Ulrich.Weigand at de.ibm.com
Mon Mar 30 11:29:01 PDT 2015



Hello,

code in CGCall.cpp that loads up function arguments that need to be
coerced to a different type may in some cases ignore the fact that
the source of the argument is not naturally aligned.  This may cause
incorrect code to be generated.

This patch adds a setAlignment call in one place in CreateCoercedLoad
where it was missing so far.  Note that as this location, we do not
actually know what alignment of the source location we can rely on;
the callers do not pass anything to this routine.  This is already
an issue in other places in CreateCoercedLoad; just like those places,
this patch simply uses an alignment of 1, and adds a FIXME.

(See attached file: clang-align-coerced)

Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand | Phone: +49-7031/16-3727
  STSM, GNU/Linux compilers and toolchain
  IBM Deutschland Research & Development GmbH
  Vorsitzende des Aufsichtsrats: Martina Koederitz | Geschäftsführung: Dirk
Wittkopp
  Sitz der Gesellschaft: Böblingen | Registergericht: Amtsgericht
Stuttgart, HRB 243294
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-align-coerced
Type: application/octet-stream
Size: 1948 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150330/023057f1/attachment.obj>


More information about the cfe-commits mailing list