optimization/5969: When function is declared func(unsigned char v), v isn't truncated
dash@xdr.com
dash@xdr.com
Thu Mar 14 15:46:00 GMT 2002
>Number: 5969
>Category: optimization
>Synopsis: When function is declared func(unsigned char v), v isn't truncated
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 14 15:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: David Ashley
>Release: 2.95.3 20010315 (release/MonteVista)
>Organization:
>Environment:
Irrelevant
>Description:
/* Compile with -O2 on ppc architecture */
main()
{
tst(0x12);
tst(0x1234);
}
tst(unsigned char v)
{
printf("v=%x\n",v);
}
/* File prints out:
v=12
v=1234
*/
>How-To-Repeat:
Compile that program for powerpc and run it. Easy as pie.
The inportant things are:
-O2 optimization
tst must be defined after it is used.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list