This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
optimization/8671: gcc version 2.95.3 passing parameters bug
- From: _hristo_ at dir dot bg
- To: gcc-gnats at gcc dot gnu dot org
- Date: 21 Nov 2002 14:53:54 -0000
- Subject: optimization/8671: gcc version 2.95.3 passing parameters bug
- Reply-to: _hristo_ at dir dot bg
>Number: 8671
>Category: optimization
>Synopsis: gcc version 2.95.3 passing parameters bug
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Thu Nov 21 06:56:02 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Hristo Hristov
>Release: gcc version 2.95.3 20010315
>Organization:
>Environment:
Slackware Linux, Pentium III
>Description:
third parameter passed to a function is one, after the function call, inside the fuction, it's printed and it is 0. the parameter is passed incorectly. see the source, it's very very simple. the bug appears when compiling with -O2 switch. just try "gcc -O2 -o zoom zoom.c"
>How-To-Repeat:
>Fix:
when something is changed in code, the bug disappears
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="zoom.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="zoom.c"
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkCmZ1bmMgKHVuc2lnbmVkIGZpcnN0LCB1bnNpZ25lZCBz
ZWNvbmQsIHVuc2lnbmVkIHRoaXJkKQp7CiAgdW5zaWduZWQgaSwgaiwgbWF4aSwgbWF4ajsKCiAg
cHJpbnRmICgidGhpcmQgPSAldVxuIiwgdGhpcmQpOwoKICBtYXhpID0gZmlyc3QgKiAxLjA7CiAg
bWF4aiA9IHNlY29uZCAqIDEuMDsKCiAgZm9yIChpID0gMDsgaSA8IG1heGk7IGkrKykKICAgIGZv
ciAoaiA9IDA7IGogPCBtYXhqOyBqKyspCiAgICAgIC8qIGVtcHR5ICovOwp9CgppbnQKbWFpbiAo
dm9pZCkKewogIGZ1bmMgKDEsIDEsIDEpOwoKICByZXR1cm4gMDsKfQo=