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

Build errors on Clang 3.7 because of new move diagnostics #1016

Closed
dean0x7d opened this issue Nov 27, 2015 · 9 comments
Closed

Build errors on Clang 3.7 because of new move diagnostics #1016

dean0x7d opened this issue Nov 27, 2015 · 9 comments

Comments

@dean0x7d
Copy link
Contributor

Trying to compile with Clang 3.7 results in the following errors because of -Werror and the new move warnings which are included with -Wall in the 3.7 release.

~/pyston_deps/llvm-trunk/include/llvm/ADT/APFloat.h:352:12: 
error: redundant move in return statement [-Werror,-Wredundant-move]
    return std::move(Value);
           ^
../../src/codegen/compvars.cpp:2548:16:
error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
        return std::move(elts);
               ^

Note that the first error already has a fix in LLVM.

@sYnfo
Copy link

sYnfo commented Nov 28, 2015

👍 I'm bumping into the same issue.

undingen added a commit to undingen/pyston_v1 that referenced this issue Nov 30, 2015
undingen added a commit to undingen/pyston_v1 that referenced this issue Nov 30, 2015
The issue got fixed in llvm r236316
undingen added a commit to undingen/pyston_v1 that referenced this issue Nov 30, 2015
@undingen
Copy link
Contributor

Could you please test if #1019 fixes the issue if you have time or if there are additional warnings which need to get fixed.
Thanks

@sYnfo
Copy link

sYnfo commented Nov 30, 2015

Unless I'm doing something wrong the patch doesn't seem to help:

https://gist.github.com/sYnfo/826bad71a20360700a3f

@undingen
Copy link
Contributor

Ok I updated the patch to include fixes for the warnings in your log. Could you please try again?
If more problems show up I will install 3.7 :-D

@dean0x7d
Copy link
Contributor Author

The patch does help: it clears the LLVM specific warnings.
But there are a few other -Wredundant-move warnings not related to LLVM and a large number of new -Wshift-negative-value messages show up now.

I've been looking into this and I can submit a pull request with the clang 3.7 fixes a bit later today.

@undingen
Copy link
Contributor

I don't know if you have seen it but I replied a few seconds before your last replay :-D to let you know that I updated the patch to fix the remaining warnings (hope that those where the last ones..).

@dean0x7d
Copy link
Contributor Author

Ah, I missed your previous post. But there is actually a lot more. I have the fixes on my fork.
There are 2 fixes for -Wredundant-move: 3205005
And 10 for -Wshift-negative-value: 60644ab

That takes care of all the warnings, but then something truly weird happens. The compiler crashes :-/
As far as I can tell the crash happens on these two lines with delete obj; here and here. If I comment out those two lines, the build completes successfully.

I'm not sure if it's just something with my system or a genuine bug in Clang 3.7.

@kmod
Copy link
Collaborator

kmod commented Dec 1, 2015

Ok I set up a container with clang-3.7 and I'll take a look :)

@kmod
Copy link
Collaborator

kmod commented Dec 2, 2015

I'm running into the same clang bug -- I think this is a legit compiler bug so I filed it on the clang tracker. I think I found a workaround, and the build is succeeding in my container, so I opened #1020. The tests aren't all passing though, but I'm guessing it's because I did this in a 15.10 container; I haven't looked into the test failures much (io_test is failing, set comparisons aren't being allowed in some places CPython is letting them, and stack_limits is failing).

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

No branches or pull requests

4 participants