This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82600] [8 Regression] Address of local variable returned [-Werror=return-local-addr] when building mozilla-central
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 18 Oct 2017 10:30:33 +0000
- Subject: [Bug c++/82600] [8 Regression] Address of local variable returned [-Werror=return-local-addr] when building mozilla-central
- Auto-submitted: auto-generated
- References: <bug-82600-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82600
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 42392
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42392&action=edit
gcc8-pr82600.patch
Untested fix. The problem is that the -Wreturn-local-addr implementation
requires full folding of the expressions such that it will actually not see
an ARRAY_REF if the corresponding DECL isn't an array, but a pointer.
Such folding isn't performed if processing_template_decl though (no folding is
done, cp_fully_fold just returns the passed argument immediately).