From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27325 invoked by alias); 29 Aug 2014 20:08:17 -0000 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 Received: (qmail 27308 invoked by uid 89); 29 Aug 2014 20:08:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 29 Aug 2014 20:08:06 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7TK859B005418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 29 Aug 2014 16:08:05 -0400 Received: from stumpy.slc.redhat.com (ovpn-113-40.phx2.redhat.com [10.3.113.40]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7TK84FR000878; Fri, 29 Aug 2014 16:08:04 -0400 Message-ID: <5400DDA4.2060505@redhat.com> Date: Fri, 29 Aug 2014 20:08:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Marek Polacek , GCC Patches Subject: Re: [PATCH] Fix UB in expmed.c (PR middle-end/61903) References: <20140825192135.GL15033@redhat.com> In-Reply-To: <20140825192135.GL15033@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg02660.txt.bz2 On 08/25/14 13:21, Marek Polacek wrote: > The following ought to fix two spots where an undefined behavior > can occur when compiling pr28045.c with instrumented compiler. > It does so by changing the type of V to an unsigned HOST_WIDE_INT > and performing the shift on unsigned HOST_WIDE_INT. > Hopefully it doesn't break anything... > > Bootstrapped/regtested on x86_64-linux, ok for trunk? > > 2014-08-25 Marek Polacek > > PR middle-end/61903 > * expmed.c (store_fixed_bit_field_1): Shift UHWI 1 instead of HWI 1. > Change the type of V to unsigned HOST_WIDE_INT. OK. Jeff