[Bug c++/87770] [8 Regression] ICE in type_dependent_expression_p, at cp/pt.c:25230

2019-02-09 Thread konraddabrowski at yahoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87770

--- Comment #7 from Konrad Dabrowski  ---
Thank you for fixing this. Would it be possible to backport this patch to the
gcc-8 branch?

[Bug c++/87770] [8/9 Regression] ICE in type_dependent_expression_p, at cp/pt.c:25230

2019-01-21 Thread konraddabrowski at yahoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87770

--- Comment #5 from Konrad Dabrowski  ---
(In reply to Alexandre Oliva from comment #4)
> Created attachment 45448 [details]
> Candidate patch

I don't know enough about gcc to assess whether this is the "correct" solution,
but I can confirm that this patch prevents the ICE both in trunk and in the
gcc-8 branch. (It also fixes the ICE in the duplicate bug #87714.)

[Bug c++/87770] New: ICE in type_dependent_expression_p, at cp/pt.c:25230

2018-10-27 Thread konraddabrowski at yahoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87770

Bug ID: 87770
   Summary: ICE in type_dependent_expression_p, at cp/pt.c:25230
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: konraddabrowski at yahoo dot co.uk
  Target Milestone: ---

This affects g++ 8 and trunk (tested on r265559), but not 7.3.0. It first
occurs in r249323.

The corresponding patch (r249333) in the g++7 branch doesn't seem to cause
problems there.

This may be a duplicate of bug 87714.

$ g++ -v -c equals3.cc
Using built-in specs.
COLLECT_GCC=/home/sage/ppl/bin4/bin/g++
Target: x86_64-pc-linux-gnu
Configured with: /home/sage/gcc/configure --prefix=/home/sage/ppl/bin4
--enable-languages=c,c++
Thread model: posix
gcc version 9.0.0 20181027 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /home/sage/ppl/bin4/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/cc1plus -quiet -v
-imultiarch x86_64-linux-gnu -D_GNU_SOURCE equals3.cc -quiet -dumpbase
equals3.c
c -mtune=generic -march=x86-64 -auxbase equals3 -version -o /tmp/cc7QKAEq.s
GNU C++14 (GCC) version 9.0.0 20181027 (experimental) (x86_64-pc-linux-gnu)
compiled by GNU C version 9.0.0 20181027 (experimental), GMP version
6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.20-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/home/sage/ppl/bin4/lib/gcc/x86_64-pc-linux-gnu/9.0.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:  
#include <...> search starts here:  

/home/sage/ppl/bin4/lib/gcc/x86_64-pc-linux-gnu/9.0.0/../../../../include/c++/9.0.0

/home/sage/ppl/bin4/lib/gcc/x86_64-pc-linux-gnu/9.0.0/../../../../include/c++/9.0.0/x86_64-pc-linux-gnu

/home/sage/ppl/bin4/lib/gcc/x86_64-pc-linux-gnu/9.0.0/../../../../include/c++/9.0.0/backward
 /home/sage/ppl/bin4/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include
 /usr/local/include
 /home/sage/ppl/bin4/include
 /home/sage/ppl/bin4/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++14 (GCC) version 9.0.0 20181027 (experimental) (x86_64-pc-linux-gnu)
compiled by GNU C version 9.0.0 20181027 (experimental), GMP version
6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.20-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 7f3b9e82dac49b25cf1b2683fd4c3f1b
equals3.cc: In instantiation of ‘d<  >::d(const d&,
a) [with e = c;  = int]’:
equals3.cc:21:8:   required from here
equals3.cc:15:18: internal compiler error: in type_dependent_expression_p, at
cp/pt.c:25230
   15 |   for (B g, h; g != h;)
  |~~^~~~
0x6446f6 type_dependent_expression_p(tree_node*)
/home/sage/gcc/gcc/cp/pt.c:25230
0x6446f6 type_dependent_expression_p(tree_node*)
/home/sage/gcc/gcc/cp/pt.c:25069
0x97c0fd uses_template_parms(tree_node*)
/home/sage/gcc/gcc/cp/pt.c:10036
0x98453f tsubst_copy
/home/sage/gcc/gcc/cp/pt.c:15438
0x99ea41 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/sage/gcc/gcc/cp/pt.c:18907
0x99f1ae tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/sage/gcc/gcc/cp/pt.c:18694
0x99f418 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/sage/gcc/gcc/cp/pt.c:18309
0x985007 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/sage/gcc/gcc/cp/pt.c:17455
0x985807 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/sage/gcc/gcc/cp/pt.c:16797
0x98506b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/sage/gcc/gcc/cp/pt.c:16939
0x986ff5 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/sage/gcc/gcc/cp/pt.c:16636
0x98506b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/sage/gcc/gcc/cp/pt.c:16939
0x9b2f97 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/sage/gcc/gcc/cp/pt.c:16621
0x9b2f97 instantiate_decl(tree_node*, bool, bool)
/home/sage/gcc/gcc/cp/pt.c:24107
0x9b6d0b instantiate_pending_templates(int)
/home/sage/gcc/gcc/cp/pt.c:24223
0x8db400 c_parse_final_cleanups()   
/home/sage/gcc/gcc/cp/decl2.c:4709
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


Minimal working example: equals3.cc:

enum a { b };
class c;
class B {
public:
  bool operator!=(B);
};
template  class d {
public