[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2020-03-27 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

Eric Gallager  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
 CC||egallager at gcc dot gnu.org

--- Comment #25 from Eric Gallager  ---
(In reply to Nathan Sidwell from comment #23)
> Fixed trunk and gcc-9

And 8 now too:

(In reply to CVS Commits from comment #24)
> The releases/gcc-8 branch has been updated by Nathan Sidwell
> :
> 
> https://gcc.gnu.org/g:4c36b54de7ddbcb580f4b99936af4a0195db9d2f
> 
> commit r8-10145-g4c36b54de7ddbcb580f4b99936af4a0195db9d2f
> Author: Nathan Sidwell 
> Date:   Fri Mar 27 13:24:27 2020 -0700
> 
> c++: Fix ICE on popping local scope [pr84733]
> 
> PR c++/84733
> * name-lookup.c (do_pushdecl): Look through cleanp levels.

So, FIXED.

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2020-03-27 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

--- Comment #24 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Nathan Sidwell
:

https://gcc.gnu.org/g:4c36b54de7ddbcb580f4b99936af4a0195db9d2f

commit r8-10145-g4c36b54de7ddbcb580f4b99936af4a0195db9d2f
Author: Nathan Sidwell 
Date:   Fri Mar 27 13:24:27 2020 -0700

c++: Fix ICE on popping local scope [pr84733]

PR c++/84733
* name-lookup.c (do_pushdecl): Look through cleanp levels.

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2018-04-16 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

--- Comment #11 from Paolo Carlini  ---
Nope. Something deeper. The new testcase would be accepted but the declaration
of the int variable 'e' would not be usable, would be ignored.

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2018-04-16 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

--- Comment #10 from Paolo Carlini  ---
In fact, if I slightly tweak the testcase to avoid the error by defining 'e' we
would ICE again, because binding->type is found null without a preceding
diagnostic. Thus I wonder if my patchlet in Comment 7 is actually correct or is
papering over a deeper issue?!?

struct c {
  ~c();
} b;

void f() {
  try {
d:
;
  } catch (int) {
  }

  decltype(b) a;
  int e;
  struct e { } f;
}

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2018-04-13 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

--- Comment #9 from Paolo Carlini  ---
Indeed, Nathan, at some point I had that too. Or even seen_error () which we
often use lately in such cases. If nobody objects I'll send a patchlet +
testcase.

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2018-04-13 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

--- Comment #8 from Nathan Sidwell  ---
I think assert (error_count || binding->type == decl) would be better.

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2018-04-12 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

Paolo Carlini  changed:

   What|Removed |Added

 CC||paolo.carlini at oracle dot com

--- Comment #7 from Paolo Carlini  ---
For the remaining error-recovery issue, loosening a bit the assertion would be
enough - see below - I don't know if we want to dig deeper... Opinions?

Index: name-lookup.c
===
--- name-lookup.c   (revision 259340)
+++ name-lookup.c   (working copy)
@@ -2052,7 +2052,7 @@ pop_local_binding (tree id, tree decl)
 binding->value = NULL_TREE;
   else
 {
-  gcc_assert (binding->type == decl);
+  gcc_assert (!binding->type || binding->type == decl);
   binding->type = NULL_TREE;
 }

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2018-03-28 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC|nathan at gcc dot gnu.org  |

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

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

Jakub Jelinek  changed:

   What|Removed |Added

   Keywords||error-recovery
   Priority|P1  |P4

--- Comment #6 from Jakub Jelinek  ---
After the change this is only error-recovery it seems, so P4.

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

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

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek  ---
(In reply to David Malcolm from comment #1)
> The segfault started somewhere between r248121 (unaffected) and r248123
> (affected), probably r248123, so CCing Nathan.

That is not probably, but for sure.  The reason the bisect seed doesn't have
r248122 built is that that changed only whitespace in the ChangeLog, a change
that can't affect the built compiler.

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

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

Richard Biener  changed:

   What|Removed |Added

   Priority|P4  |P1
   Target Milestone|--- |8.0

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2018-03-09 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

Nathan Sidwell  changed:

   What|Removed |Added

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

--- Comment #4 from Nathan Sidwell  ---
newer ICE fixed r258383.  Older ICE remains.

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2018-03-09 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

--- Comment #3 from Nathan Sidwell  ---
Author: nathan
Date: Fri Mar  9 12:13:55 2018
New Revision: 258383

URL: https://gcc.gnu.org/viewcvs?rev=258383=gcc=rev
Log:
[PR c++/84733] ICE in check-local-shadow

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00425.html
PR c++/84733
* name-lookup.c (do_pushdecl_with_scope): Only clear
current_function_decl when pushing a non-class (i.e. namespace)
scope.

Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/name-lookup.c

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2018-03-09 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

--- Comment #2 from Nathan Sidwell  ---
Created attachment 43603
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43603=edit
A simpler testcase.  This triggers the pop_local_binding ICE

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2018-03-07 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

Nathan Sidwell  changed:

   What|Removed |Added

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

[Bug c++/84733] [8 Regression] internal compiler error: Segmentation fault (check_local_shadow())

2018-03-07 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84733

David Malcolm  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-07
 CC||dmalcolm at gcc dot gnu.org,
   ||nathan at gcc dot gnu.org
Summary|internal compiler error:|[8 Regression] internal
   |Segmentation fault  |compiler error:
   |(check_local_shadow())  |Segmentation fault
   ||(check_local_shadow())
 Ever confirmed|0   |1

--- Comment #1 from David Malcolm  ---
Confirmed with trunk.  gcc 7 and 6 show the output quoted above for 5.5.0,
with:

"confused by earlier errors, bailing out"

The trunk ICE is here:

Program received signal SIGSEGV, Segmentation fault.
check_local_shadow (decl=decl@entry=0x719d5b48) at
../../src/gcc/cp/name-lookup.c:2682
2682if (scope->kind == sk_class
(gdb) p scope
$1 = (cp_binding_level *) 0x0

The segfault started somewhere between r248121 (unaffected) and r248123
(affected), probably r248123, so CCing Nathan.

Prior to that, the:

  "confused by earlier errors, bailing out"

comes from this assertion failing in pop_local_binding:

405   gcc_assert (binding->type == decl);

masked in release builds by the "confused by earlier errors, bailing out"
post-error-ICE-handler.  This failure started somewhere between r180695
(unaffected) and r180713 (affected).