https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93072

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Joseph Myers <js...@gcc.gnu.org>:

https://gcc.gnu.org/g:e2346a33b05871fc065815d4cfd531dfa0195507

commit r10-5972-ge2346a33b05871fc065815d4cfd531dfa0195507
Author: Joseph Myers <jos...@codesourcery.com>
Date:   Wed Jan 15 02:54:27 2020 +0000

    Fix setting of DECL_CONTEXT in pushdecl (PR c/93072).

    Bug 93072 is a case where the C front end (a) wrongly interprets an
    inline declaration at block scope as indicating that DECL_CONTEXT
    should be set for an inline function and (b) this results in an ICE.
    This is a regression resulting from a previous fix of mine for other
    bugs involving such declarations being wrongly interpreted elsewhere
    as nested function declarations.  The fix is similar to the previous
    fix: use TREE_PUBLIC instead of DECL_EXTERNAL in another place as the
    relevant test to determine whether to set DECL_CONTEXT.  (When a
    variable reaches the code in question in pushdecl, the two are
    equivalent.)

    Bootstrapped with no regressions for x86_64-pc-linux-gnu.

        PR c/93072
    gcc/c:
        * c-decl.c (pushdecl): Use TREE_PUBLIC, not DECL_EXTERNAL, to
        determine whether to set DECL_CONTEXT.

    gcc/testsuite:
        * gcc.dg/inline-42.c, gcc.dg/inline-43.c: New tests.

Reply via email to