This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][AIX] attribute aligned cannot decrease align of a vector var.
ClosedPublic

Authored by sfertile on Aug 4 2021, 7:18 PM.

Details

Summary

On AIX an aligned attribute cannot decrease the alignment of a variable when placed on a variable declaration of vector type.

Diff Detail

Event Timeline

sfertile created this revision.Aug 4 2021, 7:18 PM
sfertile requested review of this revision.Aug 4 2021, 7:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2021, 7:18 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman added inline comments.Aug 5 2021, 4:43 AM
clang/lib/Sema/SemaDeclAttr.cpp
4066–4071
4079
4084

This should produce a diagnostic rather than silently drop the attribute. I'd recommend err_alignas_underaligned if you're willing to make this an error. If not, you could add a new warning with the same wording.

sfertile updated this revision to Diff 364436.Aug 5 2021, 6:16 AM
  • Fixed spelling mistake
  • Check that VD is non-nulll earlier.
  • added warning that the requested alignment is too small.
  • renamed test
sfertile marked 3 inline comments as done.Aug 5 2021, 6:17 AM
sfertile added inline comments.
clang/lib/Sema/SemaDeclAttr.cpp
4084

Thanks for the feedback Aaron. I think an error is too drastic a difference from the other compilers on AIX so I added the warning.

aaron.ballman accepted this revision.Aug 5 2021, 6:19 AM

LGTM aside from a minor nit.

clang/include/clang/Basic/DiagnosticSemaKinds.td
2989–2990
This revision is now accepted and ready to land.Aug 5 2021, 6:19 AM
This revision was automatically updated to reflect the committed changes.
sfertile marked an inline comment as done.