From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6595 invoked by alias); 6 Jan 2005 21:52:29 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 6526 invoked by uid 48); 6 Jan 2005 21:52:22 -0000 Date: Thu, 06 Jan 2005 21:52:00 -0000 Message-ID: <20050106215222.6525.qmail@sourceware.org> From: "coudert at clipper dot ens dot fr" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050106172343.19294.coudert@clipper.ens.fr> References: <20050106172343.19294.coudert@clipper.ens.fr> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/19294] intrinsic_transpose.f90 runtime crash X-Bugzilla-Reason: CC X-SW-Source: 2005-01/txt/msg00762.txt.bz2 List-Id: ------- Additional Comments From coudert at clipper dot ens dot fr 2005-01-06 21:52 ------- Playing with this test case to produce a minimal example, I found lots of differents sources that crash at runtime, for different levels of optimization (some at 1 and 2 but not 0 and 3, some only for 0, etc). The following code may be the easiest to debug: program intrinsic_transpose integer, dimension (3, 3) :: b complex(kind=4), dimension (2, 2) :: e b = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/)) e = reshape ((/(1.0,2.0), (3.0, 4.0), (5.0, 6.0), (7.0, 8.0)/), (/2, 2/)) e = transpose (e); end program This ones crashes with -O0 and -O1, but not -O2. Typical of a memory corruption problem, if you remove the 'b = ...' line (or if the compiler removes it for you, as I guess is done for -O2), the problem disappears. I can reproduce it on solaris2.8 too (but not for -O0, though... how I hate memory corruption!) GDB backtrace is still the same: Starting program: /users/01/chimie/coudert/tmp/a.out Program received signal SIGSEGV, Segmentation fault. *_gfortran_transpose_8 (ret=Variable "ret" is not available. ) at ../../../gcc/libgfortran/generated/transpose_i8.c:81 81 ../../../gcc/libgfortran/generated/transpose_i8.c: No such file or directory. in ../../../gcc/libgfortran/generated/transpose_i8.c As optimiztion is not in cause any more, I guess looking at flags will be no use. I don't know if gdb is to be believed, but the code around line 81 in transpose_i8.c is: rptr = ret->data; sptr = source->data; for (y=0; y < ycount; y++) { for (x=0; x < xcount; x++) { *rptr = *sptr; /* This is line 81 */ sptr += sxstride; rptr += rystride; } sptr += systride - (sxstride * xcount); rptr += rxstride - (rystride * xcount); } Looks like it could be that. I'll be running a modified version of the library to determine if it's at that point later tonight. As I have absolutely no knowledge about compilers, please feel free to help! -- What |Removed |Added ---------------------------------------------------------------------------- Summary|intrinsic_transpose.f90 |intrinsic_transpose.f90 |runtime crash at -O1 |runtime crash http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19294