Re: GCC optimizes integer overflow: bug or feature?

2006-12-22 Thread Paolo Bonzini
int j; for (j = 1; 0 j; j *= 2) if (! bigtime_test (j)) return 1; Here it is obvious to a programmer that the comparison is intended to do overflow checking, even though the test controls the loop. Well, it's not to me. :-) Another question for the GCC

Re: GCC optimizes integer overflow: bug or feature?

2006-12-22 Thread Paolo Bonzini
Or you can do, since elsewhere in the code you compute time_t_max: for (j = 1; j = time_t_max / 2 + 1; j *= 2) No, this does not work. It would work to have: for (j = 1;;) { if (j time_t_max / 2) break; j *= 2; } Oops. Paolo

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 limits.h, and use its INT_MAX to rewrite the j loop so that it does not overflow 'int'.

Re: [PATCH]: multiple problem with the poll module

2006-12-22 Thread Paolo Bonzini
I don't remember if it was Paul or Bruno who suggested that POLLHUP does not increase the return value. What do you think? Attached is an improved version that should conform more to GnuLib coding standard. Hi Yoann, unfortunately the patch is wrong, as it never sets POLLHUP on Mac OS X

Re: [PATCH]: multiple problem with the poll module

2006-12-22 Thread Yoann Vandoorselaere
Le vendredi 22 décembre 2006 à 10:48 +0100, Paolo Bonzini a écrit : I don't remember if it was Paul or Bruno who suggested that POLLHUP does not increase the return value. What do you think? Attached is an improved version that should conform more to GnuLib coding standard. Hi

Re: [PATCH]: multiple problem with the poll module

2006-12-22 Thread Paolo Bonzini
and it does not work, e.g., on file descriptors. Sorry. :-) Could you please provide more information about the problem? (Note that the current CVS version doesn't work on socket, which is not much better). Providing your test case would help. Just open a file, and poll it. It should

Re: [PATCH]: multiple problem with the poll module

2006-12-22 Thread Yoann Vandoorselaere
Le vendredi 22 décembre 2006 à 11:31 +0100, Paolo Bonzini a écrit : and it does not work, e.g., on file descriptors. Sorry. :-) Could you please provide more information about the problem? (Note that the current CVS version doesn't work on socket, which is not much better). Providing

Re: [PATCH]: multiple problem with the poll module

2006-12-22 Thread Yoann Vandoorselaere
Le vendredi 22 décembre 2006 à 11:55 +0100, Yoann Vandoorselaere a écrit : Le vendredi 22 décembre 2006 à 11:31 +0100, Paolo Bonzini a écrit : and it does not work, e.g., on file descriptors. Sorry. :-) Could you please provide more information about the problem? (Note that the

Re: [PATCH]: multiple problem with the poll module

2006-12-22 Thread Yoann Vandoorselaere
Le vendredi 22 décembre 2006 à 12:41 +0100, Yoann Vandoorselaere a écrit : Le vendredi 22 décembre 2006 à 11:55 +0100, Yoann Vandoorselaere a écrit : Le vendredi 22 décembre 2006 à 11:31 +0100, Paolo Bonzini a écrit : and it does not work, e.g., on file descriptors. Sorry. :-)

Re: new module no-c++

2006-12-22 Thread Bruno Haible
I added this module now. === modules/no-c++ === Description: Support for compiling in C mode when CC is set to a C++ compiler. Files: m4/no-c++.m4 Depends-on: configure.ac: gt_NO_CXX Makefile.am: Include: License:

gnulib-tool: use portable sed commands

2006-12-22 Thread Bruno Haible
Hi, GNU sed version 4.1b is now implementing its --posix option correctly. We can use this to avoid portability problems in gnulib-tool. Please report any breakage that this change introduces :-) 2006-12-22 Bruno Haible [EMAIL PROTECTED] * gnulib-tool (SED): New variable.

Re: coreutils 6.6 fails to compile on IRIX 5.3

2006-12-22 Thread Bruno Haible
Paul Eggert wrote: 2006-12-21 Paul Eggert [EMAIL PROTECTED] * MODULES.html.sh: New module wctype. * lib/wctype_.h, m4/wctype.m4, modules/wctype: New files. * lib/fnmatch.c: Don't bother to include wchar.h before wctype.h, since the new wctype module should fix

RE: GCC optimizes integer overflow: bug or feature?

2006-12-22 Thread Dave Korn
On 22 December 2006 00:59, Denis Vlasenko wrote: Or this, absolutely typical C code. i386 arch can compare 16 bits at a time here (luckily, no alighment worries on this arch): Whaddaya mean, no alignment worries? Misaligned accesses *kill* your performance! I know this doesn't affect

RE: GCC optimizes integer overflow: bug or feature?

2006-12-22 Thread Andrew Pinski
On Fri, 2006-12-22 at 17:08 +, Dave Korn wrote: Misaligned accesses *kill* your performance! Maybe on x86, but on PPC, at least for the (current) Cell's PPU misaligned accesses for most cases unaligned are optimal. Thanks, Andrew Pinski

Re: GCC optimizes integer overflow: bug or feature?

2006-12-22 Thread Robert Dewar
Andrew Pinski wrote: On Fri, 2006-12-22 at 17:08 +, Dave Korn wrote: Misaligned accesses *kill* your performance! Maybe on x86, but on PPC, at least for the (current) Cell's PPU misaligned accesses for most cases unaligned are optimal. is that true across cache boundaries? Thanks,

ACL support for copy-file module

2006-12-22 Thread Bruno Haible
Hi, Can an ACL expert please proofread this? This adds ACL support to the copy_file_preserving function. It compiles fine, but I cannot test it since none of my systems has ACL support. 2006-12-22 Bruno Haible [EMAIL PROTECTED] * lib/copy-file.c: Include acl.h.

Re: GCC optimizes integer overflow: bug or feature?

2006-12-22 Thread Denis Vlasenko
On Friday 22 December 2006 03:03, Paul Brook wrote: On Friday 22 December 2006 00:58, Denis Vlasenko wrote: On Tuesday 19 December 2006 23:39, Denis Vlasenko wrote: There are a lot of 100.00% safe optimizations which gcc can do. Value range propagation for bitwise operations, for one