Re: avoid integer overflow in mktime.m4

2006-12-22 Thread Paul Eggert
Here's the patch I installed to gnulib, to sync it from the mktime patch in Autoconf. 2006-12-22 Paul Eggert <[EMAIL PROTECTED]> * m4/mktime.m4 (AC_FUNC_MKTIME): Sync from Autoconf. Include , and use its INT_MAX to rewrite the j loop so that it does not overflow 'int'.

Re: avoid integer overflow in mktime.m4

2006-12-22 Thread Paul Eggert
I installed the following into Autoconf to fix the Autoconf side of the problem. 2006-12-22 Paul Eggert <[EMAIL PROTECTED]> * lib/autoconf/functions.m4 (AC_FUNC_MKTIME): Include , and use its INT_MAX to rewrite the j loop so that it does not overflow 'int'. Problem repo

Re: GCC optimizes integer overflow: bug or feature? (was: avoid integer overflow in mktime.m4)

2006-12-20 Thread Marcin Dalecki
On 2006-12-20, at 00:10, Richard B. Kreckel wrote: C89 did not refer to IEEE 754 / IEC 60559. Yet, as far as I am aware, -ffast-math or the implied optimizations have never been turned on by GCC unless explicitly requested. That was a wise decision. By the same token it would be wise to re

Re: GCC optimizes integer overflow: bug or feature? (was: avoid integer overflow in mktime.m4)

2006-12-19 Thread Richard B. Kreckel
On Mon, 18 Dec 2006, Andrew Pinski wrote: > On Tue, [EMAIL PROTECTED]:54 +0100, Ralf Wildenhues wrote: > > > Wheeeoo! That optimization is going to break a _lot_ of GNU > > > software. (Silently. Oh my.) > > Just like say strict aliasing? :) I find an analogy with -ffast-math much less far-fetc

Re: GCC optimizes integer overflow: bug or feature? (was: avoid integer overflow in mktime.m4)

2006-12-19 Thread Andrew Pinski
On Tue, 2006-12-19 at 06:54 +0100, Ralf Wildenhues wrote: > > Wheeeoo! That optimization is going to break a _lot_ of GNU > > software. (Silently. Oh my.) Just like say strict aliasing? :) > > We tried to do that sort of optimization in the 1990s (back when I > > was a GCC contributor), but r

GCC optimizes integer overflow: bug or feature? (was: avoid integer overflow in mktime.m4)

2006-12-18 Thread Ralf Wildenhues
[ Please see http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/8152 http://www.ginac.de/pipermail/cln-list/2006-December/000259.html ] Hello Paul, all, Let's forward your comments and questions to the GCC list, I wasn't aware of this topic being so disruptive: * Paul Eggert wrote on Tue, Dec

Re: avoid integer overflow in mktime.m4

2006-12-18 Thread Paul Eggert
Ralf Wildenhues <[EMAIL PROTECTED]> writes: > the newer GCC exploits at -O2 the fact that integer overflow > produces undefined behavior Wheeeoo! That optimization is going to break a _lot_ of GNU software. (Silently. Oh my.) This is a major change. Where is it documented and discussed? I d

avoid integer overflow in mktime.m4

2006-12-18 Thread Ralf Wildenhues
$ gcc-4.3 --version | gcc (GCC) 4.3.0 20061215 (experimental) $ gnulib-tool --with-tests --test [ interrupt at a convenient location ] $ .../configure CC=gcc-test [...] | checking for working mktime... This test hangs, because the newer GCC exploits at -O2 the fact that integer overflow produces u