From mboxrd@z Thu Jan 1 00:00:00 1970 From: ee96090@fe.up.pt To: gcc-gnats@gcc.gnu.org Subject: c/2995: __complex__ int typecasts maybe broken Date: Tue, 29 May 2001 11:06:00 -0000 Message-id: <20010529180254.6305.qmail@sourceware.cygnus.com> X-SW-Source: 2001-05/msg01008.html List-Id: >Number: 2995 >Category: c >Synopsis: __complex__ int typecasts maybe broken >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue May 29 11:06:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: egcs >Release: egcs-2.91.66 >Organization: >Environment: Slackware 7.1 >Description: The attached program has the following output: real = 1; imag = -1; y = 5 Which means the typecasts from (__complex__ short int) to (__complex__ int) are not working. There is a computation with complex int (x) and another with normal int (y). y is computed correctly (as expected) whilst x isn't. >How-To-Repeat: Just compile and run the program. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="test.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.c" I2luY2x1ZGUgPGNvbXBsZXguaD4KI2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxsaW1pdHMu aD4KCgp2b2lkIG1haW4odm9pZCkKewogICAgLyoqLyAgICAgICAgc2hvcnQgaW50IHk7CiAgICBf X2NvbXBsZXhfXyBzaG9ydCBpbnQgeDsKICAgIAogICAgeCA9IDEwICsgN2o7CiAgICB5ID0gNTsK ICAgIHggPSAoKChfX2NvbXBsZXhfXyBpbnQpeCkgKiBTSFJUX01BWCkgLyBTSFJUX01BWDsKICAg IHkgPSAoKCggICAgICAgICAgICBpbnQpeSkgKiBTSFJUX01BWCkgLyBTSFJUX01BWDsKICAgIHBy aW50ZigicmVhbCA9ICVoaTsgaW1hZyA9ICVoaTsgeSA9ICVoaVxuIiwgX19yZWFsX18geCwgX19p bWFnX18geCwgeSk7Cn0K