Return-Path: X-Original-To: apmail-stdcxx-dev-archive@www.apache.org Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6EBD3D636 for ; Wed, 5 Sep 2012 18:04:44 +0000 (UTC) Received: (qmail 79412 invoked by uid 500); 5 Sep 2012 18:04:44 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 79375 invoked by uid 500); 5 Sep 2012 18:04:44 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 79362 invoked by uid 99); 5 Sep 2012 18:04:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 18:04:44 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [64.34.174.152] (HELO hates.ms) (64.34.174.152) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 18:04:36 +0000 Received: from [192.168.72.105] (unknown [166.57.38.196]) by hates.ms (Postfix) with ESMTPSA id 984A145C180 for ; Wed, 5 Sep 2012 18:04:15 +0000 (UTC) Message-ID: <50479467.6050903@hates.ms> Date: Wed, 05 Sep 2012 14:05:27 -0400 From: Liviu Nicoara User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: dev@stdcxx.apache.org Subject: Re: Intel C++ bug reports? References: <5046AA04.7070508@gmail.com> In-Reply-To: <5046AA04.7070508@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 09/04/12 21:25, Martin Sebor wrote: > On 09/04/2012 07:02 PM, Liviu Nicoara wrote: >> >> While configuring the library on my x86_64 machine, I ran into what appears to be a code generation compiler bug which affects LIMITS.cpp test -- the test cycles ad infinitum because of the incorrect test marked below: > > Looking at the test below, though, it depends on undefined behavior > (signed overflow) so there's no compiler bug. Making max volatile > fools icc just enough to produce the expected output (while still > relying on undefined behavior). It would be good to clean it up, > though. I think computing UINT_MAX instead and shifting it right > by the number of sign bits (i.e., 1) should work. FWIW, I like the current implementation more. It seems to me that, by using a bitwise logical shift of the corresponding unsigned integer, followed by a conversion to the signed integer, we'd make an assumption about the representation of signed integers. But a shifting implementation should be relatively easy to add. Liviu