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

            Bug ID: 83187
           Summary: [8 regression] internal compiler error: in
                    get_alias_set, at alias.c:923
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: skpgkp1 at gmail dot com
  Target Milestone: ---

This issue appear in GCC 8. GCC 7 works fine. Following are steps to reproduce.

$cat OFDM.i.cpp
extern "C" {
double cos(double);
double sin(double);
}
template <typename> class a;
template <> struct a<double> {
  typedef __complex__ b;
  a(double c, double p2) : k{c, p2} {}
  b k;
};
typedef double d;
d e;
class f {
  a<d> g;
  void h();
};
void f::h() {
  const d i = e;
  g = a<d>(cos(e), sin(e));
}

$g++ --version
g++ (GCC) 8.0.0 20171127 (experimental)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++  -O1 -c -o OFDM.i.cpp.o OFDM.i.cpp
during RTL pass: expand
OFDM.i.cpp: In member function ‘void f::h()’:
OFDM.i.cpp:19:5: internal compiler error: in get_alias_set, at alias.c:923
   g = a<d>(cos(e), sin(e));
   ~~^~~~~~~~~~~~~~~~~~~~~~
0x6653a7 get_alias_set(tree_node*)
        ../../gcc-main.3O1J/gcc/alias.c:923
0xb2dc4e component_uses_parent_alias_set_from(tree_node const*)
        ../../gcc-main.3O1J/gcc/alias.c:657
0xc38693 set_mem_attributes_minus_bitpos(rtx_def*, tree_node*, int, long)
        ../../gcc-main.3O1J/gcc/emit-rtl.c:1920
0xc7185d expand_assignment(tree_node*, tree_node*, bool)
        ../../gcc-main.3O1J/gcc/expr.c:5181
0xb6a2f8 expand_gimple_stmt_1
        ../../gcc-main.3O1J/gcc/cfgexpand.c:3675
0xb6a2f8 expand_gimple_stmt
        ../../gcc-main.3O1J/gcc/cfgexpand.c:3773
0xb6b637 expand_gimple_basic_block
        ../../gcc-main.3O1J/gcc/cfgexpand.c:5772
0xb704c6 execute
        ../../gcc-main.3O1J/gcc/cfgexpand.c:6373
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.

### GCC 7 works fine.

$g++ --version
g++ (GCC) 7.2.1 20171127
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++  -O1 -c -o OFDM.i.cpp.o OFDM.i.cpp
$echo $?
0

Reply via email to