This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/8299: sh-gcc-3.2 Optimizing problem


>Number:         8299
>Category:       c
>Synopsis:       sh-gcc-3.2 Optimizing problem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 21 04:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Takayasu Tanaka
>Release:        gcc version 3.2
>Organization:
>Environment:
RedHat Linux 7.1
Configured with: ../gcc-3.2/configure --enable-languages=c,c++ --prefix=/home/tanaka/sh/bin --target=sh-unknown-elf
>Description:
On some condition, arguments of a function are stored in wrong position.
>How-To-Repeat:
---------- source code ------------      
typedef struct { 
        int x; 
        int y; 
} PNT; 
        
int g(int a1, int a2, int a3, int a4, int a5, int a6)
{       
        return 0;
}       
        
int f(int a1, int a2, int a3, PNT p, int a6)
{       
        return g( a1, a2, a3, p.x, p.y, a6);
}       
        
void _start()
{       
        int a1 = 1, a2 = 2, a3 = 3; PNT p = {4, 5}; int a6 = 6;
        
        f( a1, a2, a3, p, a6 );
}
------------------------------------
Argument of g() must be 1, 2, 3, 4, 5, 6.
But, compiled with -O2, argument of g() is
1, 2, 3, 4, 6, 6.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]