Possible GCC 4.3 driver regression caused by your patch

2008-03-01 Thread Greg Schafer
Hi Carlos and Mark, Your "Relocated compiler should not look in $prefix" patch here: http://gcc.gnu.org/ml/gcc/2006-10/msg00280.html appears to have caused a regression in my GCC 4.3 testing. In summary, there is a small window *during the GCC build itself* where GCC does not pick up the correc

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
FX Coudert wrote: C: integer overflow undefined, checking desirable at least for debugging purposes. I think latest Fortran is same as C, can someone confirm? Yes, it is. Overflow undefined and no checking required; I think very few Fortran users actually use (or would use) checking on signe

Re: Excess registers pushed - regs_ever_live not right way?

2008-03-01 Thread Andrew Hutchinson
Sorry terminology is fighting language! by parameter - I mean argument registers - also a stray "use" may have crept in. Original problem : prolog is saving "live" registers that are not "call used" following normal gcc methods. But in AVR target this will include some argument registers - a

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread FX Coudert
C: integer overflow undefined, checking desirable at least for debugging purposes. I think latest Fortran is same as C, can someone confirm? Yes, it is. Overflow undefined and no checking required; I think very few Fortran users actually use (or would use) checking on signed overflow. FX

Re: Excess registers pushed - regs_ever_live not right way?

2008-03-01 Thread Seongbae Park (박성배, 朴成培)
2008/3/1 Andrew Hutchinson <[EMAIL PROTECTED]>: > I'm am still struggling with a good solution that avoids unneeded saves > of parameter registers. > > To solve problem all I need to know are the registers actually used for > parameters. Since the caller assumes all of these are clobbered by >

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Robert Dewar wrote: The reason that we distinguish overflow checking from other kinds of constraint checking is that a failure of an overflow check, unlike for example the failure of a range check, can result in an incorrect value, but cannot cause random memory destruction (like an out of range

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Florian Weimer wrote: * Robert Dewar: Standard ML. I don't think there is a GCC front end (and it's not likely that one will be feasible, at least until GCC supports a fitting garbage collector). Why is it a GCC issue to support a GC for ML, I don't get it ... ML programs are mostly functio

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Florian Weimer wrote: Are we talking about the Ada semantics or GNAT without -gnato? In the latter case, the documentation disagrees with you: The reason that we distinguish overflow checking from other kinds of range constraint checking is that a failure of an overflow check ca

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Florian Weimer
* Robert Dewar: >> Standard ML. I don't think there is a GCC front end (and it's not >> likely that one will be feasible, at least until GCC supports a fitting >> garbage collector). > > Why is it a GCC issue to support a GC for ML, I don't get it ... ML programs are mostly functional and alloca

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Florian Weimer
* Robert Dewar: > Florian Weimer wrote: >> * Robert Dewar: >> >>> So here's exactly what happens now in Ada >>> >>> 1. If -gnato is not set (no overflow checking) >>> >>> In this case, the situation is exactly the same as C, and the front end >>> ignores the possibility of overflow. >> >> It's C i

Re: PR35401 and PR30572 are gcc 4.3.0 release blockers on darwin

2008-03-01 Thread Jack Howarth
Mark, While I don't see any particular differences in how gcc 4.3 branch links its shared libraries with or without r131198 applied, I do notice that it causes the xgcc created to be linked against the system libgcc. Without r131198, only the xgcc in stage1-gcc is linked to the system libgcc. Wi

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Florian Weimer wrote: * Richard Kenner: int f(int a, int b) { return 0 * (a + b); } get the potentially trapping arithmetic folded away. If -ftrapv is to have properly defined semantics, those must include trapping if (a + b) overflows in the above code. Why? Is there any language that re

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Florian Weimer wrote: * Robert Dewar: So here's exactly what happens now in Ada 1. If -gnato is not set (no overflow checking) In this case, the situation is exactly the same as C, and the front end ignores the possibility of overflow. It's C in -fwrapv mode, isn't it? (Otherwise, you can'

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Florian Weimer
* Florian Weimer: > * Richard Kenner: > >>> int f(int a, int b) { return 0 * (a + b); } >>> >>> get the potentially trapping arithmetic folded away. If -ftrapv is to >>> have properly defined semantics, those must include trapping if (a + b) >>> overflows in the above code. >> >> Why? Is ther

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Florian Weimer
* Richard Kenner: >> int f(int a, int b) { return 0 * (a + b); } >> >> get the potentially trapping arithmetic folded away. If -ftrapv is to >> have properly defined semantics, those must include trapping if (a + b) >> overflows in the above code. > > Why? Is there any language that requires

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Florian Weimer
* Robert Dewar: > So here's exactly what happens now in Ada > > 1. If -gnato is not set (no overflow checking) > > In this case, the situation is exactly the same as C, and the front end > ignores the possibility of overflow. It's C in -fwrapv mode, isn't it? (Otherwise, you can't really get the

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Joseph S. Myers
On Sat, 1 Mar 2008, Richard Kenner wrote: > > int f(int a, int b) { return 0 * (a + b); } > > > > get the potentially trapping arithmetic folded away. If -ftrapv is to > > have properly defined semantics, those must include trapping if (a + b) > > overflows in the above code. > > Why? Is the

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Joseph S. Myers
On Sat, 1 Mar 2008, Richard Guenther wrote: > > But arbitrary arithmetic expressions aren't marked as potentially trapping > > / having side-effects with -ftrapv, so cases such as > > > > int f(int a, int b) { return 0 * (a + b); } > > > > get the potentially trapping arithmetic folded away. I

Re: Successfull build of gcc 4.2.3 with MinGW 5.13 in windows XP

2008-03-01 Thread dju
hello sorry after 2 more success with gcc build this night ,i have not succeeded to reproduce the error "Ada.Calendar is not a predefined library unit" the difficult with mingw, there are no dependance packages, only overwrite binaries manualy and flex,bison and deps libs are not natively presen

Bootstrap failure building libobjc fixed

2008-03-01 Thread Janne Blomqvist
Hello all, apologies for causing a bootstrap failure when building libobjc due to my patch for PR 35063 (r132800). As of r132802, I believe this issue is now fixed. Big thanks to Jerry DeLisle for helping out with the fix. -- Janne Blomqvist

Re: Excess registers pushed - regs_ever_live not right way?

2008-03-01 Thread Andrew Hutchinson
I'm am still struggling with a good solution that avoids unneeded saves of parameter registers. To solve problem all I need to know are the registers actually used for parameters. Since the caller assumes all of these are clobbered by callee - they should never need to be saved. DF_REG_DEF_COUNT

Re: new regression on 4.3.0 branch

2008-03-01 Thread DJ Delorie
> Can you pin-point the patch that caused this and investigate what is > going wrong? Sure. It was some time yesterday at least (that script runs every night), but I'll try to narrow it down further.

Re: new regression on 4.3.0 branch

2008-03-01 Thread Richard Guenther
On Sat, Mar 1, 2008 at 4:48 PM, DJ Delorie <[EMAIL PROTECTED]> wrote: > > Not a primary target, but still... > > Results for 4.3.0 20080301 (prerelease) [gcc-4_3-branch revision 132798] > (GCC) testsuite on m32c-unknown-elf > > --- Start of forwarded message --

new regression on 4.3.0 branch

2008-03-01 Thread DJ Delorie
Not a primary target, but still... Results for 4.3.0 20080301 (prerelease) [gcc-4_3-branch revision 132798] (GCC) testsuite on m32c-unknown-elf --- Start of forwarded message --- gcc result changes... Multilib: m32c-sim/-mcpu=m32c PASS-FAIL: gcc.c-torture/execute/980707-1.c execution

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Laurent GUERBY
On Sat, 2008-03-01 at 09:05 -0500, Robert Dewar wrote: > Note that in Ada, you can often avoid one or both ends of > the range check, e.g. > > type R is integer range 1 .. 10; > > RV : R; > > R := R + 1; > > no need for double length arithmetic here, you just check that the > re

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Joern Rennecke wrote: Considering the trouble that you get when you try to generate branches in a non-branch expander, we should probably have alternate named patterns to be used in ports to processors that have no conditional trap facility, or where a conditional trap is more expensive than a w

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Paolo Bonzini
I missed once point noticed by Joseph also, that the libgcc implementation uses signed types in the implementation of the trapping arithmetics. Where we of course optimize away the overflow check, so the libgcc routines will never trap. (if it does work in some cases then this would be a missed o

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Joern Rennecke
On Fri, 29 Feb 2008, Robert Dewar wrote: Well presumably one would want to use target dependent stuff for detecting overflow where it exists (sticky overflow bits on power, O flag on PC, trapping add on MIPS etc). In fact, when I wrote the original -ftrapv code, it was for the sole purpose of u

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Paolo Bonzini
Well presumably one would want to use target dependent stuff for detecting overflow where it exists (sticky overflow bits on power, O flag on PC, trapping add on MIPS etc). On the whole I think you'd want to benefit from tree-ssa optimizing overflow checks where possible (including optimizing

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Richard Kenner wrote: No one needs a broken anything, Not necessarily and perhaps not in this case. Let's suppose there was an implementation of -ftrapv that did trap, but only about 80% of the time. Such an implementation would nevertheless be useful in C since there overflow is not a requir

Re: birthpoints in rtl.

2008-03-01 Thread Paolo Bonzini
And there's another special-case treatment for libcalls. On top of REG_LIBCALL/REG_RETVAL/REG_LIBCALL_ID. This is bug prone. For GCC 4.3 alone, I've fixed half a dozen libcall blocks related bugs, and others have fixed at least as many. Not to mention all the extra work they caused for the peop

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Richard Guenther wrote: On Sat, 1 Mar 2008, Richard Kenner wrote: int f(int a, int b) { return 0 * (a + b); } get the potentially trapping arithmetic folded away. If -ftrapv is to have properly defined semantics, those must include trapping if (a + b) overflows in the above code. Why? Is

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Richard Kenner
> IMHO this semantics asks for the frontend to implement the overflow > check. Does the above mean that Ada does intermediate arithmetics > in wider types? No, it means that it must *either* do the arithmetic in wider types *or* use arithmetic in the narrower types that checks for overflow.

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Richard Kenner wrote: int f(int a, int b) { return 0 * (a + b); } get the potentially trapping arithmetic folded away. If -ftrapv is to have properly defined semantics, those must include trapping if (a + b) overflows in the above code. Why? Is there any language that requires such semanti

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Richard Kenner
> No one needs a broken anything, Not necessarily and perhaps not in this case. Let's suppose there was an implementation of -ftrapv that did trap, but only about 80% of the time. Such an implementation would nevertheless be useful in C since there overflow is not a required feature of the lang

Re: birthpoints in rtl.

2008-03-01 Thread Steven Bosscher
On Sat, Mar 1, 2008 at 3:01 PM, Diego Novillo <[EMAIL PROTECTED]> wrote: > On 2/29/08 10:01 PM, Kenneth Zadeck wrote: > > > it is more productive to spend the cycles getting rid of the libcalls > > rather than figuring out the edge cases. as steven implied, we have > > been on the verge of get

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Paolo Bonzini
Richard Kenner wrote: int f(int a, int b) { return 0 * (a + b); } get the potentially trapping arithmetic folded away. If -ftrapv is to have properly defined semantics, those must include trapping if (a + b) overflows in the above code. Why? Is there any language that requires such semanti

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Richard Guenther
On Sat, 1 Mar 2008, Richard Kenner wrote: > > int f(int a, int b) { return 0 * (a + b); } > > > > get the potentially trapping arithmetic folded away. If -ftrapv is to > > have properly defined semantics, those must include trapping if (a + b) > > overflows in the above code. > > Why? Is the

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Richard Kenner
> int f(int a, int b) { return 0 * (a + b); } > > get the potentially trapping arithmetic folded away. If -ftrapv is to > have properly defined semantics, those must include trapping if (a + b) > overflows in the above code. Why? Is there any language that requires such semantics?

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Richard Guenther wrote: IMHO this semantics asks for the frontend to implement the overflow check. Does the above mean that Ada does intermediate arithmetics in wider types? I don't see how you could catch the B + C case otherwise (assuming the range check for the assignment to A covers all of

Re: birthpoints in rtl.

2008-03-01 Thread Diego Novillo
On 3/1/08 5:13 AM, Jan Hubicka wrote: while I am with Diego that would preffer PHI nodes on side especially in FUD chain where rest of your SSA is on side too. But if we go with the extra instruction scheme, I think you are much better to use RTL USE instruction. The moves are generated by tar

Re: birthpoints in rtl.

2008-03-01 Thread Diego Novillo
On 2/29/08 10:01 PM, Kenneth Zadeck wrote: it is more productive to spend the cycles getting rid of the libcalls rather than figuring out the edge cases. as steven implied, we have been on the verge of getting rid of them for years and just have just not fixed the last reason. The amount of

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Richard Guenther
On Sat, Mar 1, 2008 at 2:57 PM, Robert Dewar <[EMAIL PROTECTED]> wrote: > Paolo Bonzini wrote: > >> Seems a pity, this feature is really needed for Ada, which requires > >> efficient overflow checking for signed arithmetic, and it seems > >> useful for C, where signed overflow is undefined, and

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Paolo Bonzini wrote: Seems a pity, this feature is really needed for Ada, which requires efficient overflow checking for signed arithmetic, and it seems useful for C, where signed overflow is undefined, and it would be nice to enable trapping. Right now, Ada uses really horrible double length ar

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Richard Guenther
On Sat, 1 Mar 2008, Robert Dewar wrote: > Joseph S. Myers wrote: > > > But arbitrary arithmetic expressions aren't marked as potentially trapping / > > having side-effects with -ftrapv, so cases such as > > > > int f(int a, int b) { return 0 * (a + b); } > > > > get the potentially trapping ari

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Richard Kenner wrote: Clearly. My point was that Ada doesn't need a *broken* -ftrapv. So if there's no hope of fixing it, we might as well deprecate it. Sure, but right now we have the start of a constructive discussion of how to fix it, so the best thing would be to contribute positively to

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Paolo Bonzini
Seems a pity, this feature is really needed for Ada, which requires efficient overflow checking for signed arithmetic, and it seems useful for C, where signed overflow is undefined, and it would be nice to enable trapping. Right now, Ada uses really horrible double length arithmetic to do trapp

Re: birthpoints in rtl.

2008-03-01 Thread Diego Novillo
On 3/1/08 8:50 AM, Paolo Bonzini wrote: Yes, that's what I meant by "no subscripts" (see also my other message re. birthpoints). Instead of subscripting variables you have multiple defs for each variable. End each def is obviously assigned only once, and each use in the IL stream except for

Re: birthpoints in rtl.

2008-03-01 Thread Paolo Bonzini
Diego Novillo wrote: On 2/29/08 7:04 PM, Steven Bosscher wrote: I am not sure what would happen if GCC would start using FUD chains. Is it like in SSA that every register is assigned only once? But this would only affect the UD chains built by the DF code. Yes, that's what I meant by "no su

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Richard Guenther
On Sat, 1 Mar 2008, Joseph S. Myers wrote: > On Sat, 1 Mar 2008, Richard Guenther wrote: > > > > You also need to deal with fold, which will optimize away potentially > > > trapping computations with -ftrapv and runs before gimplification > > > (possibly in association with making fold run at g

Re: birthpoints in rtl.

2008-03-01 Thread Paolo Bonzini
By the way, I still don't understand how birth points would work. Can someone give an example of what the insn stream would look like with birth points, and what the DU/UD chains would look like? With a big IIUC, and using a high-level IR for simplicity if (a < 5) goto BB1; else goto BB2;

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Joseph S. Myers wrote: But arbitrary arithmetic expressions aren't marked as potentially trapping / having side-effects with -ftrapv, so cases such as int f(int a, int b) { return 0 * (a + b); } get the potentially trapping arithmetic folded away. If -ftrapv is to have properly defined sema

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Joseph S. Myers
On Fri, 29 Feb 2008, Robert Dewar wrote: > > If it were done at gimplification time I imagine something like the libgcc > > code would be used, but with conversions to/from unsigned inserted as > > needed. It would be possible to do optimizations at gimplification time if > > one argument is cons

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Joseph S. Myers
On Sat, 1 Mar 2008, Richard Guenther wrote: > > You also need to deal with fold, which will optimize away potentially > > trapping computations with -ftrapv and runs before gimplification > > (possibly in association with making fold run at gimplification time and > > not before). > > It shoul

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Robert Dewar
Richard Guenther wrote: So I would hestitate to deprecate it so quickly Maybe you should organize some resources to fix its implementation then? Richard. It's been on the list for over a decade, it's always harder to find resources to fix performance problems that don't specifically show up

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Richard Guenther
On Fri, 29 Feb 2008, Robert Dewar wrote: > Richard Guenther wrote: > > This is a request to depcrecate -ftrapv which has numerous problems > > making it not work as expected since a long time. As nobody seems > > to have the energy to ensure it is working I propose to deprecate it > > for GCC 4.3

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Richard Guenther
On Sat, 1 Mar 2008, Joseph S. Myers wrote: > On Fri, 29 Feb 2008, Mark Mitchell wrote: > > > Thanks for the explanations. It seems like tree-ssa should in theory make > > it > > easier to implement this; for example, at the point of gimplification one > > could insert checks, and then just let

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Richard Guenther
On Fri, 29 Feb 2008, Mark Mitchell wrote: > Richard Guenther wrote: > > > The tree optimizers do not recognize +-* of singed integers as > > possibly trapping which causes functions to become const/pure that > > should not and causes 'dead' code to be removed that should not. > > Thanks for the

4.3.0-rc2 available

2008-03-01 Thread Jakub Jelinek
GCC 4.3.0 release candidate 2 is now available at: ftp://gcc.gnu.org/pub/gcc/snapshots/4.3.0-RC-20080301/ Please test the tarballs there and report any problems to Bugzilla. CC me on the bugs if you believe they are regressions from previous releases severe enough that they should block the

Re: birthpoints in rtl.

2008-03-01 Thread Jan Hubicka
> > Not libcalls, but libcall *notes*. > > > This exist so we can effectivly remove > > blocks of code in dead code removal and do some other changes, but I > > don't see how they can be less friendly to FUD than they are to DU/UD. > > Sure the optimization has to care to not break the extra

Re: [PATCH][4.3] Deprecate -ftrapv

2008-03-01 Thread Richard Kenner
> > Ada currently has to do this itself, precisely because -ftrapv doesn't > > work, so it's not the case that Ada "needs" it. > > Well no one "needs" anything in this sense, any interfaced is Turing > complete so there is *always* a work around deficiencies in the back > end. But right now, the

Re: birthpoints in rtl.

2008-03-01 Thread Steven Bosscher
On Sat, Mar 1, 2008 at 11:03 AM, Jan Hubicka <[EMAIL PROTECTED]> wrote: > > The two complications are: > > 1) libcalls > > I am probably dense here, but why we can't just ignore existence of > libcalls for dataflow framework? Not libcalls, but libcall *notes*. > This exist so we can effectiv

Re: birthpoints in rtl.

2008-03-01 Thread Jan Hubicka
> Diego, > > I am leaning to just adding noop moves at the birthpoints (dominance > frontiers) as real noop move insns in the streams in the passes that use > ud or du chains. The back end is tolerant of noop moves and without Hi, while I am with Diego that would preffer PHI nodes on side espec

Re: birthpoints in rtl.

2008-03-01 Thread Jan Hubicka
> The two complications are: > 1) libcalls I am probably dense here, but why we can't just ignore existence of libcalls for dataflow framework? This exist so we can effectivly remove blocks of code in dead code removal and do some other changes, but I don't see how they can be less friendly to F