[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-30 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

Nathan Sidwell  changed:

   What|Removed |Added

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

--- Comment #11 from Nathan Sidwell  ---
Fixed r248687.

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-30 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

--- Comment #10 from Nathan Sidwell  ---
Author: nathan
Date: Tue May 30 14:43:45 2017
New Revision: 248687

URL: https://gcc.gnu.org/viewcvs?rev=248687=gcc=rev
Log:
PR c++/80913
* name-lookup.c (add_decl_to_level): Assert not making a circular
chain.
(update_binding): Don't prematurely slide artificial decl.

* g++.dg/lookup/pr80913.C: New.

Added:
trunk/gcc/testsuite/g++.dg/lookup/pr80913.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/name-lookup.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-30 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

--- Comment #9 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #7 from Nathan Sidwell  ---
> It doesn't appear to be the stathack patch at fault here.  I still get the
> infinite loop with my reduced testcase when I revert it.  (Which is good,
> because I can't see how that patch could cause this behaviour.)

This is weird since just reverting the stathack patch was enough to
allow the bootstraps to succeed for me.

Rainer

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-30 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

David Edelsohn  changed:

   What|Removed |Added

 Target|i386-pc-solaris2.12,|i386-pc-solaris2.12,
   |sparc-sun-solaris2.12   |sparc-sun-solaris2.12,
   ||powerpc-ibm-aix*
 CC||dje at gcc dot gnu.org

--- Comment #8 from David Edelsohn  ---
Probably also a cause of AIX bootstrap hang.

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-30 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

--- Comment #7 from Nathan Sidwell  ---
It doesn't appear to be the stathack patch at fault here.  I still get the
infinite loop with my reduced testcase when I revert it.  (Which is good,
because I can't see how that patch could cause this behaviour.)

I think it was my do_pushdecl change that didn't include another change I had
thought was unrelated.

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-29 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

--- Comment #6 from Nathan Sidwell  ---
I have a small reproducer, regardless of bitsize:

extern int meminfo ();
struct meminfo {};

void frob ()
{
  meminf ();
}

stat hack when the struct decl is last.  It looks like a patch I have on the
modules branch is not as orthogonal to this as I thought.

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-29 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

--- Comment #5 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #4 from Nathan Sidwell  ---
> yes, must be something with a 32-bit target.  I can reproduce it on x86_64
> linux host targeting either i386-linux or i386-solaris. 
>
> We have a TYPE_DECL whose TREE_CHAIN points to itself.  So when the spelling
> corrector iterates over the decls in a namespace it gets stuck at that point.

Good, so no point in me trying the 64-bit route.

> It's end of day here, so don't expect more progress until tomorrow.

No worries: same here, and I can always revert the patch locally until
the bug is resolved.

Thanks,
Rainer

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-29 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

--- Comment #4 from Nathan Sidwell  ---
yes, must be something with a 32-bit target.  I can reproduce it on x86_64
linux host targeting either i386-linux or i386-solaris. 

We have a TYPE_DECL whose TREE_CHAIN points to itself.  So when the spelling
corrector iterates over the decls in a namespace it gets stuck at that point.

It's end of day here, so don't expect more progress until tomorrow.

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-29 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

--- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #1 from Nathan Sidwell  ---
[...]
> But x86_64-linux is not being affected in the way you describe.  The backtrace
> is something borking in the spelling correcting stuff.

Maybe it's a 64-bit vs. 32-bit thing then?  I could try
amd64-pc-solaris2.12 and sparcv9-sun-solaris2.12 bootstraps with your
patch included once the current ones have finished.

Rainer

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-29 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

--- Comment #2 from Nathan Sidwell  ---
oh, you said that in the title :)

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-29 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

--- Comment #1 from Nathan Sidwell  ---
My money's on:
Stat hack representation
* name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
(stat_hack): New.
(find_namespace_binding): Replace with ...
(find_namespace_slot): ... this.
(find_namespace_value): New.
(name_lookup::search_namespace_only,
name_lookup::adl_namespace_only): Adjust.
(update_binding): Add SLOT parameter, adjust.
(check_local_shadow): Use find_namespace_value.
(set_local_extern_decl_linkage): Likewise.
(do_pushdecl): Adjust for namespace slot.
(push_local_binding): Assert not a namespace binding.
(check_for_out_of_scope_variable): Use find_namespace_value.
(set_identifier_type_value_with_scope): Likewise.
(get_namespace_binding): Likewise.
(set_namespace_binding): Delete.
(set_global_binding): Directly update the binding.
(finish_namespace_using_decl): Likewise.
(lookup_type_scope_1): Use find_namespace_slot and update.
(do_push_nested_namespace): Use find_namespace_value.

But x86_64-linux is not being affected in the way you describe.  The backtrace
is something borking in the spelling correcting stuff.

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-29 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

Nathan Sidwell  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-05-29
   Assignee|unassigned at gcc dot gnu.org  |nathan at gcc dot 
gnu.org
 Ever confirmed|0   |1

[Bug c++/80913] [8 regression] Infinite loop in cc1plus with stat hack patch

2017-05-29 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80913

Rainer Orth  changed:

   What|Removed |Added

   Target Milestone|--- |8.0