------- Comment #2 from jpr at csc dot fi  2010-09-20 06:54 -------
Created an attachment (id=21842)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21842&action=view)
somewhat reduced testcase

Hi,

I tried debugging this more. Attached is a somewhat reduced testcase. I also 
had a look at the assembler generated by 
"x86_64-w64-mingw32-gfortran -save-temps -O1 fail1.f90".

The loadinp looks like  

...
loadinp_:
        subq    $56, %rsp
        movl    $1952671091, 32(%rsp)
        movw    $28521, 36(%rsp)
        movb    $110, 38(%rsp)
        leaq    32(%rsp), %r10
        call    parse_sect.1525
... so it stores the  'section' string to stack and loads %r10 with
the stack address and calls the parse_sect:
....
parse_sect.1525:
        pushq   %rdi
        pushq   %rsi
        pushq   %rbx
        movl    $4032, %eax
        call    ___chkstk
        movq    %r10, %rsi
   ....
which then uses the stack address in %r10. The thing is that the 
__chkstk() call  seems to change the contents of the
%r10. At least doing
...
movq %r10,%r12
call __chkstk
movq %r12,%r10
...
seems to cure the example. What is really going on, anyone?

Br, Juha


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45694

Reply via email to