Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Clang should support __attribute__((__force_align_arg_pointer__)) #5760

Closed Quuxplusone closed 14 years ago

Quuxplusone commented 14 years ago
Bugzilla Link PR5254
Status RESOLVED FIXED
Importance P normal
Reported by Charles Davis (cdavis5x@gmail.com)
Reported on 2009-10-19 11:34:00 -0700
Last modified on 2010-02-23 08:35:14 -0800
Version trunk
Hardware PC MacOS X
CC amine.khaldi@reactos.org, anton@korobeynikov.info, astrange@ithinksw.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
In the Wine source code, the __stdcall calling convention is defined like this
on Mac OS X in include/windef.h:

#define __stdcall __attribute__((__stdcall__)) \
  __attribute__((__force_align_arg_pointer__))

Then every time clang encounters __stdcall in Wine code (and by extension,
WINAPI, NTAPI, STDMETHODCALLTYPE, etc), it prints a warning stating that the
attribute __attribute__((__force_align_arg_pointer__)) isn't supported.

I don't know if this is necessary under clang, but apparently it is under gcc.
According to the comment in include/windef.h, this is supposed to ensure that
the stack remains 16-byte aligned on Mac OS X (because
__attribute__((__stdcall__)) aligns the stack to 4 bytes).

So, to be on the safe side, I humbly request that this attribute be implemented.
Quuxplusone commented 14 years ago

This is used in FFmpeg. Of course, it's really not needed on OS X, but might be on other systems.

Quuxplusone commented 14 years ago

Almost there. I've just submitted the last patch towards getting clang to support this. When I get the green light, I'll commit it and close this bug.

Of course, this still leaves the matter of llvm-gcc (and of Duncan's pet project, dragonegg), but I'm mostly concerned about clang here.

Quuxplusone commented 14 years ago

Well, I fixed clang, so now clang fully supports this attribute. This bug's about clang, so I'm resolving it.

I reiterate, there's still the matter of llvm-gcc and dragonegg. GCC parses the attribute all right, but neither the llvm-gcc nor dragonegg backends actually emit the IR for this. I don't know enough about gcc to fix them, though, so I leave it to their respective maintainers.

Quuxplusone commented 14 years ago
(In reply to comment #3)
> I reiterate, there's still the matter of llvm-gcc and dragonegg. GCC parses
the
> attribute all right, but neither the llvm-gcc nor dragonegg backends actually
> emit the IR for this. I don't know enough about gcc to fix them, though, so I
> leave it to their respective maintainers.
Please open a separate PR for this, so it won't get lost. Thanks!
Quuxplusone commented 14 years ago
(In reply to comment #4)
> Please open a separate PR for this, so it won't get lost. Thanks!
Done. Two new PRs have been opened, one for llvm-gcc (PR6406), one for
dragonegg (PR6407).