[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-17 Thread rguenth at gcc dot gnu dot org
--- Comment #19 from rguenth at gcc dot gnu dot org 2005-11-17 11:36 --- Fixed. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNE

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-17 Thread rguenth at gcc dot gnu dot org
--- Comment #18 from rguenth at gcc dot gnu dot org 2005-11-17 11:35 --- Subject: Bug 24851 Author: rguenth Date: Thu Nov 17 11:35:00 2005 New Revision: 107117 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107117 Log: 2005-11-16 Richard Guenther <[EMAIL PROTECTED]>

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-16 Thread paolo dot bonzini at lu dot unisi dot ch
--- Comment #17 from paolo dot bonzini at lu dot unisi dot ch 2005-11-16 09:41 --- Subject: Re: [4.1 Regression] f2c miscompilation rguenth at gcc dot gnu dot org wrote: >--- Comment #16 from rguenth at gcc dot gnu dot org 2005-11-16 09:39 >--- >Is the second reduced testca

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-16 Thread rguenth at gcc dot gnu dot org
--- Comment #16 from rguenth at gcc dot gnu dot org 2005-11-16 09:39 --- Is the second reduced testcase not fine from a standards POV? I.e. void abort(void); int main() { int a[10], *p, *q; q = &a[1]; p = &q[-1]; if (p >= &a[9]) abort (); return 0; } or does "array" in

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-15 Thread ian at airs dot com
--- Comment #15 from ian at airs dot com 2005-11-16 01:09 --- Does it bother us that legal ISO C programs are not permitted to say &a[-1]? You are permitted to take the address of the element immediately after the array, but you aren't permitted to take the address of the element before

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread pinskia at gcc dot gnu dot org
--- Comment #14 from pinskia at gcc dot gnu dot org 2005-11-14 19:09 --- (In reply to comment #13) > I have a fix for the only valid testcase (comment #7) here. s/valid/defined/ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24851

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread pinskia at gcc dot gnu dot org
--- Comment #13 from pinskia at gcc dot gnu dot org 2005-11-14 19:08 --- I have a fix for the only valid testcase (comment #7) here. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added ---

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread pinskia at gcc dot gnu dot org
--- Comment #12 from pinskia at gcc dot gnu dot org 2005-11-14 18:47 --- Note we haveyyp = &yys[-1]; (where yys is an array) in the orginal testcase so that is undefined. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24851

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread pinskia at gcc dot gnu dot org
--- Comment #11 from pinskia at gcc dot gnu dot org 2005-11-14 17:31 --- div_if_zero_remainder assumes that the type of the agruments comming in are the same. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24851

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread pinskia at gcc dot gnu dot org
--- Comment #10 from pinskia at gcc dot gnu dot org 2005-11-14 17:29 --- Actually I was wrong on which patch caused/exposed this, This was caused by: 2005-05-14 Richard Guenther <[EMAIL PROTECTED]> * fold-const.c (div_if_zero_remainder): New function. (try_move_mult_t

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread pinskia at gcc dot gnu dot org
--- Comment #9 from pinskia at gcc dot gnu dot org 2005-11-14 17:04 --- (In reply to comment #8) > Patch to avoid the situation posted. So this patch makes the real bug latent. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added ---

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread rguenth at gcc dot gnu dot org
--- Comment #8 from rguenth at gcc dot gnu dot org 2005-11-14 17:03 --- Patch to avoid the situation posted. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread rguenth at gcc dot gnu dot org
--- Comment #7 from rguenth at gcc dot gnu dot org 2005-11-14 16:27 --- Valid testcase (?): void abort(void); int main() { int a[10], *p, *q; q = &a[1]; p = &q[-1]; if (p >= &a[9]) abort (); return 0; } fold_stmt is doing the &a[0] + -4B to &a[1073741823] transformation.

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread pinskia at gcc dot gnu dot org
--- Comment #6 from pinskia at gcc dot gnu dot org 2005-11-14 15:56 --- The problem here is that we are comparing in unsigned when we shoud be comparing in a signed type. This was introduced by: 2005-01-29 Richard Guenther <[EMAIL PROTECTED]> PR tree-optimization/15791

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread pinskia at gcc dot gnu dot org
--- Comment #5 from pinskia at gcc dot gnu dot org 2005-11-14 15:42 --- Confirmed, short testcase: int f(void) { int i = -1; int a[10]; int *b = &a[2]; return &a[i]>=b; } int main(void) { if (f()) abort(); } -- pinskia at gcc dot gnu dot org changed: What

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread rguenth at gcc dot gnu dot org
--- Comment #4 from rguenth at gcc dot gnu dot org 2005-11-14 15:42 --- C++ frontend is fine. With C out of (.03.gimple) p = &a + -4B; D.1282 = &a + 36B; we (fold?) get (.10.cleanup_cfg) p = &a[1073741823]; D.1282 = &a[9]; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2

[Bug middle-end/24851] [4.1 Regression] f2c miscompilation

2005-11-14 Thread rguenth at gcc dot gnu dot org
--- Comment #3 from rguenth at gcc dot gnu dot org 2005-11-14 15:40 --- Reduced testcase: void abort(void); int main() { int a[10], *p; p = &a[-1]; if (p >= &a[9]) abort (); return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24851