This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C++ ICE with ntohs() and -mcpu=pentiumpro
- To: gcc-bugs at gcc dot gnu dot org
- Subject: C++ ICE with ntohs() and -mcpu=pentiumpro
- From: Rémi Guyomarch <rguyom at mail dot dotcom dot fr>
- Date: Sun, 19 Mar 2000 16:05:09 +0100
Hi,
The following code produce an ICE with the latest CVS tree.
It happens when compiled as C++, not C, and with -mcpu=pentiumpro only.
When compiled as C code, or with -mcpu=486,pentium,k6 it doesn't ICE.
I'm on a FreeBSD 4.0-STABLE box, and I've updated my CVS tree 2 hours ago.
The ntohs() definition is the one I found in my system includes.
==================== snip snip ====================
typedef unsigned short u_short;
#define ntohs(x) \
__extension__ ({ register u_short __X = (x); \
__asm ("xchgb %h1, %b1" \
: "=q" (__X) \
: "0" (__X)); \
__X; })
u_short foo( u_short bar ) { return ntohs( bar ); }
==================== snip snip ====================
# egcc -c -mcpu=pentiumpro bar.cpp
bar.cpp: In function `u_short foo (short unsigned int)':
bar.cpp:11: Internal compiler error in `emit_move_insn', at expr.c:2550
bar.cpp:11: Please submit a full bug report.
bar.cpp:11: See <URL:http://www.gnu.org/software/gcc/bugs.html> for
bar.cpp:11: instructions.
# egcc -v
Reading specs from /home/rguyom/apps/gcc-devel/lib/gcc-lib/i386-portbld-freebsdelf/2.96/specs
gcc version 2.96 20000319 (experimental)