[Bug c++/82159] [6 Regression] ICE: in assign_temp, at function.c:961

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

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #20 from Jakub Jelinek  ---
Fixed for 6.5 too.

[Bug c++/82159] [6 Regression] ICE: in assign_temp, at function.c:961

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

--- Comment #19 from Jakub Jelinek  ---
Author: jakub
Date: Mon Jun 25 16:46:54 2018
New Revision: 262030

URL: https://gcc.gnu.org/viewcvs?rev=262030&root=gcc&view=rev
Log:
Backported from mainline
2017-10-12  Jakub Jelinek  

PR c++/82159
* expr.c (store_field): Don't optimize away bitsize == 0 store
from CALL_EXPR with addressable return type.

* g++.dg/opt/pr82159-2.C: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/opt/pr82159-2.C
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/expr.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug c++/82159] [6 Regression] ICE: in assign_temp, at function.c:961

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

--- Comment #18 from Jakub Jelinek  ---
Author: jakub
Date: Mon Jun 25 16:43:16 2018
New Revision: 262026

URL: https://gcc.gnu.org/viewcvs?rev=262026&root=gcc&view=rev
Log:
Backported from mainline
2017-09-27  Jakub Jelinek  

PR c++/82159
* gimplify.c (gimplify_modify_expr): Don't optimize away zero sized
lhs from calls if the lhs has addressable type.

* g++.dg/opt/pr82159.C: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/opt/pr82159.C
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/gimplify.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug c++/82159] [6 Regression] ICE: in assign_temp, at function.c:961

2017-10-27 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82159

--- Comment #17 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 27 20:35:06 2017
New Revision: 254181

URL: https://gcc.gnu.org/viewcvs?rev=254181&root=gcc&view=rev
Log:
Backported from mainline
2017-10-12  Jakub Jelinek  

PR c++/82159
* expr.c (store_field): Don't optimize away bitsize == 0 store
from CALL_EXPR with addressable return type.

* g++.dg/opt/pr82159-2.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/opt/pr82159-2.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/expr.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/82159] [6 Regression] ICE: in assign_temp, at function.c:961

2017-10-12 Thread chr at terma dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82159

--- Comment #16 from chr at terma dot com ---
(In reply to Jakub Jelinek from comment #14)
> Created attachment 42340 [details]
> gcc8-pr82159.patch
> 
> Untested fix for that.

Applied both patches to GCC 7.2.0. Works for us.

[Bug c++/82159] [6 Regression] ICE: in assign_temp, at function.c:961

2017-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82159

--- Comment #15 from Jakub Jelinek  ---
Author: jakub
Date: Thu Oct 12 07:23:24 2017
New Revision: 253673

URL: https://gcc.gnu.org/viewcvs?rev=253673&root=gcc&view=rev
Log:
PR c++/82159
* expr.c (store_field): Don't optimize away bitsize == 0 store
from CALL_EXPR with addressable return type.

* g++.dg/opt/pr82159-2.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/opt/pr82159-2.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/expr.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/82159] [6 Regression] ICE: in assign_temp, at function.c:961

2017-10-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82159

--- Comment #14 from Jakub Jelinek  ---
Created attachment 42340
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42340&action=edit
gcc8-pr82159.patch

Untested fix for that.

[Bug c++/82159] [6 Regression] ICE: in assign_temp, at function.c:961

2017-10-11 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82159

--- Comment #13 from Martin Liška  ---
(In reply to chr from comment #12)
> I've build a gcc 7.2.0 + above patch using crosstool ng. The original test
> code passes, so I should have managed to succesfully create a patches gcc. 
> 

Confirm, all branches affected. Started also with r232167.

[Bug c++/82159] [6 Regression] ICE: in assign_temp, at function.c:961

2017-10-11 Thread chr at terma dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82159

--- Comment #12 from chr at terma dot com ---
I've build a gcc 7.2.0 + above patch using crosstool ng. The original test code
passes, so I should have managed to succesfully create a patches gcc. 

Steps to Repro:
-

g++ -c -O0 testcase2.cpp
testcase2.cpp: In constructor 'bd<  >::bg::bg(bd<
 >::bb, bf) [with bf = l;  =
bc<2, double>]':
testcase2.cpp:37:31: internal compiler error: in assign_temp, at function.c:968
 bg(bb, bf n) : bh(n.ap - 0) {}


Source file testcase2.cpp:
-

template  class d { b e; };
class f : d {
public:
  f(const f &);
};
class g : f {
public:
  template  g operator-(h);
};
template  class i {
public:
  typedef typename ai::template j ak;
};
template  class k { typename i::ak an; };
class l {
public:
  g ap;
};
class aq {
public:
  ~aq();
};
template  class m : ar {
public:
  template  m(at, au);
  l av;
  virtual void aw() { ar::ax(&av); }
};
template  class bc;
template  class bd {
public:
  typedef int bb;
  class be {};
  template  class bg {
  public:
g bh;
bg(bb, bf n) : bh(n.ap - 0) {}
  };
  bd(bb, be);
};
template  class o;
template 
class o>> : public bd>::be {};
class L : bd> {
  class p : aq {
  public:
void ax(l *p1) {
  bb a;
  bg(a, *p1);
}
  };

public:
  template  L(at p1, au n) : bd(p1, n) {}
  int br;
  virtual int bs() { m(this, br); }
};
template  class q {
  o>> bv;
  virtual L bw() { L(0, bv); }
};
template  class by> class r {
public:
  r() { by(); }
};
class s {
public:
  template  class j : r {};
};
void t() { k c; }

int main() {
return 0;
}

Compiler used:
-
x86_64-corei7_avx-linux-gnu-g++ -v
Using built-in specs.
COLLECT_GCC=x86_64-corei7_avx-linux-gnu-g++
COLLECT_LTO_WRAPPER=/home/ries/work/build/tools/x86_64/gcc-7.2.0-glibc-2.25-x86_64/x86_64-corei7_avx-linux-gnu/libexec/gcc/x86_64-corei7_avx-linux-gnu/7.2.0/lto-wrapper
Target: x86_64-corei7_avx-linux-gnu
Configured with:
/home/ries/work/build/tools/x86_64/gcc-7.2.0-glibc-2.25-x86_64/.build/x86_64-corei7_avx-linux-gnu/src/gcc/configure
--build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu
--target=x86_64-corei7_avx-linux-gnu
--prefix=/home/ries/work/build/tools/x86_64/gcc-7.2.0-glibc-2.25-x86_64/x86_64-corei7_avx-linux-gnu
--with-sysroot=/home/ries/work/build/tools/x86_64/gcc-7.2.0-glibc-2.25-x86_64/x86_64-corei7_avx-linux-gnu/x86_64-corei7_avx-linux-gnu/sysroot
--enable-languages=c,c++ --with-arch=corei7-avx --with-tune=corei7-avx
--with-pkgversion='crosstool-NG
astrax_ASTRAX_902085-002_REL_A-2760-gc1aa3992abc-dirty' --enable-__cxa_atexit
--disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath
--disable-libquadmath-support --disable-libsanitizer --enable-libmpx
--with-gmp=/home/ries/work/build/tools/x86_64/gcc-7.2.0-glibc-2.25-x86_64/.build/x86_64-corei7_avx-linux-gnu/buildtools
--with-mpfr=/home/ries/work/build/tools/x86_64/gcc-7.2.0-glibc-2.25-x86_64/.build/x86_64-corei7_avx-linux-gnu/buildtools
--with-mpc=/home/ries/work/build/tools/x86_64/gcc-7.2.0-glibc-2.25-x86_64/.build/x86_64-corei7_avx-linux-gnu/buildtools
--with-isl=/home/ries/work/build/tools/x86_64/gcc-7.2.0-glibc-2.25-x86_64/.build/x86_64-corei7_avx-linux-gnu/buildtools
--enable-lto --with-host-libstdcxx='-static-libgcc
-Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix
--enable-target-optspace --disable-plugin --disable-nls --disable-multilib
--with-local-prefix=/home/ries/work/build/tools/x86_64/gcc-7.2.0-glibc-2.25-x86_64/x86_64-corei7_avx-linux-gnu/x86_64-corei7_avx-linux-gnu/sysroot
--enable-long-long
Thread model: posix
gcc version 7.2.0 (crosstool-NG gc1aa3992abc-dirty)

[Bug c++/82159] [6 Regression] ICE: in assign_temp, at function.c:961

2017-10-10 Thread chr at terma dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82159

--- Comment #11 from chr at terma dot com ---
I've build the 7.2.0 with patch. The testcase compiles, but the original code
doesn't compile with the patched compiler. I'll try to run creduce with the
patched compiler.

[Bug c++/82159] [6 Regression] ICE: in assign_temp, at function.c:961

2017-10-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82159

Martin Liška  changed:

   What|Removed |Added

Summary|[6/7/8 Regression] ICE: in  |[6 Regression] ICE: in
   |assign_temp, at |assign_temp, at
   |function.c:961  |function.c:961

--- Comment #10 from Martin Liška  ---
(In reply to chr from comment #9)
> Created attachment 42333 [details]
> gcc 7.2.1 20170915 ICE testcase
> 
> Attached testcase.cpp as file.
> 
> g++ -O0 testcase.cpp

Works on GCC 7 branch after Jakub's backport. Do you plan Jakub to backport
also to GCC 6 branch?