This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/82600] [8 Regression] Address of local variable returned [-Werror=return-local-addr] when building mozilla-central


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).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]