Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove noalias on return values #22018

Closed
wants to merge 1 commit into from
Closed

Conversation

dotdash
Copy link
Contributor

@dotdash dotdash commented Feb 6, 2015

On return values noalias has a stricter meaning than on arguments. It
means that the function is malloc-like. To quote the LLVM docs:

Furthermore, the semantics of the noalias attribute on return values
are stronger than the semantics of the attribute when used on
function arguments. On function return values, the noalias attribute
indicates that the function acts like a system memory allocation
function, returning a pointer to allocated storage disjoint from the
storage for any other object accessible to the caller.

We use it for all kinds of functions, which is wrong, so let's stop
doing that.

Fixes #21996

On return values `noalias` has a stricter meaning than on arguments. It
means that the function is malloc-like. To quote the LLVM docs:

    Furthermore, the semantics of the noalias attribute on return values
    are stronger than the semantics of the attribute when used on
    function arguments. On function return values, the noalias attribute
    indicates that the function acts like a system memory allocation
    function, returning a pointer to allocated storage disjoint from the
    storage for any other object accessible to the caller.

We use it for all kinds of functions, which is wrong, so let's stop
doing that.

Fixes rust-lang#21996
@rust-highfive
Copy link
Contributor

r? @nick29581

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

@bors: r+ 7fbcdf6 rollup

@alexcrichton alexcrichton assigned alexcrichton and unassigned nrc Feb 6, 2015
@alexcrichton
Copy link
Member

@bors: r-

@dotdash
Copy link
Contributor Author

dotdash commented Feb 6, 2015

I just realized that the rationale given here makes no sense at all. The attribute is on a sret argument, not actually a return value. Will need more analysis

@dotdash
Copy link
Contributor Author

dotdash commented Feb 7, 2015

Yeah, this just worked around the actual issue that caused #21996.

@dotdash dotdash closed this Feb 7, 2015
@dotdash dotdash deleted the bad_noalias branch February 6, 2018 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LLVM poisons partially undef constant, leading to infinite loops.
4 participants