This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
20000508 g++ fails to compile mux function.
- To: <gcc at gcc dot gnu dot org>
- Subject: 20000508 g++ fails to compile mux function.
- From: "Robert" <robert dot melchers at drives dot eurotherm dot co dot uk>
- Date: Thu, 11 May 2000 14:02:25 +0100
The following source fails to compile with
sh-elf gcc version 2.96 20000508 (experimental)
sh-elf for the Hitachi SH Processor.
with the following cmdline:
sh-elf-gcc -xc++ -c mux.c
The same file compiles fine with:
sh-elf-gcc -c mux.c
splitting the OR into 2 parts also fixes the problem also the same file compiles fine with
sh-coff-gcc version 2.95.2 19991024 (release)
/* --- Start of file --- */
typedef char bool; /* needed for 'c' build */
bool in0 ;
bool in1 ;
bool in2 ;
bool in3 ;
bool in4 ;
bool in5 ;
bool in6 ;
bool in7 ;
bool in8 ;
bool in9 ;
bool in10;
bool in11;
bool in12;
bool in13;
bool in14;
bool in15;
unsigned int output;
void mux(void)
{
output =
(in0 ? 0x0001 : 0) |
(in1 ? 0x0002 : 0) |
(in2 ? 0x0004 : 0) |
(in3 ? 0x0008 : 0) |
(in4 ? 0x0010 : 0) |
(in5 ? 0x0020 : 0) |
(in6 ? 0x0040 : 0) |
(in7 ? 0x0080 : 0) |
(in8 ? 0x0100 : 0) |
(in9 ? 0x0200 : 0) |
(in10 ? 0x0400 : 0) |
(in11 ? 0x0800 : 0) |
(in12 ? 0x1000 : 0) |
(in13 ? 0x2000 : 0) |
(in14 ? 0x4000 : 0) |
(in15 ? 0x8000 : 0) ;
}
/* --- END OF FILE --- */