Re: Char array alignment for PowerPc changed

2007-01-16 Thread Andrew Pinski
> > Andrew Pinski wrote: > I have no idea how your reply is related to my question about the > change in alignment of char arrays between gcc-3.4 and gcc-4.1. It was not really a rely to that part of the question but rather the assertion in general that unaligned access was slower which is not tr

Re: Char array alignment for PowerPc changed

2007-01-16 Thread Michael Eager
Andrew Pinski wrote: On Tue, 2007-01-16 at 20:04 -0800, Michael Eager wrote: But unaligned char arrays make strcpy much slower. Actually it depends on the processor unless you are messed up by using -mstrict-align which is a huge hammer for most (if not all) PowerPC processors even though the

Re: Preventing warnings

2007-01-16 Thread Ian Lance Taylor
Richard Stallman <[EMAIL PROTECTED]> writes: > In Emacs we have a macro that tends to produce the warning > >comparison is always false due to limited range of data type > > when compiling for 64-bit machines. EMACS_INT is 64 bits > in that case. Here is the macro: > > #define FIXNUM_OVER

Re: Char array alignment for PowerPc changed

2007-01-16 Thread Andrew Pinski
On Tue, 2007-01-16 at 20:04 -0800, Michael Eager wrote: > But unaligned char arrays make strcpy much slower. Actually it depends on the processor unless you are messed up by using -mstrict-align which is a huge hammer for most (if not all) PowerPC processors even though the few cases which need an

Re: Preventing warnings

2007-01-16 Thread Brooks Moses
Richard Stallman wrote: If not, I think one ought to be implemented. I have a suggestion for what it could look like: #define FIXNUM_OVERFLOW_P(i) \ ((EMACS_INT)(int)(i) > MOST_POSITIVE_FIXNUM \ || (EMACS_INT)(int)(i) < MOST_NEGATIVE_FIXNUM) The casts to int could be interpreted as meanin

Char array alignment for PowerPc changed

2007-01-16 Thread Michael Eager
With powerpc-eabi-gcc, I noticed that there's been a small change between gcc-3.4 and gcc-4.1 in how automatic char arrays are allocated. In gcc-3.4, char arrays are aligned on word boundaries. In gcc-4.1, they are aligned on byte boundaries. For example: void foo() { char a[31]; char b[31]

Re: http://gcc.gnu.org/svnwrite.html points to non-existing source http://gcc.gnu.org/ml/gcc-SVN/

2007-01-16 Thread Ben Elliston
> I found out that page http://gcc.gnu.org/svnwrite.html points to > http://gcc.gnu.org/ml/gcc-SVN/ mailing list but it doesn't exist. It's > in section "Write access policies" above "Free for all" subsection. > It seems that correct list is http://gcc.gnu.org/ml/gcc-cvs/. Nicely spotted. I thin

http://gcc.gnu.org/svnwrite.html points to non-existing source http://gcc.gnu.org/ml/gcc-SVN/

2007-01-16 Thread Tomas Bily
Hi, I found out that page http://gcc.gnu.org/svnwrite.html points to http://gcc.gnu.org/ml/gcc-SVN/ mailing list but it doesn't exist. It's in section "Write access policies" above "Free for all" subsection. It seems that correct list is http://gcc.gnu.org/ml/gcc-cvs/. Tomas

Preventing warnings

2007-01-16 Thread Richard Stallman
In Emacs we have a macro that tends to produce the warning comparison is always false due to limited range of data type when compiling for 64-bit machines. EMACS_INT is 64 bits in that case. Here is the macro: #define FIXNUM_OVERFLOW_P(i) \ ((EMACS_INT)(i) > MOST_POSITIVE_FIXNUM \ || (

Re: meaning of typedef ...and something more

2007-01-16 Thread Ian Lance Taylor
"Laura Tardivo" <[EMAIL PROTECTED]> writes: > Hi, my question is about the meanig of qualifiers in combination with > typedefs. For example: > > typedef int function1(); > typedef int function2(); > ... > typedef function1 transition1; > typedef function2 transition2; > ... > int Def_Fun( volati

Re: Miscompilation of remainder expressions

2007-01-16 Thread Joe Buck
On Tue, Jan 16, 2007 at 06:55:45PM -0500, Andrew Pinski wrote: > > > > Vincent Lefevre <[EMAIL PROTECTED]> writes: > > > > | On 2007-01-16 13:41:16 -0800, Ian Lance Taylor wrote: > > | > To be clear, in my opinion, this should always be selected by an > > | > option, it should never be default be

Re: Miscompilation of remainder expressions

2007-01-16 Thread Gabriel Dos Reis
Andrew Pinski <[EMAIL PROTECTED]> writes: | > | > Vincent Lefevre <[EMAIL PROTECTED]> writes: | > | > | On 2007-01-16 13:41:16 -0800, Ian Lance Taylor wrote: | > | > To be clear, in my opinion, this should always be selected by an | > | > option, it should never be default behaviour for any targ

Re: meaning of typedef ...and something more

2007-01-16 Thread Joe Buck
On Tue, Jan 16, 2007 at 10:54:33PM -0300, Laura Tardivo wrote: > > Hi, my question is about the meanig of qualifiers in combination with > typedefs. For example: Laura, That is a C language question, and is not gcc-specific. The gcc list is for the compiler developers to communicate, and even

Re: Miscompilation of remainder expressions

2007-01-16 Thread Andrew Pinski
> > Vincent Lefevre <[EMAIL PROTECTED]> writes: > > | On 2007-01-16 13:41:16 -0800, Ian Lance Taylor wrote: > | > To be clear, in my opinion, this should always be selected by an > | > option, it should never be default behaviour for any target. > | > | I disagree. One should get correct results

Re: Miscompilation of remainder expressions

2007-01-16 Thread Gabriel Dos Reis
Vincent Lefevre <[EMAIL PROTECTED]> writes: | On 2007-01-16 13:41:16 -0800, Ian Lance Taylor wrote: | > To be clear, in my opinion, this should always be selected by an | > option, it should never be default behaviour for any target. | | I disagree. One should get correct results by default. Onc

Re: Miscompilation of remainder expressions

2007-01-16 Thread Vincent Lefevre
On 2007-01-16 13:41:16 -0800, Ian Lance Taylor wrote: > To be clear, in my opinion, this should always be selected by an > option, it should never be default behaviour for any target. I disagree. One should get correct results by default. -- Vincent Lefèvre <[EMAIL PROTECTED]> - Web:

Re: Miscompilation of remainder expressions

2007-01-16 Thread Vincent Lefevre
On 2007-01-16 21:27:42 +, Andrew Haley wrote: > Ian Lance Taylor writes: > > I suspect that the best fix, in the sense of generating the best > > code, would be to do this at the tree level. That will give loop > > and VRP optimizations the best chance to eliminate the test for -1. > > Doi

meaning of typedef ...and something more

2007-01-16 Thread Laura Tardivo
Hi, my question is about the meanig of qualifiers in combination with typedefs. For example: typedef int function1(); typedef int function2(); ... typedef function1 transition1; typedef function2 transition2; ... int Def_Fun( volatile transition1); int Def_Fun( volatile transition2 const); Spec

Re: Miscompilation of remainder expressions

2007-01-16 Thread Vincent Lefevre
On 2007-01-16 13:08:18 -0800, David Daney wrote: > The difference is that your program didn't get killed by SIGFPE, it > just gave incorrect results. An incorrect result is worse, but being killed by SIGFPE is still very bad. But I was mainly answering the claim "hard to believe this case appears

Re: Miscompilation of remainder expressions

2007-01-16 Thread Ian Lance Taylor
Gabriel Dos Reis <[EMAIL PROTECTED]> writes: > Ian, do you believe something along the line of > > # > I mean, could not we generate the following for "%": > # > > # > rem a b := > # > if abs(b) == 1 > # > return 0 > # > return a b > # > # On x86 processors tha

Re: Miscompilation of remainder expressions

2007-01-16 Thread Gabriel Dos Reis
Joe Buck <[EMAIL PROTECTED]> writes: | On Tue, Jan 16, 2007 at 11:05:20AM -0800, David Daney wrote: | > Roberto Bagnara wrote: | > > | > >Hmmm, it says nothing about the remainder. Can some Google guru | > >suggest how to prove or disprove the claim that what we are | > >talking about is wildly k

Re: Miscompilation of remainder expressions

2007-01-16 Thread Joe Buck
On Tue, Jan 16, 2007 at 01:31:06PM -0800, David Daney wrote: > Andrew Haley wrote: > >Ian Lance Taylor writes: > > > I suspect that the best fix, in the sense of generating the best > > > code, would be to do this at the tree level. That will give loop > > > and VRP optimizations the best chance t

Re: Miscompilation of remainder expressions

2007-01-16 Thread Ian Lance Taylor
David Daney <[EMAIL PROTECTED]> writes: > Andrew Haley wrote: > > Ian Lance Taylor writes: > > > Joe Buck <[EMAIL PROTECTED]> writes: > > > > > I suggest that those who think this is a severe problem are > > the > > > > ones who are highly motivated to work on a solution. An > > > > efficien

Re: Miscompilation of remainder expressions

2007-01-16 Thread David Daney
Andrew Haley wrote: Ian Lance Taylor writes: > Joe Buck <[EMAIL PROTECTED]> writes: > > > I suggest that those who think this is a severe problem are the > > ones who are highly motivated to work on a solution. An > > efficient solution could be tricky: you don't want to disrupt > > pipe

Re: Miscompilation of remainder expressions

2007-01-16 Thread Vincent Lefevre
On 2007-01-16 15:50:09 +, Andrew Haley wrote: > This is a disgreement about interpretation of the langauge in the > standard, which is: > > "The result of the / operator is the quotient from the division of the > first operand by the second; the result of the % operator is the > remainder. In

Re: Miscompilation of remainder expressions

2007-01-16 Thread Andrew Haley
Ian Lance Taylor writes: > Joe Buck <[EMAIL PROTECTED]> writes: > > > I suggest that those who think this is a severe problem are the > > ones who are highly motivated to work on a solution. An > > efficient solution could be tricky: you don't want to disrupt > > pipelines, or interfere wit

Re: Miscompilation of remainder expressions

2007-01-16 Thread Ian Lance Taylor
Joe Buck <[EMAIL PROTECTED]> writes: > I suggest that those who think this is a severe problem are the ones who > are highly motivated to work on a solution. An efficient solution could > be tricky: you don't want to disrupt pipelines, or interfere with > optimizations that rely on recognizing th

Re: Miscompilation of remainder expressions

2007-01-16 Thread David Daney
Vincent Lefevre wrote: On 2007-01-16 12:31:00 -0500, Robert Dewar wrote: Roberto Bagnara wrote: Reading the thread "Autoconf manual's coverage of signed integer overflow & portability" I was horrified to discover about GCC's miscompilation of the remainder expression that causes INT_MIN % -1

Re: Miscompilation of remainder expressions

2007-01-16 Thread Vincent Lefevre
On 2007-01-16 12:31:00 -0500, Robert Dewar wrote: > Roberto Bagnara wrote: > >Reading the thread "Autoconf manual's coverage of signed integer > >overflow & portability" I was horrified to discover about GCC's > >miscompilation of the remainder expression that causes INT_MIN % -1 > >to cause a SIGF

Re: relevant files for target backends

2007-01-16 Thread Markus Franke
Thank you very much. That was exactly the information I was looking for. I will think about a contribution to the GCC Internals. Thanks again, Markus Franke Rask Ingemann Lambertsen wrote: > On Tue, Jan 16, 2007 at 11:24:56AM +0100, Markus Franke wrote: > > >>I am wondering where to define the

Re: Miscompilation of remainder expressions

2007-01-16 Thread Robert Dewar
Andrew Haley wrote: Roberto Bagnara writes: > Robert Dewar wrote: > > > Yes, it's a bug, is it a serious bug, no? Will real software > > be affected? no. Indeed I find any program that actually > > does this remainder operation in practice to be highly > > suspect. > > But I am not wro

Re: Miscompilation of remainder expressions

2007-01-16 Thread Joe Buck
On Tue, Jan 16, 2007 at 11:05:20AM -0800, David Daney wrote: > Roberto Bagnara wrote: > > > >Hmmm, it says nothing about the remainder. Can some Google guru > >suggest how to prove or disprove the claim that what we are > >talking about is wildly known? > > > > The point really is not how widely/

Re: Miscompilation of remainder expressions

2007-01-16 Thread Andrew Haley
Roberto Bagnara writes: > Robert Dewar wrote: > > > Yes, it's a bug, is it a serious bug, no? Will real software > > be affected? no. Indeed I find any program that actually > > does this remainder operation in practice to be highly > > suspect. > > But I am not wrong if I say that a bug

Re: Miscompilation of remainder expressions

2007-01-16 Thread David Daney
Roberto Bagnara wrote: Hmmm, it says nothing about the remainder. Can some Google guru suggest how to prove or disprove the claim that what we are talking about is wildly known? The point really is not how widely/wildly known the issue is. Really the thing we consider on gcc@ is: What is

Re: relevant files for target backends

2007-01-16 Thread Rask Ingemann Lambertsen
On Tue, Jan 16, 2007 at 11:24:56AM +0100, Markus Franke wrote: > I am wondering where to define the prototypes for functions in > .c Shall the prototypes be defined in -protos.h or in > .h or in .c. As far as I understand the prototypes > should be defined in -protos.h, right? But if I do so sever

Reduce size of indirect-dispatch executables

2007-01-16 Thread Andrew Haley
I noticed that we were repeatedly reloading from memory this.class and this.class.constants. It makes far more sense to read these values at the start of a method, and that is what this patch does. It reduces the text size of 32-bit indirect-dispatch executables by 1.4% and 64-bit by 1.3%. We ne

Re: Miscompilation of remainder expressions

2007-01-16 Thread Robert Dewar
Roberto Bagnara wrote: You are right: I am not familiar with DO-178B certification. Fair enough, but it means you should never use avionics code as an example in such discussions. No life has ever been lost due to a software bug in the realm of commercial aviation, and that was not achieved by

Re: Miscompilation of remainder expressions

2007-01-16 Thread Roberto Bagnara
David Daney wrote: Roberto Bagnara wrote: Robert Dewar wrote: Roberto Bagnara wrote: Reading the thread "Autoconf manual's coverage of signed integer overflow & portability" I was horrified to discover about GCC's miscompilation of the remainder expression that causes INT_MIN % -1 to cause a

Re: Miscompilation of remainder expressions

2007-01-16 Thread Gabriel Dos Reis
On Tue, 16 Jan 2007, Joe Buck wrote: | On Tue, Jan 16, 2007 at 12:05:12PM -0600, Gabriel Dos Reis wrote: | > By definition, the absolute value of "a % b" is always less than the | > absolute value of b. Consequently, "a % b" is always defined. | | Nitpick: for nonzero b. yes, I assumed that -- s

Re: Miscompilation of remainder expressions

2007-01-16 Thread Joe Buck
On Tue, Jan 16, 2007 at 12:05:12PM -0600, Gabriel Dos Reis wrote: > By definition, the absolute value of "a % b" is always less than the > absolute value of b. Consequently, "a % b" is always defined. Nitpick: for nonzero b.

RE: Miscompilation of remainder expressions

2007-01-16 Thread Dave Korn
On 16 January 2007 18:42, Robert Dewar wrote: > Dave Korn wrote: >> On 16 January 2007 18:23, Robert Dewar wrote: >> >>> Gabriel Paubert wrote: >>> \ No, because the instruction has actually two result values: - the remainder, which you could safely set to zero (not 1!)

Re: Miscompilation of remainder expressions

2007-01-16 Thread Robert Dewar
Roberto Bagnara wrote: I am sorry if I brought you to think that I am asking something for me. There is no longer a problem for me personally: I will simply stop using % in my projects (which, by the way are in C++) and will use custom functions instead. I have almost finished an Autoconf test

Re: Miscompilation of remainder expressions

2007-01-16 Thread Robert Dewar
Dave Korn wrote: On 16 January 2007 18:23, Robert Dewar wrote: Gabriel Paubert wrote: \ No, because the instruction has actually two result values: - the remainder, which you could safely set to zero (not 1!) - the quotient, which is affected by the overflow and there may be compiler and l

Re: Miscompilation of remainder expressions

2007-01-16 Thread Roberto Bagnara
Robert Dewar wrote: Roberto Bagnara wrote: Andrew Haley wrote: Roberto Bagnara writes: > > Reading the thread "Autoconf manual's coverage of signed integer > overflow & portability" I was horrified to discover about GCC's > miscompilation of the remainder expression that causes INT_MIN % -1

Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."

2007-01-16 Thread Thorsten Glaser
Paul Eggert dixit: > […] gcc -O2 makes no promises without > -fwrapv. gcc -O1 -fwrapv even doesn't work correctly for gcc3, and gcc2 and gcc <3.3(?) don't even have -fwrapv: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30477 bye, //mirabile -- "Using Lynx is like wearing a really good pair o

RE: Miscompilation of remainder expressions

2007-01-16 Thread Dave Korn
On 16 January 2007 18:23, Robert Dewar wrote: > Gabriel Paubert wrote: > \ >> No, because the instruction has actually two result values: >> >> - the remainder, which you could safely set to zero (not 1!) >> >> - the quotient, which is affected by the overflow and there may be >> compiler and

Re: Miscompilation of remainder expressions

2007-01-16 Thread Robert Dewar
David Daney wrote: Roberto Bagnara wrote: Everyone knows that dividing a number by -1 or 1 gives a 0 remainder. To the contrary, no one expects a%b to raise SIFPE when b != 0. On the contrary, since the beginning of time SIGFPE has been generated on GCC/x86/linux under these conditions. T

Re: Miscompilation of remainder expressions

2007-01-16 Thread Robert Dewar
Gabriel Paubert wrote: \ No, because the instruction has actually two result values: - the remainder, which you could safely set to zero (not 1!) - the quotient, which is affected by the overflow and there may be compiler and languages that rely on the exception being generated. But the div

Re: Miscompilation of remainder expressions

2007-01-16 Thread Roberto Bagnara
Robert Dewar wrote: Roberto Bagnara wrote: Reading the thread "Autoconf manual's coverage of signed integer overflow & portability" I was horrified to discover about GCC's miscompilation of the remainder expression that causes INT_MIN % -1 to cause a SIGFPE on CPUs of the i386 family. Are there

Re: Miscompilation of remainder expressions

2007-01-16 Thread David Daney
Roberto Bagnara wrote: Robert Dewar wrote: Roberto Bagnara wrote: Reading the thread "Autoconf manual's coverage of signed integer overflow & portability" I was horrified to discover about GCC's miscompilation of the remainder expression that causes INT_MIN % -1 to cause a SIGFPE on CPUs of t

Re: Miscompilation of remainder expressions

2007-01-16 Thread Gabriel Dos Reis
Duncan Sands <[EMAIL PROTECTED]> writes: [...] | Ada semantics require INT_MIN rem -1 to be zero. I cannot see any other value as a result. -- Gaby

Re: Miscompilation of remainder expressions

2007-01-16 Thread Gabriel Dos Reis
Andrew Haley <[EMAIL PROTECTED]> writes: | Roberto Bagnara writes: | > Andrew Haley wrote: | > > Roberto Bagnara writes: | > > > | > > > Reading the thread "Autoconf manual's coverage of signed integer | > > > overflow & portability" I was horrified to discover about GCC's | > > > misco

Re: Miscompilation of remainder expressions

2007-01-16 Thread Roberto Bagnara
Robert Dewar wrote: Roberto Bagnara wrote: Reading the thread "Autoconf manual's coverage of signed integer overflow & portability" I was horrified to discover about GCC's miscompilation of the remainder expression that causes INT_MIN % -1 to cause a SIGFPE on CPUs of the i386 family. Are there

Re: Miscompilation of remainder expressions

2007-01-16 Thread Joe Buck
On Tue, Jan 16, 2007 at 08:22:10AM -0600, Gabriel Dos Reis wrote: > I mean, could not we generate the following for "%": > > rem a b := > if abs(b) == 1 > return 0 > return a b On x86 processors that have conditional moves, why not do the equivalent of neg_b =

Re: Miscompilation of remainder expressions

2007-01-16 Thread Robert Dewar
Roberto Bagnara wrote: To the point that, when a/b is not representable, raising SIGFPE for a%b is standard conformant behavior? possibly so .. Note however that I am not saying that the standard is not defective. Who knows how to write and submit C/C++ standard defect reports? Let us do tha

Re: Miscompilation of remainder expressions

2007-01-16 Thread Robert Dewar
Roberto Bagnara wrote: Andrew Haley wrote: Roberto Bagnara writes: > > Reading the thread "Autoconf manual's coverage of signed integer > overflow & portability" I was horrified to discover about GCC's > miscompilation of the remainder expression that causes INT_MIN % -1 > to cause a SIGF

Re: Miscompilation of remainder expressions

2007-01-16 Thread David Daney
Robert Dewar wrote: Roberto Bagnara wrote: Reading the thread "Autoconf manual's coverage of signed integer overflow & portability" I was horrified to discover about GCC's miscompilation of the remainder expression that causes INT_MIN % -1 to cause a SIGFPE on CPUs of the i386 family. Are ther

Re: Miscompilation of remainder expressions

2007-01-16 Thread Robert Dewar
Roberto Bagnara wrote: Reading the thread "Autoconf manual's coverage of signed integer overflow & portability" I was horrified to discover about GCC's miscompilation of the remainder expression that causes INT_MIN % -1 to cause a SIGFPE on CPUs of the i386 family. Are there plans to fix this bu

Re: Miscompilation of remainder expressions

2007-01-16 Thread Robert Dewar
Roberto Bagnara wrote: Reading the thread "Autoconf manual's coverage of signed integer overflow & portability" I was horrified to discover about GCC's miscompilation of the remainder expression that causes INT_MIN % -1 to cause a SIGFPE on CPUs of the i386 family. Are there plans to fix this bu

Re: Miscompilation of remainder expressions

2007-01-16 Thread Robert Dewar
It's interesting that the same issue arose with GNAT, but we had no option to ignore the special case, since one of the official Ada validation test programs tested this case, and indeed as you see below there is a special test: function q (a, b : integer) return integer is begin return a rem

Re: Miscompilation of remainder expressions

2007-01-16 Thread Manuel López-Ibáñez
On 16/01/07, Duncan Sands <[EMAIL PROTECTED]> wrote: On Tuesday 16 January 2007 16:50, Andrew Haley wrote: > Roberto Bagnara writes: > > Andrew Haley wrote: > > > Roberto Bagnara writes: > > > > > > > > Reading the thread "Autoconf manual's coverage of signed integer > > > > overflow & po

Re: Miscompilation of remainder expressions

2007-01-16 Thread Andrew Haley
Roberto Bagnara writes: > Andrew Haley wrote: > > > > If the quotient a/b is *not* representable, is the behaviour of % > > well-defined or not? It doesn't say. > > To the point that, when a/b is not representable, raising SIGFPE > for a%b is standard conformant behavior? > Note however

Re: Miscompilation of remainder expressions

2007-01-16 Thread Roberto Bagnara
Andrew Haley wrote: Roberto Bagnara writes: > Andrew Haley wrote: > > Roberto Bagnara writes: > > > > > > Reading the thread "Autoconf manual's coverage of signed integer > > > overflow & portability" I was horrified to discover about GCC's > > > miscompilation of the remainder expres

Re: Miscompilation of remainder expressions

2007-01-16 Thread Duncan Sands
On Tuesday 16 January 2007 16:50, Andrew Haley wrote: > Roberto Bagnara writes: > > Andrew Haley wrote: > > > Roberto Bagnara writes: > > > > > > > > Reading the thread "Autoconf manual's coverage of signed integer > > > > overflow & portability" I was horrified to discover about GCC's >

Re: 27% regression of gcc 4.3 performance on cpu2k6/calculix

2007-01-16 Thread Grigory Zagorodnev
Toon Moene wrote: Calculix is a combined C/Fortran program. Did you try to compile the Fortran parts with --param max-aliased-vops=default 50> ? Right, calculix is a combined program. Gprof says the regression is in e_c3d routine which is 1k lines of Fortran code. Various max-aliased-vops giv

Re: Miscompilation of remainder expressions

2007-01-16 Thread Andrew Haley
Roberto Bagnara writes: > Andrew Haley wrote: > > Roberto Bagnara writes: > > > > > > Reading the thread "Autoconf manual's coverage of signed integer > > > overflow & portability" I was horrified to discover about GCC's > > > miscompilation of the remainder expression that causes INT_MI

Re: Creating a variable declaration of custom type.

2007-01-16 Thread Ferad Zyulkyarov
I succeeded to do it as follows: tree type_decl = lookup_name(get_identifier("MyType")); tree type_ptr = build_pointer_type(TREE_TYPE(type_decl)); tree var_decl = build(VAR_DECL, get_identifier("t"), type_ptr); pushdecl(var_decl); It may not be a perfect solution but for now it works. On 1/16/0

Re: Miscompilation of remainder expressions

2007-01-16 Thread Roberto Bagnara
Andrew Haley wrote: Roberto Bagnara writes: > > Reading the thread "Autoconf manual's coverage of signed integer > overflow & portability" I was horrified to discover about GCC's > miscompilation of the remainder expression that causes INT_MIN % -1 > to cause a SIGFPE on CPUs of the i386 f

Re: GCC trunk failed to compile cpu2k6/dealII at x86_64

2007-01-16 Thread Grigory Zagorodnev
Grigory Zagorodnev wrote: GCC 4.3 revision 120799 fails to compile SPEC cpu2006/447.dealII benchmark at x86_64-redhat-linux on -O2 optimization level. Last revision know to be good is 120775. It appears that revision 120767 causes the failure http://gcc.gnu.org/viewcvs?view=rev&revision=12076

GCC trunk failed to compile cpu2k6/dealII at x86_64

2007-01-16 Thread Grigory Zagorodnev
Hi! GCC 4.3 revision 120799 fails to compile SPEC cpu2006/447.dealII benchmark at x86_64-redhat-linux on -O2 optimization level. Last revision know to be good is 120775. data_out_base.cc: In static member function 'static void DataOutBase::write_vtk(const std::vectordim>, std::allocator > >&,

Re: relevant files for target backends

2007-01-16 Thread Kaveh R. GHAZI
On Tue, 16 Jan 2007, Markus Franke wrote: > Thank you for your response. I understood everything you said but I am > still confused about the file -protos.h. Which prototypes have > to be defined there? Any external function you manully define in config/machine/machine.c probably should have a pr

Re: relevant files for target backends

2007-01-16 Thread pranav bhandarkar
On 1/16/07, Markus Franke <[EMAIL PROTECTED]> wrote: Thank you for your response. I understood everything you said but I am still confused about the file -protos.h. Which prototypes have to be defined there? Thanks in advance, Markus Franke IMO and from what I have gathered from the documentat

Re: Miscompilation of remainder expressions

2007-01-16 Thread Gabriel Dos Reis
Andrew Haley <[EMAIL PROTECTED]> writes: | Gabriel Dos Reis writes: | > Andrew Haley <[EMAIL PROTECTED]> writes: | > | > | Michael Veksler writes: | > | > Roberto Bagnara wrote: | > | > > | > | > > Reading the thread "Autoconf manual's coverage of signed integer | > | > > overflow & po

Re: Miscompilation of remainder expressions

2007-01-16 Thread Andrew Haley
Gabriel Dos Reis writes: > Andrew Haley <[EMAIL PROTECTED]> writes: > > | Michael Veksler writes: > | > Roberto Bagnara wrote: > | > > > | > > Reading the thread "Autoconf manual's coverage of signed integer > | > > overflow & portability" I was horrified to discover about GCC's > | >

Re: Miscompilation of remainder expressions

2007-01-16 Thread Gabriel Dos Reis
Andrew Haley <[EMAIL PROTECTED]> writes: | Michael Veksler writes: | > Roberto Bagnara wrote: | > > | > > Reading the thread "Autoconf manual's coverage of signed integer | > > overflow & portability" I was horrified to discover about GCC's | > > miscompilation of the remainder expression tha

Re: Miscompilation of remainder expressions

2007-01-16 Thread Andrew Haley
Michael Veksler writes: > Roberto Bagnara wrote: > > > > Reading the thread "Autoconf manual's coverage of signed integer > > overflow & portability" I was horrified to discover about GCC's > > miscompilation of the remainder expression that causes INT_MIN % -1 > > to cause a SIGFPE on CPUs o

Re: relevant files for target backends

2007-01-16 Thread Markus Franke
Thank you for your response. I understood everything you said but I am still confused about the file -protos.h. Which prototypes have to be defined there? Thanks in advance, Markus Franke pranav bhandarkar wrote: >> I am wondering where to define the prototypes for functions in >> .c Shall the pr

Re: Cheatsheet for building gcc

2007-01-16 Thread Paolo Bonzini
with the changes to the build system in the last few months, I am having problems to do some things I am used to do during development. I found more or less satisfactory procedures for most them, however, I would like to know the "official" way how to achieve those effects (and to put the creat

Re: Cheatsheet for building gcc

2007-01-16 Thread Paolo Bonzini
Richard Kenner wrote: Q2) How to bootstrap the compiler, but not build any time consuming libraries (libjava, libstdc++)? A2) "make stage{2,3,feedback}-bubble" Can you say what the differences between these three are? Which is the equivalent of the old "cd gcc; make bootstrap"? They wil

Re: Miscompilation of remainder expressions

2007-01-16 Thread Paolo Bonzini
cltq addl %edx, %eax xorl %eax, %edx But the register allocations constraints are pretty heavy considering that idivl already puts strain on the RA. Paolo, what does the cltq instruction do? I cannot find it in my x86 reference manuals... Uhm, I meant cltd and it is the same as "cdq" in th

Re: Cheatsheet for building gcc

2007-01-16 Thread Paolo Bonzini
if you configure with --enable-stage1-languages=all, 1) will all the libraries be built three times during bootstrap, or just once? Just once. Things that are built three times are only those that have "bootstrap=true" in the Makefile.def file. Paolo

Re: Cheatsheet for building gcc

2007-01-16 Thread Richard Kenner
> > Q2) How to bootstrap the compiler, but not build any time consuming > > libraries (libjava, libstdc++)? > > A2) "make stage{2,3,feedback}-bubble" Can you say what the differences between these three are? Which is the equivalent of the old "cd gcc; make bootstrap"? > > Q4) How to compile

Re: Miscompilation of remainder expressions

2007-01-16 Thread Lucas (a.k.a T-Bird or bsdfan3)
Paolo Bonzini wrote: Compared to the slow idivl, abs could be negligible, right. However, abs does introduce new data dependence which might add a noticeable cost. Is there an abs instruction in the i386 instruction set? No, the closest thing (input in eax, output in edx) is cltq add

Re: Creating a variable declaration of custom type.

2007-01-16 Thread Ferad Zyulkyarov
Hi, Best way to figure this out is to write a simple 5 line testcase that defines a structure type and also defines a pointer to that type, and then step through gcc to see what it does. Try putting breakpoints in finish_struct and build_pointer_type. I tried with the advised test case but ag

Re: Cheatsheet for building gcc

2007-01-16 Thread Zdenek Dvorak
Hello, > >Is there a way how to do it without reconfiguring gcc? > > No. Do you think it would be best to have --enable-stage1-languages=all > in non-release branches? The time taken to compile the stage1 > (nonoptimized) non-C front-ends is small, and the advantage seems > significant. if

Re: Miscompilation of remainder expressions

2007-01-16 Thread Paolo Bonzini
Compared to the slow idivl, abs could be negligible, right. However, abs does introduce new data dependence which might add a noticeable cost. Is there an abs instruction in the i386 instruction set? No, the closest thing (input in eax, output in edx) is cltq addl %edx, %eax xorl %eax, %e

Re: Cheatsheet for building gcc

2007-01-16 Thread Paolo Bonzini
Is there a way how to do it without reconfiguring gcc? No. Do you think it would be best to have --enable-stage1-languages=all in non-release branches? The time taken to compile the stage1 (nonoptimized) non-C front-ends is small, and the advantage seems significant. Q6) How to clean u

Re: relevant files for target backends

2007-01-16 Thread pranav bhandarkar
I am wondering where to define the prototypes for functions in .c Shall the prototypes be defined in -protos.h or in .h or in .c. As far as I understand the prototypes should be defined in -protos.h, right? But if I do so several errors/warnings arise because of undeclared prototypes. Another que

relevant files for target backends

2007-01-16 Thread Markus Franke
Dear GCC Developers/Users, I am trying to port a backend from GCC version 2.7.2.3 to version 4.1.1. As far as I have seen, a lot of new relevant files were introduced to build a good structure for new backends. I am wondering where to define the prototypes for functions in .c Shall the prototypes

Re: Cheatsheet for building gcc

2007-01-16 Thread Zdenek Dvorak
Hello, thanks a lot for the answers! > >Q4) How to compile all the libraries (libjava, ...) using the stage1 > >compiler? > > A4) Configure with --enable-stage1-languages=all Is there a way how to do it without reconfiguring gcc? This question aims at the following situation: I already hav

Re: Unsure about a new warning in mainline

2007-01-16 Thread Gabriel Dos Reis
On Tue, 16 Jan 2007, Manuel López-Ibáñez wrote: | So the warning turned out to be useful or still was it too noisy ? It is still noisy. The limit macro fixes does not magically turn off the signed -> unsigned noise -- it fixed a warning about overflow. I'll send a separate message for the signed

Re: Unsure about a new warning in mainline

2007-01-16 Thread Manuel López-Ibáñez
So the warning turned out to be useful or still was it too noisy ? Sorry, I am not perfectly following this discussion. Cheers, Manuel On 15 Jan 2007 19:16:23 -0800, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: Paolo Carlini <[EMAIL PROTECTED]> writes: > Therefore, I'd like to apply to mainlin

Re: Miscompilation of remainder expressions

2007-01-16 Thread Michael Veksler
Gabriel Paubert wrote: On Mon, Jan 15, 2007 at 10:34:23PM +0200, Michael Veksler wrote: Once the kernel sees the FP trap (whatever its i368 name is), it decodes the machine code and finds: idivl (%ecx). As far as I remember, this will put the result in two registers one for div_res and one f