For this simple Fortran string:

[...@gnu-6 pr45634]$ cat pr45634.f90 
      SUBROUTINE RCRDRD (VTYP)
      CHARACTER(4), INTENT(OUT) :: VTYP 
      CHARACTER(1), SAVE :: DBL = "D" 
      VTYP = DBL
      END

GCC generates:

[...@gnu-6 pr45634]$ cat pr45634.s 
        .file   "pr45634.f90"
        .text
        .p2align 4,,15
        .globl  rcrdrd_
        .type   rcrdrd_, @function
rcrdrd_:
.LFB0:
        .cfi_startproc
        movzbl  dbl.1557(%rip), %eax
        movw    $8224, 1(%rdi)
        movb    $32, 3(%rdi)
        movb    %al, (%rdi)
        ret
        .cfi_endproc
.LFE0:
        .size   rcrdrd_, .-rcrdrd_
        .section        .rodata
        .type   dbl.1557, @object
        .size   dbl.1557, 1
dbl.1557:
        .ascii  "D"
        .ident  "GCC: (GNU) 4.6.0 20100910 (experimental)"
        .section        .note.GNU-stack,"",@progbits

IFORT generates:

[...@gnu-6 pr45634]$ cat icc.s
# -- Machine type EFI2
# mark_description "Intel(R) Fortran Compiler XE for applications running on
Intel(R) 64, Version 12.0.0 Beta Build 20100512";
# mark_description "-O3 -S";
        .file "pr45634.f90"
        .text
..TXTST0:
# -- Begin  rcrdrd_
# mark_begin;
       .align    16,0x90
        .globl rcrdrd_
rcrdrd_:
# parameter 1: %rdi
# parameter 2: %rsi
..B1.1:                         # Preds ..B1.0
..___tag_value_rcrdrd_.1:                                       #1.18
        movl      $538976324, (%rdi)                            #4.7
        ret                                                     #5.7


-- 
           Summary: Failed to fold simple Fortran string
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


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

Reply via email to