[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-08-10 Thread buaabyl at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

buaabyl at gmail dot com changed:

   What|Removed |Added

 CC||buaabyl at gmail dot com

--- Comment #12 from buaabyl at gmail dot com ---
I compile Qt 5.7.0 with MinGW GCC, the Qt program segmentation fault, maybe the
same bug.

GCC: MinGW32-W64
Qt: 5.7.0

The bug just appear in static link, shared link is ok, and error with static +
Os.

this is my test summary:
++
| MinGW32-W64 | G++  |   Qt 5.5.0  |   Qt 5.7.0  |
|   GCC   | FLAGS|static|shared|static|shared|
+-+--+--+--+--+--+
|i686-4.9.1-release-posix-dwarf-rt_v3-rev2| -Os  | PASS | PASS | PASS | -|
| | -O2  | -| PASS | -| -|
+-+--+--+--+--+--+
|i686-5.3.0-release-posix-dwarf-rt_v4-rev0| -Os  | -| -| Fault| -|
| | -O2  | -| -| PASS | PASS |
+-+--+--+--+--+--+
|i686-5.4.0-release-posix-dwarf-rt_v5-rev0| -Os  | -| -| Fault| PASS |
| | -O2  | -| -| -| -|
+-+--+--+--+--+--+
|i686-6.1.0-release-posix-dwarf-rt_v5-rev0| -Os  | -| -| X| -|
| | -O2  | -| -| PASS | -|
+-+--+--+--+--+--+
|   X - Compile Fail |
|   Fault - Segmentation Fault   |
|   PASS  - Compile OK, Run Test Pass|
++

The compile fail of 6.1.0 show:
"... cxx_eval_call_expression, at cp/constexpr.c:1449"

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-07-21 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #11 from Jason Merrill  ---
Fixed.

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-07-21 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

--- Comment #10 from Jason Merrill  ---
Author: jason
Date: Thu Jul 21 06:16:17 2016
New Revision: 238574

URL: https://gcc.gnu.org/viewcvs?rev=238574=gcc=rev
Log:
PR c++/71092 - ICE with array and constexpr.

* constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph
threw away DECL_SAVED_TREE.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-array17.C
Modified:
branches/gcc-6-branch/gcc/cp/ChangeLog
branches/gcc-6-branch/gcc/cp/constexpr.c

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-07-18 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

Jason Merrill  changed:

   What|Removed |Added

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

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-07-15 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

--- Comment #9 from Jason Merrill  ---
Author: jason
Date: Fri Jul 15 18:49:38 2016
New Revision: 238395

URL: https://gcc.gnu.org/viewcvs?rev=238395=gcc=rev
Log:
PR c++/71092 - ICE with array and constexpr.

* constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph
threw away DECL_SAVED_TREE.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-array17.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/constexpr.c

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-07-08 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
   Priority|P3  |P2

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-06-20 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jeffbai at aosc dot xyz

--- Comment #8 from ktkachov at gcc dot gnu.org ---
*** Bug 71584 has been marked as a duplicate of this bug. ***

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-06-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.2

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-05-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #7 from Marek Polacek  ---
The original issue goes away with -fno-declone-ctor-dtor.

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-05-16 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #6 from Markus Trippelsdorf  ---
Both issues started with r232848.

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-05-16 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

--- Comment #5 from Markus Trippelsdorf  ---
(In reply to schoko.teddy from comment #3)
> Created attachment 38494 [details]
> Preprocessed source
> 
> This Error occurs while compiling this motioncontrollayer.cpp file from a Qt
> project. Gzipped because of largeness.

Looks like a ICE on invalid and is probably unrelated to the original issue:

markus@x4 tmp % cat motioncontrollayer.ii
namespace std {
template  struct A { static constexpr _Tp value = 0; };
typedef A false_type;
struct B : false_type {};
template  struct is_floating_point : B {};
template  struct enable_if { typedef int type; };
}
typedef int Value;
namespace detail {
template ::value,
 bool>::type = false>
constexpr Value toValue(T) {}
}
struct Quantity {
  template  constexpr Quantity(T) : value(detail::toValue(0)) {}
  Value value;
};
struct Pose {
  int x;
  int y;
  Quantity phi;
  constexpr Pose() : x(), y(), phi(0) {}
};
struct C {
  Pose pose;
};
struct D {
  Pose route[1];
};
void fn1() { C obj; }
void fn2() { D obj; }

markus@x4 tmp % clang++ -std=c++14 -ferror-limit=1 -c motioncontrollayer.ii
motioncontrollayer.ii:12:17: error: no return statement in constexpr function
constexpr Value toValue(T) {}
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 errors generated.

markus@x4 tmp % icpc -std=c++14 -c motioncontrollayer.ii
motioncontrollayer.ii(12): error: missing return statement at end of non-void
function "detail::toValue(T)"
  constexpr Value toValue(T) {}
  ^
  detected during instantiation of "Quantity::Quantity(T) [with T=int]"
at line 22

compilation aborted for motioncontrollayer.ii (code 2)

markus@x4 tmp % g++ -c motioncontrollayer.ii
motioncontrollayer.ii: In constructor ‘constexpr D::D()’:
motioncontrollayer.ii:27:8:   in constexpr expansion of ‘Pose()’
motioncontrollayer.ii:22:37:   in constexpr expansion of
‘((Pose*)this)->Pose::phi.Quantity::Quantity(0)’
motioncontrollayer.ii:15:70:   in constexpr expansion of ‘detail::toValue(0)’
motioncontrollayer.ii:27:8: internal compiler error: in
cxx_eval_call_expression, at cp/constexpr.c:1449

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-05-15 Thread schoko.teddy at web dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

--- Comment #4 from schoko.teddy at web dot de ---
(In reply to schoko.teddy from comment #3)
> Created attachment 38494 [details]
> Preprocessed source
> 
> This Error occurs while compiling this motioncontrollayer.cpp file from a Qt
> project. Gzipped because of largeness.

Oh, and the console output (I tried different -O values, all crashing):

g++ -c -pipe -O2 -march=x86-64 -mtune=generic -O2 -pipe
-fstack-protector-strong -flto -std=gnu++0x -Wall -W -D_REENTRANT -fPIC
-DQT_USE_QSTRINGBUILDER -DQT_STRICT_ITERATORS -DPACKAGE_VERSION=3.1.0
-DPACKAGE_NAME=turag-console -DSIM -DSIMULATION -DTURAG_DEBUG_ENABLE_BINARY
-DQWT_DLL -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_MULTIMEDIAWIDGETS_LIB
-DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB
-DQT_SERIALPORT_LIB -DQT_XML_LIB -DQT_CORE_LIB -I../Console -I.
-Itina-platform/public -I../Console -I../../../libs
-I../../../libs/libsimeurobot/plugin -I../../Debug-Server -I../../Debug-Server
-I../../../src/common -I../../../tina -I../../../tina/platform/desktop/public
-isystem /usr/include/qwt -isystem /usr/include/qt -isystem
/usr/include/qt/QtPrintSupport -isystem /usr/include/qt/QtMultimediaWidgets
-isystem /usr/include/qt/QtSvg -isystem /usr/include/qt/QtWidgets -isystem
/usr/include/qt/QtMultimedia -isystem /usr/include/qt/QtGui -isystem
/usr/include/qt/QtNetwork -isystem /usr/include/qt/QtSerialPort -isystem
/usr/include/qt/QtXml -isystem /usr/include/qt/QtCore -I.
-I/usr/lib/qt/mkspecs/linux-g++ -o motioncontrollayer.o
../../../libs/libsimeurobot/vis/motioncontrollayer.cpp

In file included from ../../../libs/libsimeurobot/vis/motioncontrollayer.h:7:0,
 from ../../../libs/libsimeurobot/vis/motioncontrollayer.cpp:1:
../../../libs/libsimeurobot/vis/debugobjects.h: In constructor
'TURAG::SimEurobot::Debug::DriveSplineV1::DriveSplineV1()':
../../../libs/libsimeurobot/vis/debugobjects.h:108:8:   in constexpr expansion
of 'TURAG::Pose()'
../../../tina/tina++/geometry/geometry.h:167:20:   in constexpr expansion of
'((TURAG::Pose*)this)->TURAG::Pose::x.TURAG::Units::Quantity::Quantity(0)'
../../../tina/tina++/geometry/units/unit.h:185:42:   in constexpr expansion of
'TURAG::Units::detail::toValue(val)'
../../../libs/libsimeurobot/vis/debugobjects.h:108:8: internal compiler error:
in cxx_eval_call_expression, at cp/constexpr.c:1449
 struct DriveSplineV1 {
^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
Makefile:3342: recipe for target 'motioncontrollayer.o' failed
make: *** [motioncontrollayer.o] Error 1


So here we have our ICE in cxx_eval_call_expression etc.

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-05-15 Thread schoko.teddy at web dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

schoko.teddy at web dot de changed:

   What|Removed |Added

 CC||schoko.teddy at web dot de

--- Comment #3 from schoko.teddy at web dot de ---
Created attachment 38494
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38494=edit
Preprocessed source

This Error occurs while compiling this motioncontrollayer.cpp file from a Qt
project. Gzipped because of largeness.

[Bug c++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os

2016-05-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71092

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-05-13
 CC||trippels at gcc dot gnu.org
Summary|internal compiler error: in |[6/7 Regression] ICE: in
   |cxx_eval_call_expression,   |cxx_eval_call_expression,
   |at cp/constexpr.c:1449; |at cp/constexpr.c:1449;
   |only with -Os   |only with -Os
 Ever confirmed|0   |1

--- Comment #2 from Markus Trippelsdorf  ---
markus@x4 tmp % cat prep.cpp
template  struct A { using type = _Default; };
template  typename>
using __detected_or = A<_Default>;
template  class _Op>
using __detected_or_t = typename __detected_or<_Default, _Op>::type;
template  struct B { typedef _Tp value_type; };
struct C {
  template  using __pointer = typename _Tp::pointer;
};
template  struct J : C {
  using pointer = __detected_or_t;
};
template  void _Construct(_T1 *) { new _T1; }
struct D {
  template 
  static _ForwardIterator __uninit_default_n(_ForwardIterator p1, _Size) {
_Construct(p1);
  }
};
template 
void __uninitialized_default_n(_ForwardIterator p1, _Size) {
  D::__uninit_default_n(p1, 0);
}
template 
void __uninitialized_default_n_a(_ForwardIterator p1, _Size, _Tp) {
  __uninitialized_default_n(p1, 0);
}
template  struct __shared_ptr {
  constexpr __shared_ptr() : _M_ptr(), _M_refcount() {}
  int _M_ptr;
  int _M_refcount;
};
template  struct F {
  typedef _Alloc _Tp_alloc_type;
  struct G {
typename J<_Tp_alloc_type>::pointer _M_start;
G(_Tp_alloc_type);
  };
  F(int, _Alloc p2) : _M_impl(p2) {}
  G _M_impl;
};
template > struct K : F<_Alloc> {
  typedef _Alloc allocator_type;
  K(int, allocator_type p2 = allocator_type()) : F<_Alloc>(0, p2) {
__uninitialized_default_n_a(this->_M_impl._M_start, 0, 0);
  }
};
struct H {
  H();
  struct I {
__shared_ptr trigger[1];
  };
  __shared_ptr resetTrigger_;
  K states_;
  __shared_ptr triggerManager_;
};
__shared_ptr a;
H::H() : states_(0), triggerManager_(a) {}

markus@x4 tmp % g++ -c prep.cpp -Os
prep.cpp: In constructor ‘constexpr H::I::I()’:
prep.cpp:50:10:   in constexpr expansion of ‘__shared_ptr()’
prep.cpp:50:10: internal compiler error: in cxx_eval_call_expression, at
cp/constexpr.c:1449
   struct I {
  ^
0x863b2d cxx_eval_call_expression
../../gcc/gcc/cp/constexpr.c:1449
0x864863 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:3557
0x86a51b cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4135
0x86d371 maybe_constant_init(tree_node*, tree_node*)
../../gcc/gcc/cp/constexpr.c:4453
0x7b1664 build_vec_init(tree_node*, tree_node*, tree_node*, bool, int, int)
../../gcc/gcc/cp/init.c:4177
0x84872d cp_gimplify_expr(tree_node**, gimple**, gimple**)
../../gcc/gcc/cp/cp-gimplify.c:592
0xaf51b2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:10210
0xafa7b6 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:5699
0xaf72b6 gimplify_cleanup_point_expr
../../gcc/gcc/gimplify.c:5475
0xaf72b6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:10666
0xafa7b6 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:5699
0xafca85 gimplify_bind_expr
../../gcc/gcc/gimplify.c:1154
0xaf71d8 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:10500
0xafa7b6 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:5699
0xafd6b9 gimplify_body(tree_node*, bool)
../../gcc/gcc/gimplify.c:11480
0xafdd46 gimplify_function_tree(tree_node*)
../../gcc/gcc/gimplify.c:11636
0x978a97 cgraph_node::analyze()
../../gcc/gcc/cgraphunit.c:625
0x97be23 analyze_functions
../../gcc/gcc/cgraphunit.c:1086
0x97cb08 symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2543