[Bug fortran/30720] runtime: check for empty array slices before allocating a negative amount of memory

2007-02-09 Thread fxcoudert at gcc dot gnu dot org
--- Comment #8 from fxcoudert at gcc dot gnu dot org 2007-02-09 20:31 --- Subject: Bug 30720 Author: fxcoudert Date: Fri Feb 9 20:31:18 2007 New Revision: 121773 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=121773 Log: PR fortran/30720 * trans-array.c

[Bug fortran/30720] runtime: check for empty array slices before allocating a negative amount of memory

2007-02-07 Thread tkoenig at gcc dot gnu dot org
--- Comment #5 from tkoenig at gcc dot gnu dot org 2007-02-07 17:52 --- Hi FX, do you remember why always performing that check (ie, turn function to be always true) is not the right thing to do? When working on this, I hit numerous testsuite regressions when always checking for

[Bug fortran/30720] runtime: check for empty array slices before allocating a negative amount of memory

2007-02-07 Thread fxcoudert at gcc dot gnu dot org
--- Comment #6 from fxcoudert at gcc dot gnu dot org 2007-02-07 19:10 --- (In reply to comment #5) If you find something that works without that argument (which is a bit of a kudge), so much the better. The patch I attached removes this argument, and it gives no regression on the

[Bug fortran/30720] runtime: check for empty array slices before allocating a negative amount of memory

2007-02-07 Thread tkoenig at gcc dot gnu dot org
--- Comment #7 from tkoenig at gcc dot gnu dot org 2007-02-07 20:49 --- (In reply to comment #6) The patch I attached removes this argument, and it gives no regression on the testsuite. I also simplified the conditional expression by using a COND_EXPR instead of generating different

[Bug fortran/30720] runtime: check for empty array slices before allocating a negative amount of memory

2007-02-06 Thread fxcoudert at gcc dot gnu dot org
--- Comment #1 from fxcoudert at gcc dot gnu dot org 2007-02-06 20:34 --- Confirming this bug (both of them, actually). For the missed-optimization, I think there's no reason to keep a library function _gfortran_internal_free(x) that is equivalent to if(x) free(x);, we should generate

[Bug fortran/30720] runtime: check for empty array slices before allocating a negative amount of memory

2007-02-06 Thread fxcoudert at gcc dot gnu dot org
--- Comment #2 from fxcoudert at gcc dot gnu dot org 2007-02-06 21:00 --- The wrong-code bug happens in gfc_trans_create_temp_array. For some reason, the function argument to that function is false, and the code present to take care of negative extent is not triggered. Thomas, you're

[Bug fortran/30720] runtime: check for empty array slices before allocating a negative amount of memory

2007-02-06 Thread fxcoudert at gcc dot gnu dot org
--- Comment #3 from fxcoudert at gcc dot gnu dot org 2007-02-06 23:13 --- To keep things separate, I filed PR30723 for the missed optimization. -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added

[Bug fortran/30720] runtime: check for empty array slices before allocating a negative amount of memory

2007-02-06 Thread fxcoudert at gcc dot gnu dot org
--- Comment #4 from fxcoudert at gcc dot gnu dot org 2007-02-06 23:16 --- Created an attachment (id=13018) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13018action=view) Patch for this bug Here's the patch I propose. It makes the code simpler by using a cond_expr instead of