public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51313] New: [C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556
@ 2011-11-26 15:16 y121516 at gmail dot com
  2011-12-02 16:28 ` [Bug c++/51313] [4.7 Regression][C++0x] " paolo.carlini at oracle dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: y121516 at gmail dot com @ 2011-11-26 15:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51313

             Bug #: 51313
           Summary: [C++0x] ICE: tree check: expected class 'constant',
                    have 'unary' (nop_expr) in null_ptr_cst_p, at
                    cp/call.c:556
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: y121516@gmail.com


The ICE occurred with -std=c++0x option.
If not use -std=c++0x option then the ICE not occurred


Codes (a.cpp):

#include<iostream>
#include<cctype>

int main()
{
  std::cout << isdigit(0);
}


Compiler errors:

$ g++4.7 -std=c++0x a.cpp
a.cpp: In function 'int main()':
a.cpp:6:25: internal compiler error: tree check: expected class 'constant',
have 'unary' (nop_expr) in null_ptr_cst_p
, at cp/call.c:556
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Version info:

$ g++4.7 -v
Built by Equation Solution <http://www.Equation.com>.
Using built-in specs.
COLLECT_GCC=C:\cygwin\home\RiSK\misc\gcc4.7\bin\g++.exe
COLLECT_LTO_WRAPPER=c:/cygwin/home/risk/misc/gcc4.7/bin/../libexec/gcc/i686-pc-mingw32/4.7.0/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ../gcc-4.7-20111119-mingw/configure --host=i686-pc-mingw32
--build=x86_64-unknown-linux-gnu --target
=i686-pc-mingw32
--prefix=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/gcc/4.7-20111119
--with-gcc --with-gnu
-as --with-gnu-ld --with-host-libstdcxx='-lstdc++ -lsupc++ -lm'
--with-ppl=/home/gfortran/gcc-home/binary/mingw32/nat
ive/x86_32/ppl
--with-cloog=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/cloog
--with-gmp=/home/gfortran/gcc-
home/binary/mingw32/native/x86_32/gmp
--with-mpfr=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/mpfr --with-mp
c=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/mpc
--with-sysroot=/home/gfortran/gcc-home/binary/mingw32/cros
s/x86_32/gcc/4.7-20111119 --disable-shared --disable-nls --disable-tls
--disable-win32-registry --enable-libquadmath-
support --enable-libquadmath --enable-languages=c,c++,fortran --enable-libgomp
--enable-threads=win32 --enable-lto --
enable-static --enable-shared=lto-plugin --enable-plugins --enable-ld=yes
--enable-cloog-backend=ppl
Thread model: win32
gcc version 4.7.0 20111119 (experimental) (GCC)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/51313] [4.7 Regression][C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556
  2011-11-26 15:16 [Bug c++/51313] New: [C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556 y121516 at gmail dot com
@ 2011-12-02 16:28 ` paolo.carlini at oracle dot com
  2011-12-02 17:23 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-02 16:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51313

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-12-02
            Summary|[C++0x] ICE: tree check:    |[4.7 Regression][C++0x]
                   |expected class 'constant',  |ICE: tree check: expected
                   |have 'unary' (nop_expr) in  |class 'constant', have
                   |null_ptr_cst_p, at          |'unary' (nop_expr) in
                   |cp/call.c:556               |null_ptr_cst_p, at
                   |                            |cp/call.c:556
     Ever Confirmed|0                           |1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/51313] [4.7 Regression][C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556
  2011-11-26 15:16 [Bug c++/51313] New: [C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556 y121516 at gmail dot com
  2011-12-02 16:28 ` [Bug c++/51313] [4.7 Regression][C++0x] " paolo.carlini at oracle dot com
@ 2011-12-02 17:23 ` paolo.carlini at oracle dot com
  2011-12-02 18:12 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-02 17:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51313

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-12-02 17:23:24 UTC ---
This badly requires a reduced testcase, I'm going to prepare one. Then the fix
should be pretty simple: just use STRIP_NOPs unconditionally, ie cxx0x too, in
null_ptr_cst_p?! Anything wrong with that?

The point is that integer_zerop strips the NOPs before doing its work, but then
TREE_OVERFLOW cannot handle a NOP_EXPR. I don't think we want TREE_OVERFLOW_P
and return false when integer_zerop returns true and no overflow is occurring!


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/51313] [4.7 Regression][C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556
  2011-11-26 15:16 [Bug c++/51313] New: [C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556 y121516 at gmail dot com
  2011-12-02 16:28 ` [Bug c++/51313] [4.7 Regression][C++0x] " paolo.carlini at oracle dot com
  2011-12-02 17:23 ` paolo.carlini at oracle dot com
@ 2011-12-02 18:12 ` paolo.carlini at oracle dot com
  2011-12-04  1:41 ` paolo at gcc dot gnu.org
  2011-12-04  1:42 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-02 18:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51313

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.0

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-12-02 18:11:26 UTC ---
This is enough:

class ostream;

extern "C" {
  extern int isdigit (int);
}

ostream&
operator<<(ostream&, const unsigned char*);

extern ostream cout;

int main()
{
  cout << isdigit(0);
}


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/51313] [4.7 Regression][C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556
  2011-11-26 15:16 [Bug c++/51313] New: [C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556 y121516 at gmail dot com
                   ` (2 preceding siblings ...)
  2011-12-02 18:12 ` paolo.carlini at oracle dot com
@ 2011-12-04  1:41 ` paolo at gcc dot gnu.org
  2011-12-04  1:42 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu.org @ 2011-12-04  1:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51313

--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2011-12-04 01:40:40 UTC ---
Author: paolo
Date: Sun Dec  4 01:40:36 2011
New Revision: 181980

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181980
Log:
/cp
2011-12-03  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/51313
    * call.c (null_ptr_cst_p): STRIP_NOPS in c++11 mode too.

/testsuite
2011-12-03  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/51313
    * g++.dg/cpp0x/pr51313.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr51313.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/51313] [4.7 Regression][C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556
  2011-11-26 15:16 [Bug c++/51313] New: [C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556 y121516 at gmail dot com
                   ` (3 preceding siblings ...)
  2011-12-04  1:41 ` paolo at gcc dot gnu.org
@ 2011-12-04  1:42 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-04  1:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51313

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-12-04 01:42:04 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-12-04  1:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-26 15:16 [Bug c++/51313] New: [C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556 y121516 at gmail dot com
2011-12-02 16:28 ` [Bug c++/51313] [4.7 Regression][C++0x] " paolo.carlini at oracle dot com
2011-12-02 17:23 ` paolo.carlini at oracle dot com
2011-12-02 18:12 ` paolo.carlini at oracle dot com
2011-12-04  1:41 ` paolo at gcc dot gnu.org
2011-12-04  1:42 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).