public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/94239] [10 regression] cc1 SEGV in get_location_from_adhoc_loc with gcc.dg/pr20245-1.c etc.
Date: Tue, 07 Apr 2020 19:03:51 +0000	[thread overview]
Message-ID: <bug-94239-4-L7JahlWCXG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94239-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

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

commit r9-8467-gf83c2d2991a762f729741a409a1ac7871733ee40
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Mar 23 19:44:58 2020 +0100

    c: Fix up cfun->function_end_locus on invalid function bodies [PR94239]

    Unfortunately the patch broke
    +FAIL: gcc.dg/pr20245-1.c (internal compiler error)
    +FAIL: gcc.dg/pr20245-1.c (test for excess errors)
    +FAIL: gcc.dg/pr28419.c (internal compiler error)
    +FAIL: gcc.dg/pr28419.c (test for excess errors)
    on some targets (and under valgrind on the rest of them).

    Those functions don't have the opening { and so c_parser_compound_statement
    returned error_mark_node before initializing *endlocp.
    So, either we can initialize it in that case too:
    --- gcc/c/c-parser.c    2020-03-20 22:09:39.659411721 +0100
    +++ gcc/c/c-parser.c    2020-03-21 09:36:44.455705261 +0100
    @@ -5611,6 +5611,8 @@ c_parser_compound_statement (c_parser *p
             if we have just prepared to enter a function body.  */
           stmt = c_begin_compound_stmt (true);
           c_end_compound_stmt (brace_loc, stmt, true);
    +      if (endlocp)
    +       *endlocp = brace_loc;
           return error_mark_node;
         }
       stmt = c_begin_compound_stmt (true);
    or perhaps simpler initialize it to the function_start_locus at the
    beginning and have those functions without { have function_start_locus ==
    function_end_locus like the __GIMPLE functions (where propagating the
    closing } seemed too difficult).

    2020-03-23  Jakub Jelinek  <jakub@redhat.com>

            PR gcov-profile/94029
            PR c/94239
            * c-parser.c (c_parser_declaration_or_fndef): Initialize endloc to
            the function_start_locus location.  Don't do that afterwards for
the
            __GIMPLE body parsing.

      parent reply	other threads:[~2020-04-07 19:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20 16:28 [Bug c/94239] New: " ro at gcc dot gnu.org
2020-03-20 16:28 ` [Bug c/94239] " ro at gcc dot gnu.org
2020-03-20 16:38 ` msebor at gcc dot gnu.org
2020-03-21  2:44 ` law at redhat dot com
2020-03-21  8:48 ` jakub at gcc dot gnu.org
2020-03-21 13:47 ` seurer at linux dot vnet.ibm.com
2020-03-22 15:06 ` ro at CeBiTec dot Uni-Bielefeld.DE
2020-03-22 18:07 ` jakub at gcc dot gnu.org
2020-03-23  7:32 ` rguenth at gcc dot gnu.org
2020-03-23 17:01 ` jakub at gcc dot gnu.org
2020-03-23 18:46 ` cvs-commit at gcc dot gnu.org
2020-03-23 18:49 ` jakub at gcc dot gnu.org
2020-04-07 19:03 ` cvs-commit at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94239-4-L7JahlWCXG@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).