From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17734 invoked by alias); 6 Jul 2005 19:22:14 -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 17690 invoked by uid 48); 6 Jul 2005 19:22:06 -0000 Date: Wed, 06 Jul 2005 19:22:00 -0000 Message-ID: <20050706192206.17689.qmail@sourceware.org> From: "gnu at the-meissners dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040512145606.15397.harald.vogt@desy.de> References: <20040512145606.15397.harald.vogt@desy.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug target/15397] [g77] c float function called from fortran gives wrong result X-Bugzilla-Reason: CC X-SW-Source: 2005-07/txt/msg00626.txt.bz2 List-Id: ------- Additional Comments From gnu at the-meissners dot org 2005-07-06 19:22 ------- FWIW, I tried this with the 4.0 compiler on an AMD64 system, and it doesn't fail with gfortran. I did bring over the 3.4.4 release, and tried it with g77, and it failed as reported. It passed if I used -m32 with the traditional x86 calling sequence. If I link the 3.4.4 fortran object with the 4.0.0 C object, it fails. If I link the 4.0.0 fortran with the 3.4.4 C object, it passes. Looking at the code for -O1, between 3.4.4 and 4.0.0, I see, the 4.0.0 generates: call funct2_ movss %xmm0, 12(%rsp) and the 3.4.4 fortran generates: call funct2_ cvtsd2ss %xmm0, %xmm0 movss %xmm0, 16(%rsp) Ie, g77 is expecting float values to be returned as a double, and then doing the conversion. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15397