Re: RFC: GIMPLE tuples. Design and implementation proposal

2007-04-09 Thread Steven Bosscher
On 4/10/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Thoughts/comments on the proposal? This looks a lot like the RTL insn! For locus, you can use just an "int" instead of a word if you use the same representation for locations as we do for RTL (INSN_LOCATOR). You mention this step as "straigh

Re: RFC: GIMPLE tuples. Design and implementation proposal

2007-04-09 Thread J.C. Pizarro
The "conditional jumps" are sometimes bad. However, they've appeared the "conditional moves" to don't jump and consecuently to reduce the penalization of the conditional jump. I've the idea of combining GS_ASSIGN... and GS_COND... to give these following 6 new GIMPLE instructions: GS_ASSIGN_CON

Re: RFC: GIMPLE tuples. Design and implementation proposal

2007-04-09 Thread Andrew Pinski
On 4/9/07, Diego Novillo <[EMAIL PROTECTED]> wrote: Following up on the recent discussion about GIMPLE tuples (http://gcc.gnu.org/ml/gcc/2007-03/msg01126.html), we have summarized our main ideas and implementation proposal in the attached document. This should be enough to get the implementatio

Re: Inclusion in an official release of a new throw-like qualifier

2007-04-09 Thread Sergio Giro
I perceived that many people think that the throw qualifiers, as described by the standard, are not useful, as an example, I quote the Boost Exception-specification rationale: Although initially appealing, an exception-specification tends to have consequences that require very careful thought to

Re: RFC: GIMPLE tuples. Design and implementation proposal

2007-04-09 Thread J.C. Pizarro
2007/4/10, Diego Novillo <[EMAIL PROTECTED]>: Following up on the recent discussion about GIMPLE tuples (http://gcc.gnu.org/ml/gcc/2007-03/msg01126.html), we have summarized our main ideas and implementation proposal in the attached document. This should be enough to get the implementation goin

Re: Inclusion in an official release of a new throw-like qualifier

2007-04-09 Thread Jason Merrill
Sergio Giro wrote: I started a thread about the possible development of a throw-like qualifier for C++ which may statically check that the only possible exceptions are those declared in the qualifier (please see the corresponding thread: I'm strongly opposed to adding a new qualifier with sl

Re: Generating RTL for function call sequences from GIMPLE

2007-04-09 Thread Richard Henderson
On Mon, Apr 09, 2007 at 11:55:14PM +0100, Dave Korn wrote: > Thanks, I think you're right on there. The comments on PR31136 make it > fairly clear what's wrong; perhaps the best solution might be for > STRIP_SIGN_NOPS to mask out the high bits when it's discarding a size-reducing > NOP_EXPR? Or

Re: Questions/Comments regarding my SoC application

2007-04-09 Thread Dennis Weyland
Paolo Bonzini schrieb: Dennis Weyland wrote: Hi! I've applied for Google's Summer of Code 2007 with GCC as mentor organization. I want to make GCC working faster on the algorithmic level. I left out the detailed aims of the project, since i want to discuss them with gcc developers/mentors fi

RE: Integer overflow in operator new

2007-04-09 Thread Dave Korn
On 09 April 2007 21:49, Lawrence Crowl wrote: >>> The optimization above would be wrong for such machines because >>> the allocation would be smaller than the requested size. >> >> To request a size of ~size_t(0) is to request a size >> of 0x or 0xULL that the allocator >

RE: Generating RTL for function call sequences from GIMPLE

2007-04-09 Thread Dave Korn
On 09 April 2007 22:12, Richard Henderson wrote: > On Mon, Apr 09, 2007 at 07:37:31PM +0100, Dave Korn wrote: >> Should promotion of function arguments be explicitly represented in >> GIMPLE, or should it be performed when generating the corresponding RTL? > > There are two things here: > > (

Re: Integer overflow in operator new. Solved? Experimental i686 code.

2007-04-09 Thread J.C. Pizarro
#include // by J.C. Pîzarro ... // This function doesn't touch the ECX register that is touched by OptionC. __volatile__ static const int minus_one = -1; void *__allocate_array_OptionD(size_t num, size_t size) { register unsigned int result; __asm__ __volatile__ ( "imull %2"

Re: Documenting -fargument-noalias-anything in gcc-4.2/changes.html

2007-04-09 Thread Gerald Pfeifer
On Sat, 7 Apr 2007, Toon Moene wrote: > I do not have easy access to the HTML repository anymore. That's something we should be able to fix; just drop me (or [EMAIL PROTECTED]) a note! > Martin Michlmayr asked me to add to the 4.2 changes list the inclusion > of the new compile time option -far

Re: x86 inc/dec on core2

2007-04-09 Thread H. J. Lu
On Mon, Apr 09, 2007 at 11:13:17AM -0700, H. J. Lu wrote: > On Mon, Apr 09, 2007 at 10:51:22AM -0700, Mike Stump wrote: > > On Apr 8, 2007, at 8:51 PM, Zuxy Meng wrote: > > >Intel's optimization reference manual says that: > > > > I wasn't going off the documentation... I'd be more interested in

gcc-4.1-20070409 is now available

2007-04-09 Thread gccadmin
Snapshot gcc-4.1-20070409 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.1-20070409/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.1 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches

Re: Integer overflow in operator new

2007-04-09 Thread Gabriel Dos Reis
"Lawrence Crowl" <[EMAIL PROTECTED]> writes: [...] | Intel has had several popular processors with segmented addresses | including the 8086, 80186, and 80286. (Actually, the 80386 and | successors are segmented, but the operating systems typically hide | that fact.) The also had the i432. | |

Re: Generating RTL for function call sequences from GIMPLE

2007-04-09 Thread Richard Henderson
On Mon, Apr 09, 2007 at 07:37:31PM +0100, Dave Korn wrote: > Should promotion of function arguments be explicitly represented in GIMPLE, > or should it be performed when generating the corresponding RTL? There are two things here: (1) Promotion of arguments to their devlared types, should

Re: Integer overflow in operator new. Solved? Experimental i686 code.

2007-04-09 Thread J.C. Pizarro
#include // by J.C. Pîzarro ... // See http://www.cs.sjsu.edu/~kirchher/CS047/multDiv.html // One-operand imul: & Unsigned mul: // warning: 32 bit, i686, possible risk of -x * -y = valid x * y, ... // warning: it's made quick & dirty, possible to give clobbered situations. // warning:

RE: Information regarding -fPIC support for Interix gcc

2007-04-09 Thread Mayank Kumar
Hi Ian/All That information was really very helpful. I have been able to localize the bug. The issue is in the assembler. When I create a object file using the assembler(as test.s -o test.o), the contents of .rdata which contains the jump table is all wrong. The assembly file:- .section

Re: Integer overflow in operator new

2007-04-09 Thread Joe Buck
On Mon, Apr 09, 2007 at 01:49:09PM -0700, Lawrence Crowl wrote: > On 4/9/07, J.C. Pizarro <[EMAIL PROTECTED]> wrote: > >We've working in linear address spaces. > >How for segmented address spaces? You give me examples. > > Intel has had several popular processors with segmented addresses > includi

Re: Integer overflow in operator new

2007-04-09 Thread Lawrence Crowl
On 4/9/07, J.C. Pizarro <[EMAIL PROTECTED]> wrote: 2007/4/9, Lawrence Crowl <[EMAIL PROTECTED]>: > On 4/7/07, Joe Buck <[EMAIL PROTECTED]> wrote: > > Consider an implementation that, when given > > > > Foo* array_of_foo = new Foo[n_elements]; > > > > passes __compute_size(elements, sizeo

Re: Integer overflow in operator new. Solved?

2007-04-09 Thread Andrew Pinski
On 4/9/07, J.C. Pizarro <[EMAIL PROTECTED]> wrote: Of course, i'm a novice because i like and i don't like the GCC development's model. Of course the user manual explains all what I have mentioned in my previous email so it sounds like you like 95% of the other people who don't read the manual

Re: Possible bug in preprocessor

2007-04-09 Thread Jim Wilson
JoseD wrote: @James What do you mean by 16.3.3/3? GCC's version ? This is a reference to the ISO C standard. Still don't see what the problem whith 2 tokens is... The problem is the fact that they are 2 tokens. You can do a ## b to create ab, but you can not do a ## ( to create a( becaus

Re: Integer overflow in operator new. Solved?

2007-04-09 Thread Mike Stump
On Apr 9, 2007, at 12:14 PM, J.C. Pizarro wrote: How many code's species are they? One for every problem... 7. Code for IPA??? <- i don't know this weird language. Is it with attributes?. 8. Code for GIMPLE??? <- i don't know this weird language. 9. Code for RTL??? <- i don't know this weir

Re: DWARF Formats - GCC 4.1.1

2007-04-09 Thread Jim Wilson
Rohit Arul Raj wrote: Can any one suggest a right place to find the differences between the DWARF formats in gcc compiler versions 3.4.6 and 4.1.1? They both follow the standard, so there is no major change here. There are of course changes in the details. To find the details, you could com

Re: -Wextra and enumerator/non-enumerator in conditional expressions

2007-04-09 Thread Jim Wilson
Ching, Jimen (US SSA) wrote: According to the manual, I should be getting a warning, but I don't. Did I misunderstand the manual? A conditional expression, as per the ISO C/C++ standards, is an expression of the form (A ? B : C). There is no conditional expression in your testcase. Also, i

Re: Integer overflow in operator new. Solved?

2007-04-09 Thread J.C. Pizarro
2007/4/9, J.C. Pizarro <[EMAIL PROTECTED]> wrote: 2007/4/9, Andrew Pinski <[EMAIL PROTECTED]> wrote: > On 4/9/07, J.C. Pizarro <[EMAIL PROTECTED]> wrote: > Well lets say this, we already support this to some extend, by using > __builtin_constant_p and then just inlining. Also there exists > alre

Re: x86 inc/dec on core2

2007-04-09 Thread Vladimir N. Makarov
Zuxy Meng wrote: "Mike Stump" <[EMAIL PROTECTED]> ??:[EMAIL PROTECTED] On Apr 8, 2007, at 2:37 AM, Uros Bizjak wrote: My docs say that "INC/DEC does not change the carry flag". Personally, I'm having a hard time envisioning how the semantics of the instruction are relevant

Re: Integer overflow in operator new

2007-04-09 Thread Tom Tromey
> "Ross" == Ross Ridge <[EMAIL PROTECTED]> writes: Ross> So long as whatever switch is used to enable this check isn't on by Ross> default and its effect on code size and speed is documented, I don't Ross> think it matters that much what those effects are. Anything that works Ross> should mak

Re: Integer overflow in operator new. Solved?

2007-04-09 Thread J.C. Pizarro
2007/4/9, Andrew Pinski <[EMAIL PROTECTED]>: On 4/9/07, J.C. Pizarro <[EMAIL PROTECTED]> wrote: > 3. To modify the C-preprocessor and/or C/C++ compiler for: >#if argument X is a constant then > use this code specific of constant X >#else if argument Y is not a consta

Inclusion in an official release of a new throw-like qualifier

2007-04-09 Thread Sergio Giro
Hello, I started a thread about the possible development of a throw-like qualifier for C++ which may statically check that the only possible exceptions are those declared in the qualifier (please see the corresponding thread: http://gcc.gnu.org/ml/gcc/2007-03/msg01162.html

Re: Integer overflow in operator new

2007-04-09 Thread J.C. Pizarro
2007/4/9, Lawrence Crowl <[EMAIL PROTECTED]>: On 4/7/07, Joe Buck <[EMAIL PROTECTED]> wrote: > Consider an implementation that, when given > > Foo* array_of_foo = new Foo[n_elements]; > > passes __compute_size(elements, sizeof Foo) instead of > n_elements*sizeof Foo to operator new, wher

Re: Integer overflow in operator new. Solved?

2007-04-09 Thread Andrew Pinski
On 4/9/07, J.C. Pizarro <[EMAIL PROTECTED]> wrote: 3. To modify the C-preprocessor and/or C/C++ compiler for: #if argument X is a constant then use this code specific of constant X #else if argument Y is not a constant then use this code specific of non-c

Re: Integer overflow in operator new

2007-04-09 Thread Lawrence Crowl
On 4/7/07, Joe Buck <[EMAIL PROTECTED]> wrote: Consider an implementation that, when given Foo* array_of_foo = new Foo[n_elements]; passes __compute_size(elements, sizeof Foo) instead of n_elements*sizeof Foo to operator new, where __compute_size is inline size_t __compute_size(size_t

Re: Generating RTL for function call sequences from GIMPLE

2007-04-09 Thread Richard Guenther
On 4/9/07, Dave Korn <[EMAIL PROTECTED]> wrote: Evening all, just a quick question: [ ref: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31513, " [4.2/4.3 Regression] Miscompilation of Function Passing Bit Field Value to Function" ] Should promotion of function arguments be explicitly re

Re: Integer overflow in operator new. Solved?

2007-04-09 Thread Ian Lance Taylor
"J.C. Pizarro" <[EMAIL PROTECTED]> writes: > To optimize even more the x86, it still has to use: > 1. Use imul instead of mul because it's little bit faster in cycles. > 2. Use jns/js (sign's conditional jump) instead of jnc/jc (carry's > conditional jump). > 3. To modify the C-preprocessor and/or

Generating RTL for function call sequences from GIMPLE

2007-04-09 Thread Dave Korn
Evening all, just a quick question: [ ref: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31513, " [4.2/4.3 Regression] Miscompilation of Function Passing Bit Field Value to Function" ] Should promotion of function arguments be explicitly represented in GIMPLE, or should it be performed whe

Re: Integer overflow in operator new. Solved?

2007-04-09 Thread J.C. Pizarro
4. Conditional moves (cmov).

Re: Integer overflow in operator new. Solved?

2007-04-09 Thread J.C. Pizarro
2007/4/9, Joe Buck <[EMAIL PROTECTED]>: On Mon, Apr 09, 2007 at 09:47:07AM -0700, Andrew Pinski wrote: > On 4/9/07, J.C. Pizarro <[EMAIL PROTECTED]> wrote: > >#include > > > >void *__allocate_array_OptionA(size_t num, size_t size) { // 1st best > > unsigned long long tmp = (unsigned long long)

Re: static symbol occurs twice in the executable.

2007-04-09 Thread Mike Stump
On Apr 9, 2007, at 6:49 AM, Chris Dams wrote: I am not sure whether the problem I am going to describe is a problem with gcc or with the dynamic linker on Mac OS X, but maybe someone here knows a way to deal with it or could suggest a more appropriate mailing list. I use gcc 3.3 on Darwin 7

Re: x86 inc/dec on core2

2007-04-09 Thread H. J. Lu
On Mon, Apr 09, 2007 at 10:51:22AM -0700, Mike Stump wrote: > On Apr 8, 2007, at 8:51 PM, Zuxy Meng wrote: > >Intel's optimization reference manual says that: > > I wasn't going off the documentation... I'd be more interested in > either benchmarks or in recommendations by Intel people that kno

Re: x86 inc/dec on core2

2007-04-09 Thread Mike Stump
On Apr 8, 2007, at 8:51 PM, Zuxy Meng wrote: Intel's optimization reference manual says that: I wasn't going off the documentation... I'd be more interested in either benchmarks or in recommendations by Intel people that know the details of the core2 and the performance impact of those det

Re: Integer overflow in operator new. Solved?

2007-04-09 Thread Joe Buck
On Mon, Apr 09, 2007 at 09:47:07AM -0700, Andrew Pinski wrote: > On 4/9/07, J.C. Pizarro <[EMAIL PROTECTED]> wrote: > >#include > > > >void *__allocate_array_OptionA(size_t num, size_t size) { // 1st best > > unsigned long long tmp = (unsigned long long)size * num; > > if (tmp >= 0x800

Re: Integer overflow in operator new. Solved?

2007-04-09 Thread Andrew Pinski
On 4/9/07, J.C. Pizarro <[EMAIL PROTECTED]> wrote: #include void *__allocate_array_OptionA(size_t num, size_t size) { // 1st best unsigned long long tmp = (unsigned long long)size * num; if (tmp >= 0x8000ULL) tmp=~size_t(0); return operator new[](tmp); } First this just h

Re: Integer overflow in operator new. Solved?

2007-04-09 Thread J.C. Pizarro
#include void *__allocate_array_OptionA(size_t num, size_t size) { // 1st best unsigned long long tmp = (unsigned long long)size * num; if (tmp >= 0x8000ULL) tmp=~size_t(0); return operator new[](tmp); } void *__allocate_array_OptionB(size_t num, size_t size) { // 2nd best u

Re: Integer overflow in operator new

2007-04-09 Thread Joe Buck
On Tue, Apr 10, 2007 at 03:44:26AM +1200, Ross Smith wrote: > On Monday, 9 April 2007 13:09, J.C. Pizarro wrote: > > > > This code is bigger than Joe Buck's. > > > > Joe Buck's code: 10 instructions > > Ross Ridge's code: 16 instructions > > Ross Smith's code: 16 instructions > > Well, yes, but it

Re: Integer overflow in operator new

2007-04-09 Thread J.C. Pizarro
2007/4/9, Ross Smith <[EMAIL PROTECTED]> wrote: On Monday, 9 April 2007 13:09, J.C. Pizarro wrote: > > This code is bigger than Joe Buck's. > > Joe Buck's code: 10 instructions > Ross Ridge's code: 16 instructions > Ross Smith's code: 16 instructions Well, yes, but it also doesn't have the bug J

Re: Integer overflow in operator new

2007-04-09 Thread Ross Smith
On Monday, 9 April 2007 13:09, J.C. Pizarro wrote: > > This code is bigger than Joe Buck's. > > Joe Buck's code: 10 instructions > Ross Ridge's code: 16 instructions > Ross Smith's code: 16 instructions Well, yes, but it also doesn't have the bug Joe's code had. That was sort of the whole point.

Re: Integer overflow in operator new

2007-04-09 Thread J.C. Pizarro
#include void *__allocate_array_of_RossRidge(size_t num, size_t size, size_t max_num) { if (num > max_num) size = ~size_t(0); else size *= num; return operator new[](size); } void *__allocate_array_of_JCPizarro(size_t num, size_t size, size_t max_num) { if (num > max_num) retur

static symbol occurs twice in the executable.

2007-04-09 Thread Chris Dams
Dear all, I am not sure whether the problem I am going to describe is a problem with gcc or with the dynamic linker on Mac OS X, but maybe someone here knows a way to deal with it or could suggest a more appropriate mailing list. I use gcc 3.3 on Darwin 7.9.0. On this platform the following happe

Re: Integer overflow in operator new

2007-04-09 Thread J.C. Pizarro
2007/4/9, Robert Dewar <[EMAIL PROTECTED]>: J.C. Pizarro wrote: > The multiply is signed. It is need more researching a little bit. So what, the low order 32 bits are unaffected. I think this is just confusion on your part! Yes, i accidently eliminated the lines containing the point '.' for

Re: Integer overflow in operator new

2007-04-09 Thread J.C. Pizarro
2007/4/9, J.C. Pizarro <[EMAIL PROTECTED]> wrote: _Z29__allocate_array_of_RossRidgejjj: [ gcc v3.4.6 : 9 instructions ] movl4(%esp), %edx cmpl12(%esp), %edx # comparing and ?? i lose me movl8(%esp), %eax orl $-1, %eax imull %edx, %e

Re: Integer overflow in operator new

2007-04-09 Thread J.C. Pizarro
allocate_array_april2007.tar.gz Description: GNU Zip compressed data

Re: Integer overflow in operator new

2007-04-09 Thread J.C. Pizarro
2007/4/9, Ross Ridge <[EMAIL PROTECTED]> wrote: Florian Weimer writes: >Yeah, but that division is fairly expensive if it can't be performed >at compile time. OTOH, if __compute_size is inlined in all places, >code size does increase somewhat. Well, I believe the assumption was that __compute_s

Re: Integer overflow in operator new

2007-04-09 Thread Ross Ridge
Florian Weimer writes: >Yeah, but that division is fairly expensive if it can't be performed >at compile time. OTOH, if __compute_size is inlined in all places, >code size does increase somewhat. Well, I believe the assumption was that __compute_size would be inlined. If you want to minimize code