From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8565 invoked by alias); 21 May 2011 17:32:02 -0000 Received: (qmail 8554 invoked by uid 22791); 21 May 2011 17:32:01 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-qy0-f175.google.com (HELO mail-qy0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 21 May 2011 17:31:47 +0000 Received: by qyk35 with SMTP id 35so212937qyk.20 for ; Sat, 21 May 2011 10:31:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.126.195 with SMTP id d3mr581786qcs.61.1305999105569; Sat, 21 May 2011 10:31:45 -0700 (PDT) Received: by 10.229.239.132 with HTTP; Sat, 21 May 2011 10:31:45 -0700 (PDT) In-Reply-To: <4DC824D2.2060203@redhat.com> References: <4DC824D2.2060203@redhat.com> Date: Sat, 21 May 2011 22:07:00 -0000 Message-ID: Subject: Re: C++ PATCH for c++/34772 (warning about self-initialization without -Winit-self) From: "H.J. Lu" To: Jason Merrill Cc: gcc-patches List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01538.txt.bz2 On Mon, May 9, 2011 at 10:30 AM, Jason Merrill wrote: > In this testcase -Wuninitialized was warning about 'int i =3D i' without > -Winit-self because the C++ front end always uses separate code for > non-constant initialization. =A0But for simple initialization, it makes s= ense > to use DECL_INITIAL. > > Tested x86_64-pc-linux-gnu, applying to trunk. > > commit b105bfbee01e9183e7fc100f3a33c7c109db7fae > Author: Jason Merrill > Date: =A0 Sat May 7 17:31:09 2011 -0400 > > =A0 =A0 =A0 =A0PR c++/34772 > =A0 =A0 =A0 =A0* decl.c (initialize_local_var): Use DECL_INITIAL for simp= le > =A0 =A0 =A0 =A0initialization. > This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49092 --=20 H.J.