[Bug c/84721] [8 Regression] ICE in c_push_function_context, at c-decl.c:9667

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84721

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Jakub Jelinek  ---
Fixed.

[Bug c/84721] [8 Regression] ICE in c_push_function_context, at c-decl.c:9667

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84721

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar  6 20:57:30 2018
New Revision: 258302

URL: https://gcc.gnu.org/viewcvs?rev=258302=gcc=rev
Log:
PR c/84721
* c-parser.c (add_debug_begin_stmt): Don't add DEBUG_BEGIN_STMT if
!building_stmt_list_p ().

* gcc.dg/pr84721.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr84721.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-parser.c
trunk/gcc/testsuite/ChangeLog

[Bug c/84721] [8 Regression] ICE in c_push_function_context, at c-decl.c:9667

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84721

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
Created attachment 43574
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43574=edit
gcc8-pr84721.patch

Untested fix.  Besides fixing this PR, I think it is plain wrong to add the
DEBUG_BEGIN_STMTs somewhere at the file scope, they are necessarily tied to
functions, so it makes only sense to emit them inside of functions.

[Bug c/84721] [8 Regression] ICE in c_push_function_context, at c-decl.c:9667

2018-03-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84721

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
The C FE uses building_stmt_list_p predicate in multiple spots, and that
doesn't really work well if we've already pushed a DEBUG_BEGIN_STMT into some
STATEMENT_LIST.

I have an untested patch.

[Bug c/84721] [8 Regression] ICE in c_push_function_context, at c-decl.c:9667

2018-03-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84721

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1
 CC||aoliva at gcc dot gnu.org

[Bug c/84721] [8 Regression] ICE in c_push_function_context, at c-decl.c:9667

2018-03-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84721

Marek Polacek  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-05
 CC||mpolacek at gcc dot gnu.org
   Target Milestone|--- |8.0
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Started with r255569.  -gno-statement-frontiers helps.