Re: Add clog10 to builtins.def, round 2

2005-07-02 Thread FX Coudert
The fortran front-end needs to recognize clog10, clog10f and clog10l a proper built-ins. Attached patch tries to add them to clog10, under a new category: DEF_EXT_C99RES_BUILTIN (as suggested by jsm28). Can someone review this? Is it OK? Just realized I forgot the ChangeLog entry to go with it.

Re: "cycle advancing states" versus "cycle advancing arcs"

2005-07-02 Thread Vladimir N. Makarov
On Fri, 2005-07-01 at 22:20 -0300, Rafael Ávila de Espíndola wrote: > The finite automaton used in the pipeline hazard recognizer uses a cycle > advancing arc in every state to represent a clock pulse. Bala(1) uses a > different technique: All states were a instruction issue is not possible are

Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?

2005-07-02 Thread Gabriel Dos Reis
Joe Buck <[EMAIL PROTECTED]> writes: | On Sat, Jul 02, 2005 at 07:15:17PM -0400, Robert Dewar wrote: | > Gabriel Dos Reis wrote: | > > | > > for (int i = min; i < max; ++i) | > > | > > | > >and i, min and max don't change in the body, no matter what you think | > >of C's general "for"

Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?

2005-07-02 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | >for (int i = min; i < max; ++i) | > | > and i, min and max don't change in the body, no matter what you think | > of C's general "for" not being a FOR loop, the above is a FOR loop. | | But this normal paradigm

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

2005-07-02 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | Florian Weimer wrote: | | > Probably it's hard to accept for hard-code C coders that a program | > which generates correct machine code with all GCC versions released so | > far (modulo bugs in GCC) can still be illegal C and exhibit undefined | > behavi

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

2005-07-02 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | | > We need to be careful not to to substitute "illegal" for "undefined | > behaviour". GCC is not a court. | | Note that in Ada, You may not have noticed but this issue is primarily about C and C++ and we're discussing what t

Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?

2005-07-02 Thread Joe Buck
On Sat, Jul 02, 2005 at 07:15:17PM -0400, Robert Dewar wrote: > Gabriel Dos Reis wrote: > > > > for (int i = min; i < max; ++i) > > > > > >and i, min and max don't change in the body, no matter what you think > >of C's general "for" not being a FOR loop, the above is a FOR loop. > > B

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

2005-07-02 Thread Robert Dewar
Gabriel Dos Reis wrote: We need to be careful not to to substitute "illegal" for "undefined behaviour". GCC is not a court. Note that in Ada, illegal is a technical term, it refers to a program that fails to meet the syntactic or static semantic rules for a correct Ada program, and must be rej

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

2005-07-02 Thread Robert Dewar
Florian Weimer wrote: Probably it's hard to accept for hard-code C coders that a program which generates correct machine code with all GCC versions released so far (modulo bugs in GCC) can still be illegal C and exhibit undefined behavior. IIRC, I needed quite some time to realize the full impa

Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?

2005-07-02 Thread Robert Dewar
Gabriel Dos Reis wrote: for (int i = min; i < max; ++i) and i, min and max don't change in the body, no matter what you think of C's general "for" not being a FOR loop, the above is a FOR loop. But this normal paradigm for representing a FOR loop does not work for all possible

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

2005-07-02 Thread Nicholas Nethercote
On Sat, 2 Jul 2005, Florian Weimer wrote: I am puzzled, why would *ANYONE* who knows C use int rather than unsigned if they want wrap around semantics? Both OpenSSL and Apache programmers did this, in carefully reviewed code which was written in response to a security report. They simply didn

Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?

2005-07-02 Thread Gabriel Dos Reis
Robert Dewar <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis wrote: | | > As we have briefly discussed in mails, the most critical part of the | > issue seems to be what can be assumed for loop variables. I countend | > that for many if not most practical loops, the variable can be assumed | > no

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

2005-07-02 Thread Gabriel Dos Reis
Florian Weimer <[EMAIL PROTECTED]> writes: | * Robert Dewar: | | > I am puzzled, why would *ANYONE* who knows C use int | > rather than unsigned if they want wrap around semantics? | | Both OpenSSL and Apache programmers did this, in carefully reviewed | code which was written in response to a s

Re: potential simple loop optimization assistance strategy?

2005-07-02 Thread Giovanni Bajo
Michael Veksler <[EMAIL PROTECTED]> wrote: > have no side effects. So if "condition" contains any side effect, > or potential side effect (e.g. through function call), then the > compiler should not generate the code for "condition". Right. Thus we can find a way to avoid generating e.g. functio

gcc-4.1-20050702 is now available

2005-07-02 Thread gccadmin
Snapshot gcc-4.1-20050702 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.1-20050702/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.1 CVS branch with the following options: -D2005-07-02 17:43 UTC You'll

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

2005-07-02 Thread Florian Weimer
* Robert Dewar: > I am puzzled, why would *ANYONE* who knows C use int > rather than unsigned if they want wrap around semantics? Both OpenSSL and Apache programmers did this, in carefully reviewed code which was written in response to a security report. They simply didn't know that there is a p

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

2005-07-02 Thread Florian Weimer
* Dave Korn: > 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", Not if a GCC extension makes it legal code. And actually, I believe a GCC extension which basicall

Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?

2005-07-02 Thread Robert Dewar
Gabriel Dos Reis wrote: As we have briefly discussed in mails, the most critical part of the issue seems to be what can be assumed for loop variables. I countend that for many if not most practical loops, the variable can be assumed not to overflow and apply the transformation. But we need not

Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?

2005-07-02 Thread Robert Dewar
Paul Schlie wrote: My primary concern is about predictability, and could live with undefined integer overflow if it were likely reasonably possible to verify that in the general case an overflow would not occur, as otherwise an undefined behavior may result. (which I can't believe is acceptable

Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?

2005-07-02 Thread Robert Dewar
Andrew Pinski wrote: But the reason question is why make it an undefined behavior instead of an implementation defined? This would have made it clearer instead of allowing the compiler not document what happens. Or is C++ just following C here? In which case it might be better to ask the C co

Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?

2005-07-02 Thread Robert Dewar
Gabriel Dos Reis wrote: What I'm claiming is that he thinks "undefined behaviour" in the standard should not be taken as meaning "go to hell" (or punishment to borrow words from you) or absolute liberty for compiler writers to do just about everything that is imaginable, regardless of expectatio

Re: potential simple loop optimization assistance strategy?

2005-07-02 Thread Michael Veksler
Giovanni Bajo wrote on 02/07/2005 12:18:00: > > Yes, but the condition is still morally true in the code. NDEBUG is meant to > speed up the generated code, and it's actually a pity that instead it > *disables* some optimizations because we don't see the condition anymore. My > suggestion is tha

Re: MEMBER_TYPE_FORCES_BLK on IA-64/HP-UX

2005-07-02 Thread Eric Botcazou
> Steve Ellcey defined MEMBER_TYPE_FORCES_BLK when he first implemented > the ia64-hpux port. At the time, I mentioned using PARALLELs was a > better solution, but this was a simpler way for him to get the initial > port working. Since then, there have been a lot of bug fixes to the > ia64-hpux s

Re: potential simple loop optimization assistance strategy?

2005-07-02 Thread Giovanni Bajo
Tom Tromey <[EMAIL PROTECTED]> wrote: > Giovanni> Agreed, but my point is whether we can do that when NDEBUG > Giovanni> is defined. > > I thought when NDEBUG is defined, assert expands to something like > '(void) 0' -- the original expression is no longer around. Yes, but the condition is still