From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30080 invoked by alias); 20 Nov 2004 13:20:10 -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 30054 invoked by uid 48); 20 Nov 2004 13:20:06 -0000 Date: Sat, 20 Nov 2004 13:20:00 -0000 Message-ID: <20041120132006.30053.qmail@sourceware.org> From: "Thomas dot Koenig at online dot de" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20041116103451.18518.Thomas.Koenig@online.de> References: <20041116103451.18518.Thomas.Koenig@online.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/18518] equivalenced variables are not saved X-Bugzilla-Reason: CC X-SW-Source: 2004-11/txt/msg02332.txt.bz2 List-Id: ------- Additional Comments From Thomas dot Koenig at online dot de 2004-11-20 13:19 ------- > Hmmm, I do not get this on my powerpc-unknown-linux-gnu: Here's a reduced assembly output: $ gfortran -v Reading specs from /home/ig25/lib/gcc/i686-pc-linux-gnu/4.0.0/specs Configured with: ../gcc/configure --prefix=/home/ig25 --enable-languages=c,c++,f95 Thread model: posix gcc version 4.0.0 20041120 (experimental) $ cat pr18518-test2.f90 subroutine foo integer i,g,h data i/0/ equivalence (g,h) save g if (i == 0) then i = 1 h = 12345 end if print *,h end subroutine foo $ gfortran -S pr18518-test2.f90 $ cat pr18518-test2.s .file "pr18518-test2.f90" .local i.456 .comm i.456,4,4 .section .rodata .LC0: .string "pr18518-test2.f90" .text .globl foo_ .type foo_, @function foo_: pushl %ebp movl %esp, %ebp subl $24, %esp movl i.456, %eax testl %eax, %eax jne .L2 movl $1, i.456 movl $12345, -4(%ebp) .L2: movl $.LC0, _gfortran_filename movl $10, _gfortran_line movl $6, _gfortran_ioparm movl $1, _gfortran_ioparm+16 call _gfortran_st_write movl $4, 4(%esp) leal -4(%ebp), %eax movl %eax, (%esp) call _gfortran_transfer_integer call _gfortran_st_write_done leave ret .size foo_, .-foo_ .ident "GCC: (GNU) 4.0.0 20041120 (experimental)" .section .note.GNU-stack,"",@progbits $ The "movl $12345, -4(%ebp)" above is clearly wrong - it loads the value of 12345 into a stack location, not a saved location. It would be good to check assembly output on your machine to see wether the same problem occurs (even if the test example doesn't show it). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18518