public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/24172]  New: error: incorrect sharing of tree nodes
@ 2005-10-03  1:06 kev dot gilbert at cdu dot edu dot au
  2005-10-03  1:10 ` [Bug tree-optimization/24172] [4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: kev dot gilbert at cdu dot edu dot au @ 2005-10-03  1:06 UTC (permalink / raw)
  To: gcc-bugs

Compile of KOffice with gcc4.1 failed.  Source condensed to a test case which
produces the following error:

---------------
test-case-1.cpp: In function ‘void prepare_inpaint()’:
test-case-1.cpp:55: error: incorrect sharing of tree nodes
D.1986_15 = "rb"[0];

"rb"[0];

test-case-1.cpp:55: internal compiler error: verify_stmts failed
---------------

gcc version info:

---------------
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ./configure
Thread model: posix
gcc version 4.1.0 20050927 (experimental)
---------------

Compile command:

---------------
g++ -O2 -c test-case-1.cpp
---------------

The compile fails with O1, O2 and O3 but works with O0. Source code of test
case (note: I could not reduce it any further) :

---------------
namespace cimg_library
{       template<typename T = float> struct CImg;
        template<typename T = float> struct CImgl;

        struct Exception
        {
        };

        struct IOException : Exception
        {       IOException( const char * )
                {
                }
        };

        namespace cimg
        {       inline int* dummy( const char* const path, const char* const
mode )
                {       throw IOException( mode[ 0 ] == 'r' ? "a" : (mode[ 0 ]
== 'w' ? "b" : "" ));
                        return 0;
                }

        }

        template<typename T> struct CImg
        {       T *data;

                explicit CImg( const unsigned int dx = 0 )
                {
                }

                CImg( const char *filename )
                {       CImgl<T>( filename ).get_append( 'v', 'p' );
                }
        };

        template<typename T> struct CImgl
        {       CImgl( const unsigned int )
                {
                }

                CImgl(const char* filename)
                {       cimg::dummy( filename, "rb" );
                        unsigned int n;
                        CImgl<T> res( n );
                }

                CImg<T> get_append( const char, const char ) const
                {       CImg<T> res;
                        return res;
                }
        };
}

using namespace cimg_library;

void prepare_inpaint( )
{       cimg_library::CImg<unsigned char> mask = CImg<unsigned char>( "" );
}
---------------


-- 
           Summary: error: incorrect sharing of tree nodes
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kev dot gilbert at cdu dot edu dot au
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2005-10-30 21:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-03  1:06 [Bug c++/24172] New: error: incorrect sharing of tree nodes kev dot gilbert at cdu dot edu dot au
2005-10-03  1:10 ` [Bug tree-optimization/24172] [4.1 Regression] " pinskia at gcc dot gnu dot org
2005-10-03  1:13 ` pinskia at gcc dot gnu dot org
2005-10-03  1:26 ` pinskia at gcc dot gnu dot org
2005-10-03 16:54 ` pinskia at gcc dot gnu dot org
2005-10-03 22:00 ` janis187 at us dot ibm dot com
2005-10-04 10:44 ` rguenth at gcc dot gnu dot org
2005-10-04 11:00 ` rguenth at gcc dot gnu dot org
2005-10-04 12:53 ` pinskia at gcc dot gnu dot org
2005-10-04 12:56 ` hubicka at ucw dot cz
2005-10-04 13:42 ` rguenth at gcc dot gnu dot org
2005-10-07  9:05 ` rguenth at gcc dot gnu dot org
2005-10-13 15:56 ` pinskia at gcc dot gnu dot org
2005-10-21 11:07 ` steven at gcc dot gnu dot org
2005-10-21 12:19 ` rguenth at gcc dot gnu dot org
2005-10-27 21:18 ` hubicka at gcc dot gnu dot org
2005-10-30 18:18 ` hubicka at gcc dot gnu dot org
2005-10-30 21:59 ` hubicka at gcc dot gnu dot org

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).