Bug 494563

Summary: Request package inclusion of gcc44
Product: Red Hat Enterprise Linux 5 Reporter: Sachin Prabhu <sprabhu>
Component: gcc44Assignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 5.3CC: nikolay, pmuller, syeghiay, tao
Target Milestone: rcKeywords: TechPreview
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: NwCmp: gcc44
Fixed In Version: Doc Type: Technology Preview
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 07:43:27 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 498911    
Bug Blocks:    

Description Sachin Prabhu 2009-04-07 09:15:14 EDT
gcc-gfortran version: gcc43-gfortran-4.3.2-7.el5

How reproducible: Always

Steps to reproduce:

1) Compile the following test program with gcc-gfortran43 from RHEL5.3:

subroutine moreparams
integer (kind=1), parameter :: i1 = 127_1
integer (kind=2), parameter :: i2 = 28
write (*,*) i1
end

program test1
integer i
call moreparams
end

[root@localhost ~]# rpm -q gcc43-gfortran
gcc43-gfortran-4.3.2-7.el5

[root@localhost ~]# gfortran43 -g test2.f90


2) Check the output in gdb.  gdb prints out the constant as a character rather than as a very small int.

[root@localhost ~]# gdb -q a.out
(gdb) break 4
Breakpoint 1 at 0x400707: file test2.f90, line 4.
(gdb) r
Starting program: /root/a.out

Breakpoint 1, moreparams () at test2.f90:4
4 write (*,*) i1
Current language:  auto; currently fortran
(gdb) p i1
$1 = 127 '\177'
(gdb) p i2
$2 = 28
(gdb) quit
The program is running.  Exit anyway? (y or n) y



3) Relevant output from objdump -W is below.  The section to observe is <1><84>:

<1><84>: Abbrev Number: 7 (DW_TAG_base_type)
    DW_AT_byte_size   : 1      
    DW_AT_encoding    : 6      (signed char)
    DW_AT_name        : (indirect string, offset: 0x6): integer(kind=1)        
<1><8b>: Abbrev Number: 6 (DW_TAG_const_type)
    DW_AT_type        : <84>   
<1><90>: Abbrev Number: 6 (DW_TAG_const_type)
    DW_AT_type        : <95>   
<1><95>: Abbrev Number: 7 (DW_TAG_base_type)
    DW_AT_byte_size   : 2      
    DW_AT_encoding    : 5      (signed)
    DW_AT_name        : (indirect string, offset: 0x16): integer(kind=2)  

Actual results: kind=1 integer is encoded as a 'signed char'

Expected results: kind=1 should be encoded as 'signed'
Comment 2 Jakub Jelinek 2009-04-08 12:12:47 EDT
See
http://gcc.gnu.org/ml/gcc-patches/2009-04/msg00606.html
Comment 5 Issue Tracker 2009-04-30 16:23:16 EDT
Looks like it's fixed in gcc44 packages from Jakub

[root@quickbeam gfortran]# gfortran44 -g params.f90
[root@quickbeam gfortran]# rpm -q gcc44-gfortran
gcc44-gfortran-4.4.0-3.el5
gcc44-gfortran-4.4.0-3.el5
[root@quickbeam gfortran]# gdb -q a.out
(gdb) break 4
Breakpoint 1 at 0x400707: file params.f90, line 4.
(gdb) r
Starting program: /root/gfortran/a.out 

Breakpoint 1, moreparams () at params.f90:4
4	 write (*,*) i1
Current language:  auto; currently fortran
(gdb) p i1
$1 = 127 '\177'
(gdb) p i2
$2 = 28
(gdb) quit
The program is running.  Exit anyway? (y or n) y

objdump -W appears to show the right stuff, now

 <1><32>: Abbrev Number: 3 (DW_TAG_base_type)
     DW_AT_byte_size   : 1      
     DW_AT_encoding    : 5      (signed)
     DW_AT_name        : (indirect string, offset: 0x1a): integer(kind=1) 
     
 <1><39>: Abbrev Number: 2 (DW_TAG_const_type)
     DW_AT_type        : <3e>   
 <1><3e>: Abbrev Number: 3 (DW_TAG_base_type)
     DW_AT_byte_size   : 2      
     DW_AT_encoding    : 5      (signed)
     DW_AT_name        : (indirect string, offset: 0x30): integer(kind=2) 
     





This event sent from IssueTracker by kbaxley 
 issue 283316
Comment 15 errata-xmlrpc 2009-09-02 07:43:27 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1375.html