public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
@ 2022-11-11 12:12 ro at gcc dot gnu.org
2022-11-11 13:37 ` [Bug rust/107633] " rguenth at gcc dot gnu.org
` (12 more replies)
0 siblings, 13 replies; 14+ messages in thread
From: ro at gcc dot gnu.org @ 2022-11-11 12:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
Bug ID: 107633
Summary: [13 regression] Bootstrap failure due to
-Werror=unused-parameter and
-Werror=dangling-reference
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rust
Assignee: unassigned at gcc dot gnu.org
Reporter: ro at gcc dot gnu.org
CC: dkm at gcc dot gnu.org
Target Milestone: ---
Host: i386-pc-solaris2.11
Target: i386-pc-solaris2.11
Build: i386-pc-solaris2.11
I just tried bootstrapping the current devel/rust/master branch on Solaris/x86,
but ran into quite number of failues:
* For one, there were hundreds of instances of -Werror=unused-parameter, e.g.
/vol/gcc/src/hg/master/rust/gcc/rust/lex/rust-lex.cc: In member function
'std::tuple<Rust::Codepoint, int, bool> Rust::Lexer::parse_utf8_escape(char)':
/vol/gcc/src/hg/master/rust/gcc/rust/lex/rust-lex.cc:1326:32: error: unused
parameter 'opening_char' [-Werror=unused-parameter]
1326 | Lexer::parse_utf8_escape (char opening_char)
| ~~~~~^~~~~~~~~~~~
/vol/gcc/src/hg/master/rust/gcc/rust/ast/rust-ast-dump.cc: In member function
'virtual void Rust::AST::Dump::visit(Rust::AST::AttrInputMetaItemContainer&)':
/vol/gcc/src/hg/master/rust/gcc/rust/ast/rust-ast-dump.cc:243:42: error: unused
parameter 'input' [-Werror=unused-parameter]
243 | Dump::visit (AttrInputMetaItemContainer &input)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
* With those worked around (see below), there still a couple of
-Werror=dangling-reference
errors:
/vol/gcc/src/hg/master/rust/gcc/rust/typecheck/rust-hir-type-check-type.cc: In
member function 'Rust::TyTy::BaseType*
Rust::Resolver::TypeCheckType::resolve_segments(Rust::NodeId, Rust::HirId,
std::vector<std::unique_ptr<Rust::HIR::TypePathSegment> >&, std::size_t,
Rust::TyTy::BaseType*, const Rust::Analysis::NodeMapping&, Location)':
/vol/gcc/src/hg/master/rust/gcc/rust/typecheck/rust-hir-type-check-type.cc:465:13:
error: possibly dangling reference to a temporary [-Werror=dangling-reference]
465 | auto &candidate = *candidates.begin ();
| ^~~~~~~~~
/vol/gcc/src/hg/master/rust/gcc/rust/typecheck/rust-hir-type-check-type.cc:465:44:
note: the temporary was destroyed at the end of the full expression
'candidates.std::set<Rust::Resolver::PathProbeCandidate>::begin().std::_Rb_tree_const_iterator<Rust::Resolver::PathProbeCandidate>::operator*()'
465 | auto &candidate = *candidates.begin ();
|
I've hacked around both by adding -Wno-error=unused-parameter
-Wno-error=dangling-reference
to gcc/rust/Make-lang.in (RUST_CXXFLAGS), but this is supposed to work out of
the box. The build is in stage 2 now.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
@ 2022-11-11 13:37 ` rguenth at gcc dot gnu.org
2022-11-11 13:45 ` redi at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-11-11 13:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
2022-11-11 13:37 ` [Bug rust/107633] " rguenth at gcc dot gnu.org
@ 2022-11-11 13:45 ` redi at gcc dot gnu.org
2022-11-11 13:48 ` redi at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-11 13:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Rainer Orth from comment #0)
> /vol/gcc/src/hg/master/rust/gcc/rust/typecheck/rust-hir-type-check-type.cc:
> In member function 'Rust::TyTy::BaseType*
> Rust::Resolver::TypeCheckType::resolve_segments(Rust::NodeId, Rust::HirId,
> std::vector<std::unique_ptr<Rust::HIR::TypePathSegment> >&, std::size_t,
> Rust::TyTy::BaseType*, const Rust::Analysis::NodeMapping&, Location)':
> /vol/gcc/src/hg/master/rust/gcc/rust/typecheck/rust-hir-type-check-type.cc:
> 465:13: error: possibly dangling reference to a temporary
> [-Werror=dangling-reference]
> 465 | auto &candidate = *candidates.begin ();
This should probably be:
auto first = candidates.begin ();
auto &candidate = *first;
so that the iterator persists as long as its value is needed.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
2022-11-11 13:37 ` [Bug rust/107633] " rguenth at gcc dot gnu.org
2022-11-11 13:45 ` redi at gcc dot gnu.org
@ 2022-11-11 13:48 ` redi at gcc dot gnu.org
2022-11-11 15:03 ` mpolacek at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-11 13:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Oh wait, that's a std::set::iterator? Then the warning is wrong. Its operator*
returns a reference to something that outlives the iterator itself.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
` (2 preceding siblings ...)
2022-11-11 13:48 ` redi at gcc dot gnu.org
@ 2022-11-11 15:03 ` mpolacek at gcc dot gnu.org
2022-11-11 15:09 ` mpolacek at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-11-11 15:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I thought this had been fixed by
commit 32a06ce38a38bf37db468f0e6c83520fcc221534
Author: Marek Polacek <polacek@redhat.com>
Date: Tue Nov 1 17:05:52 2022 -0400
c++: Quash -Wdangling-reference for member operator* [PR107488]
-Wdangling-reference complains here:
std::vector<int> v = ...;
std::vector<int>::const_iterator it = v.begin();
while (it != v.end()) {
const int &r = *it++; // warning
}
is the operator* here a non-member function?
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
` (3 preceding siblings ...)
2022-11-11 15:03 ` mpolacek at gcc dot gnu.org
@ 2022-11-11 15:09 ` mpolacek at gcc dot gnu.org
2022-11-11 20:27 ` mpolacek at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-11-11 15:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Actually, the patch I plan to post in a little bit should fix the problem above
because the reference we're initializing here is non-const.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
` (4 preceding siblings ...)
2022-11-11 15:09 ` mpolacek at gcc dot gnu.org
@ 2022-11-11 20:27 ` mpolacek at gcc dot gnu.org
2022-11-14 11:26 ` ro at CeBiTec dot Uni-Bielefeld.DE
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-11-11 20:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
https://gcc.gnu.org/pipermail/gcc-patches/2022-November/605800.html, if
accepted, should help.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
` (5 preceding siblings ...)
2022-11-11 20:27 ` mpolacek at gcc dot gnu.org
@ 2022-11-14 11:26 ` ro at CeBiTec dot Uni-Bielefeld.DE
2022-11-14 12:12 ` dkm at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2022-11-14 11:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
--- Comment #6 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
> https://gcc.gnu.org/pipermail/gcc-patches/2022-November/605800.html, if
> accepted, should help.
The patch doesn't apply cleanly to the devel/rust/master branch,
unfortunately. Even when I adjust it manually, the build fails with
/vol/gcc/src/hg/master/rust/gcc/cp/call.cc: In function 'void
maybe_warn_dangling_reference(const_tree, tree)':
/vol/gcc/src/hg/master/rust/gcc/cp/call.cc:13547:5: error: 'std_pair_ref_ref_p'
was not declared in this scope
13547 | || std_pair_ref_ref_p (type)))
| ^~~~~~~~~~~~~~~~~~
I'll leave this to the rust developers to figure out: my primary goal
was to check if the branch still builds on Solaris and has reasonable
rust test results.
Another message to the developers is to try a bootstrap build once in a
while: while non-bootstrap is certainly reasonable during development,
finding that bootstrap is broken shortly before the merge date isn't the
best idea, I believe ;-)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
` (6 preceding siblings ...)
2022-11-14 11:26 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2022-11-14 12:12 ` dkm at gcc dot gnu.org
2022-11-17 10:18 ` cohenarthur.dev at gmail dot com
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dkm at gcc dot gnu.org @ 2022-11-14 12:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
--- Comment #7 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
Hello,
(I'm merely proxying some info here)
We do have regular bootstrap builds (see
https://builder.sourceware.org/buildbot/#/builders/107 ) and were aware of the
breakage (but I'm not sure you can observe it in this builder, I'll investigate
why)
Arthur already has a pending change that should fix this, see:
https://github.com/Rust-GCC/gccrs/pull/1635
Not really sure how it interacts with Marek's fix. I've pinged Arthur so this
will be handled at some point :)
Thanks!
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
` (7 preceding siblings ...)
2022-11-14 12:12 ` dkm at gcc dot gnu.org
@ 2022-11-17 10:18 ` cohenarthur.dev at gmail dot com
2022-11-17 15:22 ` mpolacek at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cohenarthur.dev at gmail dot com @ 2022-11-17 10:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
Arthur Cohen <cohenarthur.dev at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |cohenarthur.dev at gmail dot com
--- Comment #8 from Arthur Cohen <cohenarthur.dev at gmail dot com> ---
Hi there,
The problem has been fixed and our bootstrap build is green again :) this will
be fixed in the v4 of patches that I will send soon.
Sorry for the frustration caused!
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
` (8 preceding siblings ...)
2022-11-17 10:18 ` cohenarthur.dev at gmail dot com
@ 2022-11-17 15:22 ` mpolacek at gcc dot gnu.org
2022-12-14 13:42 ` tschwinge at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-11-17 15:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #9 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed then.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
` (9 preceding siblings ...)
2022-11-17 15:22 ` mpolacek at gcc dot gnu.org
@ 2022-12-14 13:42 ` tschwinge at gcc dot gnu.org
2022-12-14 14:49 ` tschwinge at gcc dot gnu.org
2022-12-14 15:40 ` [Bug rust/107633] " tschwinge at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2022-12-14 13:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|i386-pc-solaris2.11 |
Build|i386-pc-solaris2.11 |
Host|i386-pc-solaris2.11 |
Assignee|unassigned at gcc dot gnu.org |tschwinge at gcc dot gnu.org
CC| |tschwinge at gcc dot gnu.org
See Also| |https://github.com/Rust-GCC
| |/gccrs/pull/1703
--- Comment #10 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #3)
> I thought this had been fixed by
>
> commit 32a06ce38a38bf37db468f0e6c83520fcc221534
> Author: Marek Polacek <polacek@redhat.com>
> Date: Tue Nov 1 17:05:52 2022 -0400
>
> c++: Quash -Wdangling-reference for member operator* [PR107488]
ACK; <https://github.com/Rust-GCC/gccrs/pull/1703>.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
` (10 preceding siblings ...)
2022-12-14 13:42 ` tschwinge at gcc dot gnu.org
@ 2022-12-14 14:49 ` tschwinge at gcc dot gnu.org
2022-12-14 15:40 ` [Bug rust/107633] " tschwinge at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2022-12-14 14:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://github.com/Rust-GCC
| |/gccrs/pull/1701
--- Comment #11 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
(In reply to Rainer Orth from comment #0)
> hundreds of instances of -Werror=unused-parameter
For the record, these were "fixed" ;-) with
<https://github.com/Rust-GCC/gccrs/pull/1701> "Standardize warning flags".
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug rust/107633] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
` (11 preceding siblings ...)
2022-12-14 14:49 ` tschwinge at gcc dot gnu.org
@ 2022-12-14 15:40 ` tschwinge at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2022-12-14 15:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |build
Version|13.0 |rust/master
Summary|[13 regression] Bootstrap |Bootstrap failure due to
|failure due to |-Werror=unused-parameter
|-Werror=unused-parameter |and
|and |-Werror=dangling-reference
|-Werror=dangling-reference |
--- Comment #12 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
(In reply to Marc Poulhiès from comment #7)
> Arthur already has a pending change that should fix this, see:
>
> https://github.com/Rust-GCC/gccrs/pull/1635
... which has later been reverted; needs some more attention.
---
However, all issues reported here (as far as I understand) have now been
addressed individually in GCC/Rust master branch. (At least,
x86_64-pc-linux-gnu bootstrap is now again "green" in my testing.)
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2022-12-14 15:40 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11 12:12 [Bug rust/107633] New: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference ro at gcc dot gnu.org
2022-11-11 13:37 ` [Bug rust/107633] " rguenth at gcc dot gnu.org
2022-11-11 13:45 ` redi at gcc dot gnu.org
2022-11-11 13:48 ` redi at gcc dot gnu.org
2022-11-11 15:03 ` mpolacek at gcc dot gnu.org
2022-11-11 15:09 ` mpolacek at gcc dot gnu.org
2022-11-11 20:27 ` mpolacek at gcc dot gnu.org
2022-11-14 11:26 ` ro at CeBiTec dot Uni-Bielefeld.DE
2022-11-14 12:12 ` dkm at gcc dot gnu.org
2022-11-17 10:18 ` cohenarthur.dev at gmail dot com
2022-11-17 15:22 ` mpolacek at gcc dot gnu.org
2022-12-14 13:42 ` tschwinge at gcc dot gnu.org
2022-12-14 14:49 ` tschwinge at gcc dot gnu.org
2022-12-14 15:40 ` [Bug rust/107633] " tschwinge at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).