asm-statement (see attachement test.c [preprocessing is not needed]) caused an internal compiler error, only if optimization level is 0 (default) test.c: In function `KmAtomicCompareExchange': test.c:10: Internal compiler error in instantiate_virtual_regs_1, at function.c: 3972 Release: GCC 3.2 Environment: x86(AMD XP2200+) cygwin (1.1.8) Windows 2000 Prof. How-To-Repeat: execute "gcc -c test.c"
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed mainline and 3_2-branch.
From: Dara Hazeghi <dhazeghi@yahoo.com> To: gcc-gnats@gcc.gnu.org Cc: Subject: Re: inline-asm/8440: Internal GCC 3.2 compiler error caused by Asm-Statement Date: Fri, 9 May 2003 21:34:27 -0700 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- trail&database=gcc&pr=8440 Hello, with gcc 3.2 I can reproduce the bug in the report at O0. At -O1 or higher, I get: /tmp/ccdPX6Jj.s: Assembler messages: /tmp/ccdPX6Jj.s:24: Error: invalid char '[' beginning operand 1 `[%ecx]' with 3.3 branch or mainline at -O0 I get: test.c: In function `KmAtomicCompareExchange': test.c:3: error: impossible constraint in `asm' I get the same result as with 3.2 at -O1 or higher. This is with GNU binutils 2.13.2.1. I think the behavior should be consistent with and without optimization though, so this is still a bug, though no longer an ice-on-legal. Dara
Confirmed again. The ICE is gone in 3.3 and mainline. However, it's confusing that one should get different messages with and without optimization: g/x> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -c test.c test.c: In function `KmAtomicCompareExchange': test.c:5: error: impossible constraint in `asm' g/x> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -c test.c -O /tmp/ccdERBQL.s: Assembler messages: /tmp/ccdERBQL.s:22: Error: invalid char '[' beginning operand 1 `[%ecx]'
If I fix the asm by removing the extra square brackets I still get an error at -O0 but at -O1 I do not get an error. The error (invalid char '[' beginning operand 1 `[%ecx]') that was reported due to the string in the asm was wrong. Resummary based on that.
*** Bug 11850 has been marked as a duplicate of this bug. ***
This is invalid as it is picking the "e" constraint and the "e" constraint is defined as: Constant in range -2147483648 to 2147483647 or symbolic reference known to fit specified range. (for using immediates in 64-bit x86-64 instructions)