Objects in c++ and objc

2006-11-28 Thread Come Lonfils
Hi, I need precise information about how GCC store the objects for c++ and objective-C. I'm trying to know what are the difference between both. I need a very precise description of both. Do you know where I can found this information (except in gccint), books or other? Maybe it's not the best

Re: Objects in c++ and objc

2006-11-28 Thread Paolo Bonzini
Come Lonfils wrote: Hi, I need precise information about how GCC store the objects for c++ and objective-C For C++, the source of information is the C++ ABI. See http://www.codesourcery.com/cxx-abi/ For Objective-C, I don't know and I suspect the answer is that the information is only in

Re: Objects in c++ and objc

2006-11-28 Thread Ian Lance Taylor
Come Lonfils <[EMAIL PROTECTED]> writes: > I need precise information about how GCC store the objects for c++ > and objective-C. I'm trying to know what are the difference between > both. I need a very precise description of both. Do you know where I > can found this information (except in gccint)

PPC440, GCC-4.1.1 supposes cr{2,3,4} saved but the hard real time kernel doesn't...

2006-11-28 Thread Etienne Lorrain
Hello, My problem is quite simple, the PPC has few conditions registers and some are assumed to be saved over function calls (in my test case NU_Sleep()), but the hard real time kernel do not save those (partial flags) registers. This behaviour is perfectly documented in gcc-4.1.1/gcc/config/rs6

Re: PPC440, GCC-4.1.1 supposes cr{2,3,4} saved but the hard real time kernel doesn't...

2006-11-28 Thread Ian Lance Taylor
Etienne Lorrain <[EMAIL PROTECTED]> writes: > My problem is quite simple, the PPC has few conditions registers and some are > assumed to be saved over function calls (in my test case NU_Sleep()), but the > hard real time kernel do not save those (partial flags) registers. > This behaviour is per

Re: Queries regarding calls to divmod assembly functions

2006-11-28 Thread Ian Lance Taylor
Daniel Towner <[EMAIL PROTECTED]> writes: > This email and any files transmitted with it are confidential and intended > solely for the use of the individuals to whom they are addressed. If you have > received this email in error please notify the sender and delete the message > from your syste

Re: Finding canonical names of systems

2006-11-28 Thread Ulf Magnusson
On 11/28/06, Mike Stump <[EMAIL PROTECTED]> wrote: [ first, this is the wrong list to ask such question, gcc-help is the right one ] On Nov 27, 2006, at 7:25 PM, Ulf Magnusson wrote: > How are you supposed to find the canonical name of a system (of > known type) in CPU-Vendor-OS form in the gene

Re : PPC440, GCC-4.1.1 supposes cr{2,3,4} saved but the hard real time kernel doesn't...

2006-11-28 Thread Etienne Lorrain
Thanks, Unfortunately that is not my source code... powerpc-eabi-gcc -Wall -W -O2 -g -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-schedule-insns -std=gnu99 -fcall-used-cr2 -fcall-used-cr3 -fcall-used-cr4 -Xassembler -mregnames ... *.c ../net/src/net_dbg.c:668: error: Attempt to

[PATCH] Canonical types (1/3)

2006-11-28 Thread Doug Gregor
This patch introduces canonical types into GCC, which allow us to compare two types very efficiently and results in an overall compile-time performance improvement. I have been seeing 3-5% improvements in compile time on the G++ and libstdc++ test suites, 5-10% on template-heavy (but realistic) co

[C++ PATCH] Canonical types (2/3)

2006-11-28 Thread Doug Gregor
This patch introduces canonical types into GCC; see the first part of this patch for a complete description. This is part two of three, containing changes to the C++ front end. Okay for mainline? Cheers, Doug Gregor Open Systems Lab @ Indiana University 2006-11-28 Douglas Gregor <[EMAIL P

[Objective-C PATCH] Canonical types (3/3)

2006-11-28 Thread Doug Gregor
This patch introduces canonical types into GCC. See the first part of this patch for a complete explanation. This is part three of three, containing changes to the Objective-C (and, thus, Objective-C++) front end. Okay for mainline? Cheers, Doug Gregor Open Systems Lab @ Indiana University

Re: [PATCH] Canonical types (1/3)

2006-11-28 Thread Eric Botcazou
> This patch introduces canonical types into GCC, which allow us to > compare two types very efficiently and results in an overall > compile-time performance improvement. Please avoid cross-posting, patches should go to gcc-patches@ only. -- Eric Botcazou

Re: Queries regarding calls to divmod assembly functions (sans disclaimer)

2006-11-28 Thread Ian Lance Taylor
Daniel Towner <[EMAIL PROTECTED]> writes: > Initially, I tried to do as the manual suggested, and omit any patterns > for div/mod, to force gcc to use divmod instead, and setup the divmod > optab to call a named assembly function. However, div would still call a > div library, instead of the di

Re: Re : PPC440, GCC-4.1.1 supposes cr{2,3,4} saved but the hard real time kernel doesn't...

2006-11-28 Thread Ian Lance Taylor
Etienne Lorrain <[EMAIL PROTECTED]> writes: > powerpc-eabi-gcc -Wall -W -O2 -g -fno-strict-aliasing -ffunction-sections > -fdata-sections -fno-schedule-insns -std=gnu99 -fcall-used-cr2 > -fcall-used-cr3 -fcall-used-cr4 -Xassembler -mregnames ... *.c > > ../net/src/net_dbg.c:668: error: Attempt

Re: [PATCH] Canonical types (1/3)

2006-11-28 Thread Steven Bosscher
On 11/28/06, Doug Gregor <[EMAIL PROTECTED]> wrote: * tree.h (TYPE_CANONICAL): New. (TYPE_STRUCTURAL_EQUALITY): New. (struct tree_type): Added structural_equality, unused_bits, canonical fields. If I understand your patches correctly, this stuff is only needed fo

Re: [PATCH] Canonical types (1/3)

2006-11-28 Thread Ian Lance Taylor
"Steven Bosscher" <[EMAIL PROTECTED]> writes: > On 11/28/06, Doug Gregor <[EMAIL PROTECTED]> wrote: > > * tree.h (TYPE_CANONICAL): New. > > (TYPE_STRUCTURAL_EQUALITY): New. > > (struct tree_type): Added structural_equality, unused_bits, > > canonical fields. > > If

Re: Finding canonical names of systems

2006-11-28 Thread Joe Buck
On Mon, Nov 27, 2006 at 11:03:20PM -0800, Mike Stump wrote: > [ first, this is the wrong list to ask such question, gcc-help is the > right one ] I disagree in this case. > On Nov 27, 2006, at 7:25 PM, Ulf Magnusson wrote: > >How are you supposed to find the canonical name of a system (of > >

The Linux binutils 2.17.50.0.7 is released

2006-11-28 Thread H. J. Lu
This is the beta release of binutils 2.17.50.0.7 for Linux, which is based on binutils 2006 1020 in CVS on sourceware.org plus various changes. It is purely for Linux. Starting from the 2.17.50.0.7 release, the default output section LMA (load memory address) has changed for allocatable sections f

gcc-4.2-20061128 is now available

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

Re: Bug in multiple register reload inheritance?

2006-11-28 Thread Rask Ingemann Lambertsen
On Mon, Nov 27, 2006 at 02:21:36PM -0800, Ian Lance Taylor wrote: > Rask Ingemann Lambertsen <[EMAIL PROTECTED]> writes: > > >If I take out the lines 5643 and 5644 > > > > if (regno < FIRST_PSEUDO_REGISTER) > > regno = subreg_regno (rld[r].in_reg); > > >

Build problem on hpxw 4300 running fc6 x86_64

2006-11-28 Thread George R Goffe
Howdy, I'm trying to build the latest svn version of gcc on my hp xw 4300 system running fedora core 6 and am seeing a problem with mpfr. I got the latest mpfr and applied their patch before attempting this build. I have a complete build log available if anyone wants to see it. The question is

Re: [Objective-C PATCH] Canonical types (3/3)

2006-11-28 Thread Mike Stump
On Nov 28, 2006, at 7:56 AM, Doug Gregor wrote: This is part three of three, containing changes to the Objective-C (and, thus, Objective-C++) front end. Okay for mainline? Ok, if the base patch goes in, thanks.

why gengtype not a filter for GTY?

2006-11-28 Thread Basile STARYNKEVITCH
Dear All (and especially those implied in the GCC internal garbage collector). I read (and contributed a bit to) http://gcc.gnu.org/wiki/Memory_management and also read http://gcc.gnu.org/onlinedocs/gccint/Type-Information.html However, there is still a question which puzzles me a lot? Why gengt

Re: why gengtype not a filter for GTY?

2006-11-28 Thread Daniel Berlin
On 11/28/06, Basile STARYNKEVITCH <[EMAIL PROTECTED]> wrote: Dear All (and especially those implied in the GCC internal garbage collector). I read (and contributed a bit to) http://gcc.gnu.org/wiki/Memory_management and also read http://gcc.gnu.org/onlinedocs/gccint/Type-Information.html Howev

Re: why gengtype not a filter for GTY?

2006-11-28 Thread Laurynas Biveinis
However, there is still a question which puzzles me a lot? Why gengtype is not a sort of filter or generator (like yacc is) taking a (list of) files on input and producing a file on output? This question puzzles me too. Would be nice to have something in Makefile machinery that would grep source

Re: Finding canonical names of systems

2006-11-28 Thread Michael Eager
Ulf Magnusson wrote: How are you supposed to find the canonical name of a system (of known type) in CPU-Vendor-OS form in the general case? If you have access to a system of that particular type, you can run config.guess to find out, but you might not have, and that approach won't work for many s

strict aliasing benefit examples

2006-11-28 Thread Albert Cahalan
I often need to convince people that gcc is not just defective for doing random nonsense to code which violates the C and C++ aliasing rules. Not that I'm real sure myself actually, given that gcc is able to generate warnings for all the normal cases, but anyway... I'm up against the idea that Vis

Aliasing: reliable code or not?

2006-11-28 Thread Albert Cahalan
I have code that goes something like this: char *foo(char *buf){ *buf++ = 42; *((short*)buf) = 0xfeed; buf += 2; *((int*)buf) = 0x12345678; buf += 4; *((int*)buf) = 0x12345678; buf += 4; return buf; } The buffer is really of type char. The above comes from a pile of macro

Re: strict aliasing benefit examples

2006-11-28 Thread Andrew Pinski
> I often need to convince people that gcc is not just > defective for doing random nonsense to code which > violates the C and C++ aliasing rules. Not that I'm > real sure myself actually, given that gcc is able to > generate warnings for all the normal cases, but anyway... > I'm up against the id

Re: Aliasing: reliable code or not?

2006-11-28 Thread Andrew Pinski
> > I have code that goes something like this: > > char *foo(char *buf){ > *buf++ = 42; > *((short*)buf) = 0xfeed; > buf += 2; > *((int*)buf) = 0x12345678; > buf += 4; > *((int*)buf) = 0x12345678; > buf += 4; > return buf; > } This does violate C aliasing rules.

Re: strict aliasing benefit examples

2006-11-28 Thread Richard Kenner
> The best examples would involve optimizations which > could not be performed if gcc did what people normally > expect from a simple pointer cast and wrong-type access. > I doubt such examples exist, but I hope they do. Simple examples exist and I see that later in this thread you were sent one o

Re: strict aliasing benefit examples

2006-11-28 Thread Albert Cahalan
On 11/28/06, Andrew Pinski <[EMAIL PROTECTED]> wrote: > I often need to convince people that gcc is not just > defective for doing random nonsense to code which > violates the C and C++ aliasing rules. Not that I'm > real sure myself actually, given that gcc is able to > generate warnings for all

Re: strict aliasing benefit examples

2006-11-28 Thread Richard Kenner
> It doesn't help that the standards are only available for $$$ or > as contraband. It's an unfortunate cultural issue that C programmers traditionally don't use the standard on a regular basis. There are other languages where a programmer would never think of writing code without a language re

Re: strict aliasing benefit examples

2006-11-28 Thread Andrew Pinski
> > On 11/28/06, Andrew Pinski <[EMAIL PROTECTED]> wrote: > > > I often need to convince people that gcc is not just > > > defective for doing random nonsense to code which > > > violates the C and C++ aliasing rules. Not that I'm > > > real sure myself actually, given that gcc is able to > > > ge

Re: strict aliasing benefit examples

2006-11-28 Thread Richard Kenner
> base+offset really only helps in cases like: > > int t[100]; > int t2[100]; > t[20] =1; > t2[30] = 2; > if (t[20] != 1) > abort (); In the more general case, base plus offset helps in the Fortran style where everything is done with arrays (Ada is like this too in typical usage). So if you ha

Re: "insn outside basic block" in custom back end

2006-11-28 Thread Frank Riese
On Thursday 19 October 2006 23:10, Rask Ingemann Lambertsen wrote: >Also, looking at the insns added during the vregs pass, notice that some > of them use HImode registers. Have you forgotten to change something from > HImode to QImode? Maybe your Pmode? For example, this sequence is clearly >

Re: strict aliasing benefit examples

2006-11-28 Thread Daniel Berlin
> I think there are 3 aliasing possibilities here: > 1. known to alias > 2. known to not alias > 3. may alias Actually there is only 2, it may alias or not. Actually, he's right (and both you and Richard are wrong). The standard taxonomy of classifications for two memory accesses is: Must-ali

error in 02g.gch

2006-11-28 Thread Bobby McNulty
I received the following error in libstdc++- v3 i686-pc-cygwin and trunk. /home/Owner/gcc/o/./gcc/xgcc -shared-libgcc -B/home/Owner/gcc/o/./gcc -n ostdinc++ -L/home/Owner/gcc/o/i686-pc-cygwin/libstdc++-v3/src -L/home/Owner/gcc/ o/i686-pc-cygwin/libstdc++-v3/src/.libs -B/usr/local/i686-pc-

Re: Aliasing: reliable code or not?

2006-11-28 Thread Ian Lance Taylor
Andrew Pinski <[EMAIL PROTECTED]> writes: > Here is how I would write it so you can get the best results: > > char *foo(char *buf) > { > short temp; > int temp1; > *buf++=42; > temp = 0xfeed; > memcpy(buf, &temp, sizeof(temp)); > buf+=sizeof(temp); > temp1 = 0x12345678; > memcpy(b

Re: strict aliasing benefit examples

2006-11-28 Thread Paolo Bonzini
int f(int *a, float *b) { *a = 1; *b = 2.0; return *a == 2; } Problem: people don't write code that way. (well I hope not) People declare a few local variables, load them with data via the pointers, do stuff with the local variables, then save back the results via the pointers. So that

Re: strict aliasing benefit examples

2006-11-28 Thread Paolo Bonzini
for(i = 0;i<*t;i++) *f += 1.0; This one is pretty realistic, especially if you consider C++ and inlining: struct s { int size; float *data; }; void f(struct s *d, struct s *s) { int i; for (i = 0; i < s->size; i++)