Skip to content

Support for sret the msvc++ way. #5430

Closed
@oscarfv

Description

@oscarfv
mannequin
Bugzilla Link 5058
Resolution WORKSFORME
Resolved on Jun 18, 2012 20:00
Version trunk
OS Windows XP
Blocks llvm/llvm-bugzilla-archive#12477
CC @AaronBallman,@asl,@tritao

Extended Description

Contrary to gcc, on msvc++ is the caller the responsible of freeing the stack space used by the sret pointer parameter.

Right now if LLVM code calls a function compiled with msvc++ that returns a struct, the application will crash due to the unbalanced stack (if the signature of the external function contains sret. If no sret is used and the address of the return struct is passed as a regular parameter, the call works).

There are other differences on sret handling among gcc and msvc++. Those are listed on page 20 of

http://www.agner.org/optimize/calling_conventions.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions