This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/19100] New: Wrong code for ?-operator with casted ?-operator predicat
- From: "heinrich dot brand at fujitsu-siemens dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Dec 2004 08:54:11 -0000
- Subject: [Bug middle-end/19100] New: Wrong code for ?-operator with casted ?-operator predicat
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The function test returns 17 not 18 as required.
#include <stdio.h>
signed char test(long v[]){
return ( ( ((signed char) (v[1] ? 0x100 : 0 ))) ? 17 : 18);
}
int main(void){
static long v[3];
v[1]=2;
printf("test : %d\n",test(v));
return 0;
}
--
Summary: Wrong code for ?-operator with casted ?-operator
predicat
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: heinrich dot brand at fujitsu-siemens dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19100