From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20628 invoked by alias); 29 Sep 2002 05:56:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 20614 invoked by uid 71); 29 Sep 2002 05:56:00 -0000 Date: Sat, 28 Sep 2002 22:56:00 -0000 Message-ID: <20020929055600.20613.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: =?iso-8859-1?Q?Pop_S=E9bastian?= Subject: Re: c++/7807: g++ 3.2 Fails to compile legal code that compiled OK with g++ 3.1 Reply-To: =?iso-8859-1?Q?Pop_S=E9bastian?= X-SW-Source: 2002-09/txt/msg00811.txt.bz2 List-Id: The following reply was made to PR c++/7807; it has been noted by GNATS. From: =?iso-8859-1?Q?Pop_S=E9bastian?= To: nathan@gcc.gnu.org, anthony@anthonyw.cjb.net, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: aoliva@redhat.com Subject: Re: c++/7807: g++ 3.2 Fails to compile legal code that compiled OK with g++ 3.1 Date: Sun, 29 Sep 2002 07:50:28 +0200 On Fri, Sep 13, 2002 at 08:35:36PM -0000, nathan@gcc.gnu.org wrote: > Synopsis: g++ 3.2 Fails to compile legal code that compiled OK with g++ 3.1 > > State-Changed-From-To: open->analyzed > State-Changed-By: nathan > State-Changed-When: Fri Sep 13 13:35:35 2002 > State-Changed-Why: > confirmed as a regression > > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7807 The bug was introduced with the following patch: 2002-05-14 Alexandre Oliva Patch for C++ uninitialized pointer-to-member value http://gcc.gnu.org/ml/gcc-patches/2002-05/msg01167.html Here is a simplified version of the original bug-example on which I worked: class RM { class U; U* (U::* s2); }; class OP { int& f; RM pb; public: OP (int f_): f (f_) {} }; int i=9; OP a(i); The following patch is a workaround that solves bug-reports 7648 and 7807. Alexandre, could you analyze further this problem? Thanks, Sebastian Index: decl.c =================================================================== RCS file: /cvsroot/gcc/gcc/gcc/cp/decl.c,v retrieving revision 1.936 diff -d -u -p -r1.936 decl.c --- decl.c 21 Sep 2002 12:51:53 -0000 1.936 +++ decl.c 29 Sep 2002 05:45:34 -0000 @@ -7830,7 +7830,7 @@ check_initializer (decl, init) } else if (!DECL_EXTERNAL (decl) && !zero_init_p (type)) { - force_store_init_value (decl, build_forced_zero_init (type)); +// force_store_init_value (decl, build_forced_zero_init (type)); if (init) goto process_init; Index: typeck.c =================================================================== RCS file: /cvsroot/gcc/gcc/gcc/cp/typeck.c,v retrieving revision 1.429 diff -d -u -p -r1.429 typeck.c --- typeck.c 21 Sep 2002 12:51:56 -0000 1.429 +++ typeck.c 29 Sep 2002 05:45:35 -0000 @@ -5838,8 +5838,12 @@ convert_for_assignment (type, rhs, errty rhstype = TREE_TYPE (rhs); coder = TREE_CODE (rhstype); - if (rhs == error_mark_node || rhstype == error_mark_node) + if (rhs == error_mark_node) + return error_mark_node; + + if (rhstype == error_mark_node) return error_mark_node; + if (TREE_CODE (rhs) == TREE_LIST && TREE_VALUE (rhs) == error_mark_node) return error_mark_node;