This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ ICE with ntohs() and -mcpu=pentiumpro


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]