From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22197 invoked by alias); 15 Jul 2007 09:26:31 -0000 Received: (qmail 22160 invoked by uid 48); 15 Jul 2007 09:26:20 -0000 Date: Sun, 15 Jul 2007 09:26:00 -0000 Subject: [Bug libfortran/32770] New: -fdefault-integer-8 and the library X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tkoenig at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg01618.txt.bz2 -fdefault-integer-8 has some "interesting" interactions with the library, especially on big-endian systems. Look at the following program: $ cat maxloc-mask.f90 program main real, dimension(2) :: a call random_number(a) print *,maxloc(a,mask=.true.) end program main $ gfortran -fdump-tree-original -fdefault-integer-8 -fdefault-real-8 maxloc-mask.f90 This produces { int8 A.4[1]; struct array1_int8 atmp.3; static logical8 C.1015 = 1; struct array1_real8 parm.2; parm.2.dtype = 537; parm.2.dim[0].lbound = 1; parm.2.dim[0].ubound = 2; parm.2.dim[0].stride = 1; parm.2.data = (void *) &a[0]; parm.2.offset = -1; atmp.3.dtype = 521; atmp.3.dim[0].stride = 1; atmp.3.dim[0].lbound = 0; atmp.3.dim[0].ubound = 0; atmp.3.data = (void *) &A.4; atmp.3.offset = 0; _gfortran_smaxloc0_8_r8 (&atmp.3, &parm.2, &C.1015); and the function called is extern void smaxloc0_8_r8 (gfc_array_i8 * const restrict, gfc_array_r8 * const restrict, GFC_LOGICAL_4 *); Works on little-endian systems, won't work on big-endian systems. Intrinsics this probably causes problems on: maxloc, maxval, minloc, minval. There may be other places like this. I don't have a big-endian system, so I can't test this. I'd appreciate a confirmation. -- Summary: -fdefault-integer-8 and the library Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tkoenig at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32770