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

LLVM: rustllvm produces unsilenceable warnings on new versions of GCC (9.2.0) #69078

Closed
petrochenkov opened this issue Feb 11, 2020 · 1 comment · Fixed by #69473
Closed

LLVM: rustllvm produces unsilenceable warnings on new versions of GCC (9.2.0) #69078

petrochenkov opened this issue Feb 11, 2020 · 1 comment · Fixed by #69473
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

... which are pretty annoying.
It probably wouldn't be a problem if Cargo didn't cache the warnings and didn't display them on every build, even if rustllvm isn't actually built.

Example of the warnings:

warning: In file included from ../rustllvm/rustllvm.h:4,
warning:                  from ../rustllvm/PassWrapper.cpp:6:
warning: C:/msys64/home/we/rust/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h: In instantiation of 'llvm::ArrayRef<T>::ArrayRef(const std::initializer_list<_Tp>&) [with T = long long unsigned int]':
warning: C:/msys64/home/we/rust/src/llvm-project/llvm/include/llvm/IR/DIBuilder.h:644:74:   required from here
warning: C:/msys64/home/we/rust/src/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:101:37: warning: initializing 'llvm::ArrayRef<long long unsigned int>::Data' from 'std::initializer_list<long long unsigned int>::begin' does not extend the lifetime of the underlying array [-Winit-list-lifetime]
warning:   101 |     : Data(Vec.begin() == Vec.end() ? (T*)nullptr : Vec.begin()),

This is fixed in LLVM upstream (llvm/llvm-project@6c2151b), so that commit can be cherry-picked into our LLVM fork.

The commit seems to be included into LLVM 10, but I'm not sure when #67759 will be able to land.

@petrochenkov petrochenkov added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Feb 11, 2020
@Mark-Simulacrum
Copy link
Member

We might want to hide the LLVM/rustllvm build log from users -- similar to how Cargo hides upstream, non-local, path deps. We'd probably want to stick this behind an option or something like that for those who are compiling LLVM after changing it locally.

contrun pushed a commit to contrun/llvm-project that referenced this issue Feb 25, 2020
See issue rust-lang/rust#69078 for details

---

[cmake] Disable GCC 9's -Winit-list-lifetime warning in ArrayRef

Summary:
This is a new warning which fires when one stores a reference to the
initializer_list contents in a way which may outlive the
initializer_list which it came from. In llvm this warning is triggered
whenever someone uses the initializer_list ArrayRef constructor.

This is indeed a dangerous thing to do (I myself was bitten by that at
least once), but it is not more dangerous than calling other ArrayRef
constructors with temporary objects -- something which we are used to
and have accepted as a tradeoff for ArrayRef's efficiency.

Currently, this warnings generates so much output that it completely
obscures any actionable warnings, so this patch disables it.

Reviewers: rnk, aaron.ballman

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70122

(cherry picked from commit 6c2151b)
cuviper pushed a commit to rust-lang/llvm-project that referenced this issue Feb 25, 2020
See issue rust-lang/rust#69078 for details

---

[cmake] Disable GCC 9's -Winit-list-lifetime warning in ArrayRef

Summary:
This is a new warning which fires when one stores a reference to the
initializer_list contents in a way which may outlive the
initializer_list which it came from. In llvm this warning is triggered
whenever someone uses the initializer_list ArrayRef constructor.

This is indeed a dangerous thing to do (I myself was bitten by that at
least once), but it is not more dangerous than calling other ArrayRef
constructors with temporary objects -- something which we are used to
and have accepted as a tradeoff for ArrayRef's efficiency.

Currently, this warnings generates so much output that it completely
obscures any actionable warnings, so this patch disables it.

Reviewers: rnk, aaron.ballman

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70122

(cherry picked from commit 6c2151b)

Co-authored-by: Pavel Labath <pavel@labath.sk>
@jonas-schievink jonas-schievink added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 26, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 26, 2020
JohnTitor added a commit to JohnTitor/rust that referenced this issue Feb 27, 2020
@bors bors closed this as completed in 6a17905 Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants