[Bug c++/61361] New: gcc segfaults on SLES12 beta4 P8

2014-05-29 Thread wangn at ca dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61361

Bug ID: 61361
   Summary: gcc segfaults on SLES12 beta4 P8
   Product: gcc
   Version: 4.8.2
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wangn at ca dot ibm.com

gcc segfaults on sles12 p8 machine. 

1. gcc version:
g++ (SUSE Linux) 4.8.2 20140324 [gcc-4_8-branch revision 208789]
Copyright (C) 2013 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.

2. source code:

t.cpp:

class A {
static int aval;
public:
int get_val();
};

class B : public A {
static int bval;
public:
int get_val();
int bf();
};


int B::bval=5;
int B::get_val() {return bval;};
int B::bf() {return 3;};

int funcB() {
B b;
return b.get_val();
}

3. command:

gcc -m64 -c t.cpp

4. output:

g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.

5. expected output:

compile pass


note: pass on the following machine:

Linux cit318 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:09:21 UTC 2014
ppc64le ppc64le ppc64le GNU/Linux


[Bug c++/61361] gcc segfaults on SLES12 beta4 P8

2014-06-02 Thread wangn at ca dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61361

--- Comment #2 from Nancy Wang  ---
(In reply to Richard Biener from comment #1)
> Works with Beta3, gcc (SUSE Linux) 4.8.2 20140516 [gcc-4_8-branch revision
> 210491].  Also works with a cross compiler from x86_64.  Also works with
> Beta8, GNU C++ (SUSE Linux) version 4.8.3 20140523 [gcc-4_8-branch revision
> 210846] (powerpc64le-suse-linux)
> 
> So - I can't reproduce this.

The problem was gone after upgrade to beta 7 sles12, I think sles12 beta 4 was
unstable. thanks


[Bug c++/62256] New: /usr/include/c++/4.8/tr1/random.tcc:792:2: error: no matching function for call to 'min'

2014-08-25 Thread wangn at ca dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62256

Bug ID: 62256
   Summary: /usr/include/c++/4.8/tr1/random.tcc:792:2: error: no
matching function for call to 'min'
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wangn at ca dot ibm.com

use g++ to compile perennial test case TR19768/P95252.scenario fails. seems
related to header file.

source code:
$ cat t.cpp
#include 

typedef std::tr1::xor_combine< std::tr1::subtract_with_carry, 8, std::tr1::subtract_with_carry, 2 > type01;

/**/
int main(void)
{
type01 cl01;
return 0;
}


how to reproduce:

g++ -c t.cpp

actual output:

In file included from /usr/include/c++/4.8/tr1/random:48:0,
 from t.cpp:1:
/usr/include/c++/4.8/tr1/random.tcc: In instantiation of âvoid
std::tr1::xor_combine<_UniformRandomNumberGenerator1, __s1,
_UniformRandomNumberGenerator2, __s2>::_M_initialize_max() [with
_UniformRandomNumberGenerator1 = std::tr1::subtract_with_carry; int __s1 = 8; _UniformRandomNumberGenerator2 =
std::tr1::subtract_with_carry; int __s2 = 2]â:
/usr/include/c++/4.8/tr1/random.h:1324:27:   required from
âstd::tr1::xor_combine<_UniformRandomNumberGenerator1, __s1,
_UniformRandomNumberGenerator2, __s2>::xor_combine() [with
_UniformRandomNumberGenerator1 = std::tr1::subtract_with_carry; int __s1 = 8; _UniformRandomNumberGenerator2 =
std::tr1::subtract_with_carry; int __s2 = 2]â
t.cpp:8:12:   required from here
/usr/include/c++/4.8/tr1/random.tcc:793:58: error: no matching function for
call to âmin(std::tr1::xor_combine, 8, std::tr1::subtract_with_carry,
2>::result_type, int)â
__detail::_Shift::__value - 1);
  ^
/usr/include/c++/4.8/tr1/random.tcc:793:58: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
 from /usr/include/c++/4.8/string:40,
 from /usr/include/c++/4.8/tr1/random:38,
 from t.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template const
_Tp& std::min(const _Tp&, const _Tp&)
 min(const _Tp& __a, const _Tp& __b)
 ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument
deduction/substitution failed:
In file included from /usr/include/c++/4.8/tr1/random:48:0,
 from t.cpp:1:
/usr/include/c++/4.8/tr1/random.tcc:793:58: note:   deduced conflicting types
for parameter âconst _Tpâ (âshort intâ and âintâ)
__detail::_Shift::__value - 1);
  ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
 from /usr/include/c++/4.8/string:40,
 from /usr/include/c++/4.8/tr1/random:38,
 from t.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
 min(const _Tp& __a, const _Tp& __b, _Compare __comp)
 ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument
deduction/substitution failed:
In file included from /usr/include/c++/4.8/tr1/random:48:0,
 from t.cpp:1:
/usr/include/c++/4.8/tr1/random.tcc:793:58: note:   deduced conflicting types
for parameter âconst _Tpâ (âshort intâ and âintâ)
__detail::_Shift::__value - 1);
  ^
/usr/include/c++/4.8/tr1/random.tcc:797:58: error: no matching function for
call to âmin(std::tr1::xor_combine, 8, std::tr1::subtract_with_carry,
2>::result_type, int)â
__detail::_Shift::__value - 1);
  ^
/usr/include/c++/4.8/tr1/random.tcc:797:58: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
 from /usr/include/c++/4.8/string:40,
 from /usr/include/c++/4.8/tr1/random:38,
 from t.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template const
_Tp& std::min(const _Tp&, const _Tp&)
 min(const _Tp& __a, const _Tp& __b)
 ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument
deduction/substitution failed:
In file included from /usr/include/c++/4.8/tr1/random:48:0,
 from t.cpp:1:
/usr/include/c++/4.8/tr1/random.tcc:797:58: note:   deduced conflicting types
for parameter âconst _Tpâ (âshort intâ and âintâ)
__detail::_Shift::__value - 1);
  ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
 from /usr/include/c++/4.8/string:40,
 from /usr/include/c++/4.8/tr1/

[Bug c++/62257] New: issue with tr1/functional header

2014-08-25 Thread wangn at ca dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62257

Bug ID: 62257
   Summary: issue with tr1/functional header
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wangn at ca dot ibm.com

some of perennial test cases failed because problem on tr1/functional header
file. 

source file:
$ cat t.cpp
#include 
struct T { typedef int result_type; };

std::tr1::result_of::type a;

how to reproduce:

g++ -c t.cpp

actual output:

t.cpp:4:1: error: âtypeâ in âclass std::tr1::result_ofâ does not name a type
 std::tr1::result_of::type a;
 ^
expected output:

compile clean

[Bug c++/62257] issue with tr1/functional header

2014-08-25 Thread wangn at ca dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62257

Nancy Wang  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Nancy Wang  ---
seems result_of must be function type.