This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c/8299: sh-gcc-3.2 Optimizing problem
- From: tanaka at personal-media dot co dot jp
- To: gcc-gnats at gcc dot gnu dot org
- Date: 21 Oct 2002 11:24:41 -0000
- Subject: c/8299: sh-gcc-3.2 Optimizing problem
- Reply-to: tanaka at personal-media dot co dot jp
>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: