Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Eric Botcazou
> > Does -ftrapv ever take advantage of trapping instructions where the > > hardware has them available? > > Yes, for example Alpha. OK, but it's the only example. :-) > > Does anyone make substantial use of -ftrapv in production > > There are rarely bug reports about it; for example pointer diff

Re: [Ada] Patch needed to boostrap Ada on x86_64 as of 20050628

2005-06-28 Thread Laurent GUERBY
flag_wrapv=1 also restores bootstrap on x86_64-linux without needing -O0 in Makefiles. Laurent Index: misc.c === RCS file: /cvs/gcc/gcc/gcc/ada/misc.c,v retrieving revision 1.104 diff -u -r1.104 misc.c --- misc.c 28 Jun 2005 19:

A question about a possible build problem.

2005-06-28 Thread George R Goffe
Howdy, I'm building gcc version "gcc (GCC) 4.1.0 20050627" from cvs successfully on my redhat enterprise linux 3 update 4 system and then turning around and building it again with itself by repeating the exact process via a script. The second build fails with the following: snip--- tail:

Re: stage 2 date?

2005-06-28 Thread Mark Mitchell
Ben Elliston wrote: (Re-sending to the right list this time!) The URL specifies that the final date for stage 2 is July 8, 2005. I want to ask if this is still accurate? Thanks, Yes, it is. We may have bitten off more than we could chew this c

GCC-4.1.0 size optimization bug for MIPS architecture...

2005-06-28 Thread Steven J. Hill
Greetings. I have discovered what appears to be an optimization bug with '-Os' in GCC-4.1.0 for the MIPS architecture. It appears that functions which are declared as 'inline' are being ignored and instead turned into to function calls which is breaking the dynamic linker loader for uClibc on MIP

Re: Do CO++ signed types have modulo semantics?

2005-06-28 Thread Joe Buck
> >> Joe Buck wrote: > >> Here's a simple example. > >> > >> int blah(int); > >> > >> int func(int a, int b) { > >> if (b >= 0) { > >> int c = a + b; > >> int count = 0; > >> for (int i = a; i <= c; i++) > >> count++; > >> blah(count); > >> }

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Scott Robert Ladd
Marcin Dalecki wrote: > The only thing this thread teaches me is the conviction that *every* > instruction set architecture, which relies on compilers to make the most > out if it is severely ill guided. I've learned that I'm not the only guy who can start a really long, contentious thread on the

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Marcin Dalecki
On 2005-06-29, at 03:21, Diego Novillo wrote: On Wed, Jun 29, 2005 at 03:13:45AM +0200, Gabriel Dos Reis wrote: Robert Dewar <[EMAIL PROTECTED]> writes: | You did not read anything even vaguely saying that in what I wrote. and you, did you? Folks, can you take this offline? It's

Re: Do CO++ signed types have modulo semantics?

2005-06-28 Thread Paul Schlie
> Mark Mitchell wrote: >> Joe Buck wrote: >> ... >> I don't think we should give the user any such promise, and if we do >> give such a promise, we will never catch icc. The main problem is that >> we will no longer be able to optimize many loops. > > It's entirely possible that I was naive in ass

stage 2 date?

2005-06-28 Thread Ben Elliston
(Re-sending to the right list this time!) The URL specifies that the final date for stage 2 is July 8, 2005. I want to ask if this is still accurate? Thanks, Ben signature.asc Description: OpenPGP digital signature

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Diego Novillo
On Wed, Jun 29, 2005 at 03:13:45AM +0200, Gabriel Dos Reis wrote: > Robert Dewar <[EMAIL PROTECTED]> writes: > | You did not read anything even vaguely saying that in what I wrote. > > and you, did you? > Folks, can you take this offline? It's getting rather tiresome. Thanks. Diego.

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | > Robert Dewar <[EMAIL PROTECTED]> writes: | > | Gabriel Dos Reis wrote: | > | | > C is | > | > trustworthy (and preferred over SML for that curcial part of the proof | > | > checker) because the mapping of the C code to the gen

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Gabriel Dos Reis wrote: Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | | > C is | > trustworthy (and preferred over SML for that curcial part of the proof | > checker) because the mapping of the C code to the generated assembly | > code is straighforward and amenable to

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | | > C is | > trustworthy (and preferred over SML for that curcial part of the proof | > checker) because the mapping of the C code to the generated assembly | > code is straighforward and amenable to inspection. | | This kind

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Gabriel Dos Reis wrote: C is trustworthy (and preferred over SML for that curcial part of the proof checker) because the mapping of the C code to the generated assembly code is straighforward and amenable to inspection. This kind of traceability is of course vital for such applications, but i

gcc-3.4-20050628 is now available

2005-06-28 Thread gccadmin
Snapshot gcc-3.4-20050628 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/3.4-20050628/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 3.4 CVS branch with the following options: -rgcc-ss-3_4-20050628 You'll

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Georg Bauhaus <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | > Robert Dewar <[EMAIL PROTECTED]> writes: | > | Gabriel Dos Reis wrote: | > | | But the whole idea of hardware semantics is bogus, since you are | > | assuming some connection between C and the hardware which does not | > | exi

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Michael Veksler
Michael Veksler wrote on 29/06/2005 00:53:33: > Robert Dewar wrote on 28/06/2005 22:20:56: > > > I am puzzled, why would *ANYONE* who knows C use int > > rather than unsigned if they want wrap around semantics? > > > > int saturated_mul(int a, int b) > { >int ret= a*b; >if (a == 0 || re

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Georg Bauhaus
Gabriel Dos Reis wrote: Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | | But the whole idea of hardware semantics is bogus, since you are | assuming some connection between C and the hardware which does not | exist. C is not an assembly language. If you live in a differe

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Georg Bauhaus
Joe Buck wrote: 32-bit integers are going to remain useful types, and LP64 architectures finally have char = 8, short = 16, int = 32, long = 64, which is too useful to break. Hmm... pratically, "Handle and Pointer Sizes" in http://www.intel.com/cd/ids/developer/asmo-na/eng/dc/64bit/197664.htm

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Joseph S. Myers wrote: Does anyone make substantial use of -ftrapv in production (whether as a tool for detecting bugs, or as a security tool where the performance cost is acceptable)? Or is it still at the stage of being a tool which would be useful in principle for some purposes but still n

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Falk Hueffner
"Joseph S. Myers" <[EMAIL PROTECTED]> writes: > Does -ftrapv ever take advantage of trapping instructions where the > hardware has them available? Yes, for example Alpha. > Does anyone make substantial use of -ftrapv in production There are rarely bug reports about it; for example pointer diffe

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joseph S. Myers
On Tue, 28 Jun 2005, Robert Dewar wrote: > are preserved. For instance on the IBM mainframe one might use signed > or unsigned operations to implement int operations. On the original > MIPS one might use trapping or non-trapping arithmetic (either would > be valid). Does -ftrapv ever take advanta

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Mike Stump
On Jun 28, 2005, at 5:57 AM, Robert Dewar wrote: C is not an assembly language. My head explodes.

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Joe Buck wrote: I challenge you, Robert, to find us a C compiler that generates trapping instructions for integer adds by default. I do not believe that such a compiler exists. Probably there is no production compiler that does, MIPS would be the only possibility I think in practice. Certainl

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Gabriel Dos Reis wrote: In case you may not have noticed, people offered to run tests and send some numbers. Right, I think further discussion until these numbers arrive is of dubious value, so I am suspending the thread till later :-)

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Michael Veksler
Robert Dewar wrote on 28/06/2005 22:20:56: > I am puzzled, why would *ANYONE* who knows C use int > rather than unsigned if they want wrap around semantics? > int saturated_mul(int a, int b) { int ret= a*b; if (a == 0 || ret % a == 0) return ret; else if ( (a<0) == (b<0) ) //

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Olivier Galibert
On Tue, Jun 28, 2005 at 02:44:40PM -0700, Joe Buck wrote: > I challenge you, Robert, to find us a C compiler that generates trapping > instructions for integer adds by default. I do not believe that such a > compiler exists. Perusing the manpage of SGI's cc and CC on IRIX, there isn't even an opt

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 03:20:01PM -0400, Robert Dewar wrote: > Andrew Pinski wrote: > > >No it is not. It was when it was designed yes but since the C standard has > >come out and the aliasing rules really show that it is not a high level > >assembler language any more. > > Even when it was desi

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 03:31:59PM -0400, Robert Dewar wrote: > Gabriel Dos Reis wrote: > > >The strict aliasing rule by itself does not show it is not a high level > >assembly language. There are chips out there where you cannot access > >data willy-nilly through random register types. > > And

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 04:24:38PM -0400, Robert Dewar wrote: > Paul Koning wrote: > > >And also because most people believe that C applies normal computer > >arithmetic, and they believe that normal computer arithmetic is > >wrapped 2's complement. (And indeed it usually is, give or take some >

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Andreas Schwab
Paul Koning <[EMAIL PROTECTED]> writes: >> "Gabriel" == Gabriel Dos Reis <[EMAIL PROTECTED]> writes: > > Gabriel> When it comes down for the compiler writer to chose > Gabriel> something for undefined behaviour, it is hardly solely based > Gabriel> on the C standard. In fact, the C standar

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 11:19:18PM +0200, Gabriel Dos Reis wrote: > Robert Dewar <[EMAIL PROTECTED]> writes: > > | Gabriel Dos Reis wrote: > | > Robert Dewar <[EMAIL PROTECTED]> writes: > | > | "has the semantics that Gabriel Dos Reis wants" is not an evaluable > | > | predicate! > | > You complet

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Paul Koning
> "Gabriel" == Gabriel Dos Reis <[EMAIL PROTECTED]> writes: > Robert Dewar <[EMAIL PROTECTED]> writes: > > Gabriel Dos Reis wrote: >> Robert Dewar <[EMAIL PROTECTED]> writes: >> >"has the semantics that Gabriel Dos Reis wants" is not an evaluable >> >predicate! >> You completely missed the poi

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | > Robert Dewar <[EMAIL PROTECTED]> writes: | > | "has the semantics that Gabriel Dos Reis wants" is not an evaluable | > | predicate! | > You completely missed the point, but I guess it is consistent with | > your denying that th

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Gabriel Dos Reis wrote: Robert Dewar <[EMAIL PROTECTED]> writes: | "has the semantics that Gabriel Dos Reis wants" is not an evaluable | predicate! You completely missed the point, but I guess it is consistent with your denying that there is any connection between C or C++ and hardware. So, l

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | > Robert Dewar <[EMAIL PROTECTED]> writes: | > | Gabriel Dos Reis wrote: | > | | > The strict aliasing rule by itself does not show it is not a | > high level | > | > assembly language. There are chips out there where you cannot

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | "has the semantics that Gabriel Dos Reis wants" is not an evaluable | predicate! You completely missed the point, but I guess it is consistent with your denying that there is any connection between C or C++ and hardware. -- Gaby

[Ada] Patch needed to boostrap Ada on x86_64 as of 20050628

2005-06-28 Thread Laurent GUERBY
Ada bootstraps fine without patch on x86-linux, however on x86_64 bootstrap fail because of: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22212 The following patch is a workaround for it, it enables a full bootstrap and only 2 additional FAIL in ACATS, results here: http://gcc.gnu.org/ml/gcc-testr

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Gabriel Dos Reis wrote: Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | | > The strict aliasing rule by itself does not show it is not a high level | > assembly language. There are chips out there where you cannot access | > data willy-nilly through random register types.

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Gabriel Dos Reis wrote: C and C++ are general programming language geared toward system programming. Yes, and my two examples are completely consistent with that. A C compiler that uses the trapping arithmetic on the MIPS is entirely conforming, and has the advantage that if you develop with

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Paul Koning wrote: And also because most people believe that C applies normal computer arithmetic, and they believe that normal computer arithmetic is wrapped 2's complement. (And indeed it usually is, give or take some bizarre exceptions like MAX_INT % -1) and not so bizarre exceptions like

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Paul Koning
> "Robert" == Robert Dewar <[EMAIL PROTECTED]> writes: Robert> I am puzzled, why would *ANYONE* who knows C use int rather Robert> than unsigned if they want wrap around semantics? Because most people don't follow the rule that "always use unsigned variables unless you know that it really n

Re: GCC 4.0.1 Status (2005-06-27)

2005-06-28 Thread Jeffrey A Law
On Tue, 2005-06-28 at 08:50 -0700, Mark Mitchell wrote: > Jeffrey A Law wrote: > > On Tue, 2005-06-28 at 00:20 -0700, Mark Mitchell wrote: > > > >>As stated earlier, the only patches I'm considering for 4.0.1 at present > >>are wrong-code cases on primary platforms. There are several open, but

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | | > The strict aliasing rule by itself does not show it is not a high level | > assembly language. There are chips out there where you cannot access | > data willy-nilly through random register types. | | And there are chips f

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Toon Moene
Andrew Pinski wrote: The first change in GCC which changed signed overflow/wrapping to be undefined was added back in 1992 in loop.c. Why are we talking about this now, instead of back when they were added ? Well, I don't know about the rest of the GCC developers at that time (1992), but

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | > Robert Dewar <[EMAIL PROTECTED]> writes: | > | Olivier Galibert wrote: | > | | > Calling a large part of the programs out there, including a non | > | > negligible subpart of what I personally write either "blatantly buggy" | >

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Gabriel Dos Reis wrote: The strict aliasing rule by itself does not show it is not a high level assembly language. There are chips out there where you cannot access data willy-nilly through random register types. And there are chips for which signed arithmetic is not wrap around!

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Andrew Pinski <[EMAIL PROTECTED]> writes: | On Jun 28, 2005, at 3:10 PM, Olivier Galibert wrote: | | > | >> Well, I don't utterly _anything_ about either his position or | >> yours. C is | >> not just a high level assembler, it has complex and abstract semantics | >> imposed on that; | > | > Y

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
I am puzzled, why would *ANYONE* who knows C use int rather than unsigned if they want wrap around semantics?

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Andrew Pinski wrote: No it is not. It was when it was designed yes but since the C standard has come out and the aliasing rules really show that it is not a high level assembler language any more. Even when it was designed there was more abstraction than you think (e.g. cannot convert *char va

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Olivier Galibert
On Tue, Jun 28, 2005 at 02:52:10PM -0400, Robert Dewar wrote: > Olivier Galibert wrote: > >On Tue, Jun 28, 2005 at 06:36:26PM +0100, Dave Korn wrote: > > > >> It certainly wasn't meant to be. It was meant to be a dispassionate > >>description of the state of facts. Software that violates the C st

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Gabriel Dos Reis wrote: Robert Dewar <[EMAIL PROTECTED]> writes: | Olivier Galibert wrote: | | > Calling a large part of the programs out there, including a non | > negligible subpart of what I personally write either "blatantly buggy" | > or "subtly-incorrect" is somewhat childish and insulti

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Andrew Pinski
On Jun 28, 2005, at 3:10 PM, Olivier Galibert wrote: Well, I don't utterly _anything_ about either his position or yours. C is not just a high level assembler, it has complex and abstract semantics imposed on that; Yes. But C is _also_ a high level assembler, and ignoring that is fool

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Olivier Galibert
On Tue, Jun 28, 2005 at 07:36:00PM +0100, Dave Korn wrote: > Original Message > >From: Olivier Galibert > >Sent: 28 June 2005 19:02 > > > On Tue, Jun 28, 2005 at 06:36:26PM +0100, Dave Korn wrote: > >> It certainly wasn't meant to be. It was meant to be a dispassionate > >> description

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | Olivier Galibert wrote: | | > Calling a large part of the programs out there, including a non | > negligible subpart of what I personally write either "blatantly buggy" | > or "subtly-incorrect" is somewhat childish and insulting. | | nope, I don't see

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
"Dave Korn" <[EMAIL PROTECTED]> writes: [...] | >Maybe you should reread what I was replying to: | > | > On Tue, Jun 28, 2005 at 08:57:20AM -0400, Robert Dewar wrote: | >> But the whole idea of hardware semantics is bogus, since you are | >> assuming some connection between C and the hardware wh

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Gabriel Dos Reis wrote: But the compiler miscompiled the Unix kernel -- which, apart from has history intermixed with the C language design, was relying on "undocumented" aspect of "undefined behaviour". Nobdoy was willing to buy the compiler. The company ran out of business. Could you pleas

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Olivier Galibert wrote: On Tue, Jun 28, 2005 at 06:36:26PM +0100, Dave Korn wrote: It certainly wasn't meant to be. It was meant to be a dispassionate description of the state of facts. Software that violates the C standard just *is* "buggy" or "incorrect", and your personal pride has absolu

Re: Bootstrap failure -- verify_ssa failed

2005-06-28 Thread Diego Novillo
On Tue, Jun 28, 2005 at 08:38:13PM +0200, Ulrich Weigand wrote: > Hello, > > with current GCC mainline bootstrap fails on s390(x)-ibm-linux > during stage2 build with: > I'm on it. Diego.

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Robert Dewar
Olivier Galibert wrote: Calling a large part of the programs out there, including a non negligible subpart of what I personally write either "blatantly buggy" or "subtly-incorrect" is somewhat childish and insulting. nope, I don't see it that way at all, this is just a statement of fact wrt th

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Michael Veksler
Morten Welinder wrote on 28/06/2005 19:59:10: > > In particular, a very large number of C and C++ programs are written > > with the assumptions: > > >- signed and unsigned types are modulo, except in loop induction > > variables where it's bad taste > > Well, as demonstrated by INT_MIN/-1, g

Re: Bootstrap failure -- verify_ssa failed

2005-06-28 Thread Andrew Pinski
On Jun 28, 2005, at 2:38 PM, Ulrich Weigand wrote: Hello, with current GCC mainline bootstrap fails on s390(x)-ibm-linux during stage2 build with: ../../gcc-head/gcc/tree-ssa-operands.c: In function 'finalize_ssa_uses': ../../gcc-head/gcc/tree-ssa-operands.c:570: error: Definition in block

Re: Bootstrap failure -- verify_ssa failed

2005-06-28 Thread David Edelsohn
The same failure occurs on PowerPC: http://gcc.gnu.org/ml/gcc-regression/2005-06/msg00090.html David

RE: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Dave Korn
Original Message >From: Olivier Galibert >Sent: 28 June 2005 19:29 > Incidentally, gcc itself makes most of these assumptions in its own > code. I kinda doubt you can run it on a dsp or a machine with 16-bits > ints. Which is different than generating code for them. They aren't assump

Bootstrap failure -- verify_ssa failed

2005-06-28 Thread Ulrich Weigand
Hello, with current GCC mainline bootstrap fails on s390(x)-ibm-linux during stage2 build with: ../../gcc-head/gcc/tree-ssa-operands.c: In function 'finalize_ssa_uses': ../../gcc-head/gcc/tree-ssa-operands.c:570: error: Definition in block 64 does not dominate use in block 13 for SSA_NAME: TMT.6

Re: GCC 4.0.1 Status (2005-06-27)

2005-06-28 Thread Jeffrey A Law
On Tue, 2005-06-28 at 08:50 -0700, Mark Mitchell wrote: > Jeffrey A Law wrote: > > On Tue, 2005-06-28 at 00:20 -0700, Mark Mitchell wrote: > > > >>As stated earlier, the only patches I'm considering for 4.0.1 at present > >>are wrong-code cases on primary platforms. There are several open, but

RE: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Dave Korn
Original Message >From: Olivier Galibert >Sent: 28 June 2005 19:02 > On Tue, Jun 28, 2005 at 06:36:26PM +0100, Dave Korn wrote: >> It certainly wasn't meant to be. It was meant to be a dispassionate >> description of the state of facts. Software that violates the C standard >> just *is

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Olivier Galibert
On Tue, Jun 28, 2005 at 10:50:39AM -0700, Joe Buck wrote: > On Tue, Jun 28, 2005 at 07:17:52PM +0200, Olivier Galibert wrote: > > On Tue, Jun 28, 2005 at 04:03:49PM +0100, Andrew Haley wrote: > > > This is childish and insulting. > > > > Calling a large part of the programs out there, including a

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Joe Buck <[EMAIL PROTECTED]> writes: | On Tue, Jun 28, 2005 at 07:17:52PM +0200, Olivier Galibert wrote: | > On Tue, Jun 28, 2005 at 04:03:49PM +0100, Andrew Haley wrote: | > > This is childish and insulting. | > | > Calling a large part of the programs out there, including a non | > negligible s

Re: Do C++ signed types have modulo semantics?

2005-06-28 Thread Mark Mitchell
Daniel Berlin wrote: On Tue, 28 Jun 2005, Mark Mitchell wrote: Joe Buck wrote: I don't think we should give the user any such promise, and if we do give such a promise, we will never catch icc. The main problem is that we will no longer be able to optimize many loops. It's entirely poss

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Joe Buck <[EMAIL PROTECTED]> writes: | On Tue, Jun 28, 2005 at 07:02:49PM +0200, Gabriel Dos Reis wrote: | > | Since behavior on integer overflow is undefined, we can optimize assuming | > | that overflow has not occurred. Then a > c, so the for loop always | > | executes b+1 times, and we end up

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Olivier Galibert
On Tue, Jun 28, 2005 at 06:36:26PM +0100, Dave Korn wrote: > It certainly wasn't meant to be. It was meant to be a dispassionate > description of the state of facts. Software that violates the C standard > just *is* "buggy" or "incorrect", and your personal pride has absolutely > nothing to do

Re: Do C++ signed types have modulo semantics?

2005-06-28 Thread Gabriel Dos Reis
"Joseph S. Myers" <[EMAIL PROTECTED]> writes: | On Tue, 28 Jun 2005, Gabriel Dos Reis wrote: | | > Yes, we should document this. In general, implementation defined | > aspects (and some of the undefined behaviour aspects) are missing | > documentation for C++ -- JSM did some work for that for C.

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 07:17:52PM +0200, Olivier Galibert wrote: > On Tue, Jun 28, 2005 at 04:03:49PM +0100, Andrew Haley wrote: > > This is childish and insulting. > > Calling a large part of the programs out there, including a non > negligible subpart of what I personally write either "blatantl

Re: Do C++ signed types have modulo semantics?

2005-06-28 Thread Theodore Papadopoulo
On Tue, 2005-06-28 at 10:02 -0700, Mark Mitchell wrote: > Joe Buck wrote: > > > > int blah(int); > > > > int func(int a, int b) { > > if (b >= 0) { > > int c = a + b; > > int count = 0; > > for (int i = a; i <= c; i++) > > count++; > > blah(count); > > } > > } >

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Paul Schlie
Gabriel Dos Reis writes: > Steven Bosscher <[EMAIL PROTECTED]> writes: >| On Tuesday 28 June 2005 07:12, Gabriel Dos Reis wrote: >| > For the concrete case at issue, if the hardware I'm writing the C/C++ >| > programs for consistently displays modulo arithmetics for signed >| > integer type, Andrew

RE: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Dave Korn
Original Message >From: Olivier Galibert >Sent: 28 June 2005 18:18 > On Tue, Jun 28, 2005 at 04:03:49PM +0100, Andrew Haley wrote: >> Olivier Galibert writes: >> > On Tue, Jun 28, 2005 at 03:39:38PM +0100, Dave Korn wrote: > > >> Original Message > > >From: Olivier Galibert >>

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Diego Novillo
On Tue, Jun 28, 2005 at 07:02:49PM +0200, Gabriel Dos Reis wrote: > We document that > > a = (int) ((unsigned) b + c) > > is well-defined and given by the wrapping semantics. Does the current > optimizer takes that into account or will it assume b+1 execution times? > I fixed this bu

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 07:02:49PM +0200, Gabriel Dos Reis wrote: > | Since behavior on integer overflow is undefined, we can optimize assuming > | that overflow has not occurred. Then a > c, so the for loop always > | executes b+1 times, and we end up with > | > | if (b > 0) > | some_fun

Re: G++ and ISO C++

2005-06-28 Thread Giovanni Bajo
Mirza <[EMAIL PROTECTED]> wrote: > Can someone point me to list of ISO C++ vs. g++ incompatibilities. There are very few large issues at this point. The only big feature missing is "export", then it's a bunch of relatively minor nits (access checking in friend declarations within templates, corre

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Olivier Galibert
On Tue, Jun 28, 2005 at 12:59:10PM -0400, Morten Welinder wrote: > > In particular, a very large number of C and C++ programs are written > > with the assumptions: > > >- signed and unsigned types are modulo, except in loop induction > > variables where it's bad taste > > Well, as demonstrated by

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 06:10:26PM +0100, Dave Korn wrote: > >>> - sizeof(int) == 4, sizeof(long long) == 8 > >>> > >>> - sizeof(long) == sizeof(void *) == sizeof(void (*)()) > >> And what about 64 bit architectures? Your assumptions are already > >> widely invalid and only going to get more s

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Olivier Galibert
On Tue, Jun 28, 2005 at 04:03:49PM +0100, Andrew Haley wrote: > Olivier Galibert writes: > > On Tue, Jun 28, 2005 at 03:39:38PM +0100, Dave Korn wrote: > > > Original Message > > > >From: Olivier Galibert > > > >Sent: 28 June 2005 15:25 > > > > > > > In particular, a very large numbe

RE: LCOV

2005-06-28 Thread Dave Korn
Original Message >From: Dickson Patton >Sent: 27 June 2005 18:41 > All, > > LCOV looks like what we were planning. Let's steal it. > > See you at 7:00. > > > Dickson Sorry, I couldn't make it. Did you save any beer for me? cheers, DaveK P.S. Don't you think a "sen

RE: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Dave Korn
Original Message >From: Joe Buck >Sent: 28 June 2005 17:42 > On Tue, Jun 28, 2005 at 03:39:38PM +0100, Dave Korn wrote: >> Original Message >>> From: Olivier Galibert >>> Sent: 28 June 2005 15:25 >> >>> In particular, a very large number of C and C++ programs are written >>> with

Re: Do C++ signed types have modulo semantics?

2005-06-28 Thread Daniel Berlin
On Tue, 28 Jun 2005, Mark Mitchell wrote: Joe Buck wrote: I don't think we should give the user any such promise, and if we do give such a promise, we will never catch icc. The main problem is that we will no longer be able to optimize many loops. It's entirely possible that I was naive i

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Gabriel Dos Reis
Joe Buck <[EMAIL PROTECTED]> writes: | On Tue, Jun 28, 2005 at 10:23:51AM +0300, Michael Veksler wrote: | | | On Jun 28, 2005, at 1:12 AM, Gabriel Dos Reis wrote: | > > > So, | > > > please, do refrain from reasoning like "since we did X for Y and Y was | > > > undefined behaviour, we should

Re: Do C++ signed types have modulo semantics?

2005-06-28 Thread Mark Mitchell
Joe Buck wrote: I don't think we should give the user any such promise, and if we do give such a promise, we will never catch icc. The main problem is that we will no longer be able to optimize many loops. It's entirely possible that I was naive in assuming that this wouldn't have a big opti

Re: G++ and ISO C++

2005-06-28 Thread Kurt Wall
On Tue, Jun 28, 2005 at 03:57:31PM +0200, Mirza took 0 lines to write: > Hi, > > Can someone point me to list of ISO C++ vs. g++ incompatibilities. > See http://gcc.gnu.org/bugs.html#cxx. There is a second C++ section near the bottom of the same page; there's a list of C++ extensions in "info gc

Re: toplevel bootstrap (stage 2 project)

2005-06-28 Thread Giovanni Bajo
Daniel Berlin <[EMAIL PROTECTED]> wrote: >> Well, because Wiki is more attractive to people writing >> documentation for several reasons (faster than writing a HTML/TeX >> patch and submitting it for review, etc.). Maybe we should think if >> we want to use the Wiki as our rapid documentation prot

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Morten Welinder
> In particular, a very large number of C and C++ programs are written > with the assumptions: >- signed and unsigned types are modulo, except in loop induction > variables where it's bad taste Well, as demonstrated by INT_MIN/-1, gcc has NEVER fulfilled such assumptions on i86 and, quite likely,

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 09:32:49AM -0700, Joe Buck wrote: > /* int a, b, c; */ > if (b > 0) { > a = b + c; > int count; > for (int i = c; i <= a; i++) > count++; > some_func(count); > } I forgot to initialize count to 0, of course.

Re: Do C++ signed types have modulo semantics?

2005-06-28 Thread Joe Buck
On Mon, Jun 27, 2005 at 08:05:48PM -0700, Mark Mitchell wrote: > Michael Veksler wrote: > > >>Most programmers "know" that arithmetic is modulo wordsize. And those few > >>who know the right answer (only unsigned arithmetic is modulo) will > >>from time to time slip up and omit the "unsigned" key

Re: Do C++ signed types have modulo semantics?

2005-06-28 Thread Joseph S. Myers
On Tue, 28 Jun 2005, Gabriel Dos Reis wrote: > Yes, we should document this. In general, implementation defined > aspects (and some of the undefined behaviour aspects) are missing > documentation for C++ -- JSM did some work for that for C. Is there a convenient checklist for C++ similar to C99'

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 03:39:38PM +0100, Dave Korn wrote: > Original Message > >From: Olivier Galibert > >Sent: 28 June 2005 15:25 > > > In particular, a very large number of C and C++ programs are written > > with the assumptions: > > This is a bad line of reasoning in general. There

Re: Do C++ signed types have modulo semantics?

2005-06-28 Thread Gabriel Dos Reis
Michael Veksler <[EMAIL PROTECTED]> writes: | Nathan Sidwell <[EMAIL PROTECTED]> wrote on 28/06/2005 18:48:26: | | > | > why are you talking about one's complement in the context of gcc. From | > implement-c.texi | > | >@cite{Whether signed integer types are represented using sign and | magn

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 08:57:20AM -0400, Robert Dewar wrote: > Gabriel Dos Reis wrote: > = > >Please do remember that this is hardware dependent. If you have > >problems with x86, it does not mean you have the same witha PPC or a > >Sparc. > > But the whole idea of hardware semantics is bogus,

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 10:23:51AM +0300, Michael Veksler wrote: On Jun 28, 2005, at 1:12 AM, Gabriel Dos Reis wrote: > > > So, > > > please, do refrain from reasoning like "since we did X for Y and Y was > > > undefined behaviour, we should do the same for Z." "Undefined > > > behaviour" isn

Re: GCC 4.0.1 Status (2005-06-27)

2005-06-28 Thread Joe Buck
On Tue, Jun 28, 2005 at 10:06:35AM -0600, Jeffrey A Law wrote: > On Tue, 2005-06-28 at 08:50 -0700, Mark Mitchell wrote: > > Perhaps you could get a patch put together, test it by staring > > atassembly output, and then ask for a volunteer to test it? I expect > > that Joseph could do a test run

  1   2   >