From patchwork Fri Jun 11 19:40:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 55353 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id E852CB7D4A for ; Sat, 12 Jun 2010 05:41:21 +1000 (EST) Received: (qmail 26921 invoked by alias); 11 Jun 2010 19:41:20 -0000 Received: (qmail 26912 invoked by uid 22791); 11 Jun 2010 19:41:19 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Jun 2010 19:41:14 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5BJewYD008537 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Jun 2010 15:40:58 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5BJeuur008341 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Jun 2010 15:40:58 -0400 Received: from livre.localdomain (livre.oliva.athome.lsd.ic.unicamp.br [172.31.160.2]) by localhost.localdomain (8.14.3/8.14.3) with ESMTP id o5BJernr030817; Fri, 11 Jun 2010 16:40:54 -0300 Received: from livre.localdomain (aoliva@localhost [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o5BJeqAQ015336; Fri, 11 Jun 2010 16:40:52 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id o5BJep5t015335; Fri, 11 Jun 2010 16:40:51 -0300 From: Alexandre Oliva To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org Subject: Re: Fix uninitialized error with BUILD_CONFIG=bootstrap-O1 References: <201006111849.41226.ebotcazou@adacore.com> Date: Fri, 11 Jun 2010 16:40:50 -0300 In-Reply-To: <201006111849.41226.ebotcazou@adacore.com> (Eric Botcazou's message of "Fri, 11 Jun 2010 18:49:41 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Jun 11, 2010, Eric Botcazou wrote: >> I suppose -O2 infers that new_ptr can't be NULL because it's >> dereferenced before, so last will always be set before we exit the loop, >> but at -O1 it doesn't. >> >> This patch avoids the warning, but perhaps the loop should be turned >> into a do/while loop to avoid the unnecessary test. > The most correct version is 'last = NULL_TREE' but then the line overflows. > So I'd initialize 'last' to NULL_TREE in its declaration; OK with this change. Thanks, I'm checking this in. for gcc/ada/ChangeLog from Alexandre Oliva * gcc-interface/utils.c (update_pointer_to): Initialize last. Index: gcc/ada/gcc-interface/utils.c =================================================================== --- gcc/ada/gcc-interface/utils.c.orig 2010-06-11 10:56:19.000000000 -0300 +++ gcc/ada/gcc-interface/utils.c 2010-06-11 16:26:06.000000000 -0300 @@ -3461,7 +3461,7 @@ update_pointer_to (tree old_type, tree n { tree new_ptr = TYPE_MAIN_VARIANT (TYPE_POINTER_TO (new_type)); tree new_obj_rec = TYPE_OBJECT_RECORD_TYPE (new_type); - tree array_field, bounds_field, new_ref, last; + tree array_field, bounds_field, new_ref, last = NULL_TREE; gcc_assert (TYPE_IS_FAT_POINTER_P (ptr));