From patchwork Sun Feb 5 11:21:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 139625 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 73D71B7216 for ; Sun, 5 Feb 2012 22:23:23 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1329045804; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=UrPniXt p5yM+U2s/ypQkXLx4OvU=; b=L12L1xGEP443s8sEymvSeI83sIvLjjA2YPzCFNX BsbiD2y1VuJaEbG+NOmdgYTXt9NQ2sItA5i4+JrZW/cwzb/tvcXj+p+E8d6mCPpd aE207y5FFwHwqWSMDrpWgAz/L9IaiIQQvcpfAoVVXVaTvXQg0nXfjJFTdy5AQgeR OfN0= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=dA1mGCO//SYfP7KE8qdPhSgH5NckqDtDt+Sa/eN/jKhIToutCJPCw1A6IUUE0y YTPoPjjwzbYhkQ6dJSMhqymEZI/pkFcM9H7EYV8dlwEsLcB+Y5ri/JoxnApz3WYd NujxXBKFxtHKbEhAtqN061+mX+0MMox6RBSHkg8zP+OwY=; Received: (qmail 7948 invoked by alias); 5 Feb 2012 11:23:15 -0000 Received: (qmail 7925 invoked by uid 22791); 5 Feb 2012 11:23:14 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, TW_CX X-Spam-Check-By: sourceware.org Received: from vsmtp3.tin.it (HELO vsmtp3.tin.it) (212.216.176.223) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 05 Feb 2012 11:23:01 +0000 Received: from [192.168.1.4] (79.32.231.66) by vsmtp3.tin.it (8.6.023.02) id 4ECA50980446A438; Sun, 5 Feb 2012 12:22:59 +0100 Message-ID: <4F2E662E.7080303@oracle.com> Date: Sun, 05 Feb 2012 12:21:18 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ Subject: [v3] libstdc++/52119 X-IsSubscribed: yes 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 Hi, the library bits seem straightforward enough to go in now. Of course the substantive issue seems C++ front end diagnostics, post 4.7.0 material. Sanity checked x86_64-linux. Thanks, Paolo. /////////////////// 2012-02-05 Jeffrey Yasskin Paolo Carlini PR libstdc++/52119 * include/std/limits (__glibcxx_min): Fix to aboid undefined behavior. Index: include/std/limits =================================================================== --- include/std/limits (revision 183904) +++ include/std/limits (working copy) @@ -1,7 +1,7 @@ // The template and inlines for the numeric_limits classes. -*- C++ -*- // Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, -// 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -129,7 +129,7 @@ #define __glibcxx_signed(T) ((T)(-1) < 0) #define __glibcxx_min(T) \ - (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0) + (__glibcxx_signed (T) ? -__glibcxx_max (T) - 1 : (T)0) #define __glibcxx_max(T) \ (__glibcxx_signed (T) ? \