[PATCH] D109387: [NFC][AIX] Check for typedef properly when getting preferred type align

Steven Wan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 8 12:16:17 PDT 2021


stevewan added a comment.

In D109387#2987843 <https://reviews.llvm.org/D109387#2987843>, @rjmccall wrote:

> Oh, no, I don't think this is NFC.  It seems very likely that there's some case where the behavior is distinguishable.  Maybe a typedef of a record with an alignment attribute?
>
>   __attribute__((aligned(2), packed)) struct float4 { float x, y, z, w; };
>   typedef struct float4 float4typedef;
>   
>   struct {
>     float4typedef field; // presumably still eligible for alignment upgrade
>   };

Right, the behaviour difference is exactly what I'm trying to fix, silly me :). Though the diff isn't very obvious in the given example because ABIAlign equals to PreferredAlign in that particular case, the following test may provide a better exposure,

  struct __attribute__((aligned(2))) S { double x; };
  typedef struct S SS;




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109387/new/

https://reviews.llvm.org/D109387



More information about the cfe-commits mailing list