Bug 8440 - impossible constraint due to x86 being register stavared
Summary: impossible constraint due to x86 being register stavared
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: inline-asm (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
: 11850 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-11-03 10:46 UTC by Benjamin Kalytta
Modified: 2004-05-07 03:02 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-12-17 04:57:32


Attachments
test.c (192 bytes, text/plain)
2003-05-21 15:16 UTC, Benjamin Kalytta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Kalytta 2002-11-03 10:46:01 UTC
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"
Comment 1 Paolo Carlini 2002-11-03 10:52:23 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed mainline and 3_2-branch.
Comment 2 Dara Hazeghi 2003-05-09 21:34:27 UTC
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
Comment 3 Wolfgang Bangerth 2003-05-28 23:27:08 UTC
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]'
Comment 4 Andrew Pinski 2003-08-06 02:43:39 UTC
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.
Comment 5 Andrew Pinski 2003-08-07 22:03:03 UTC
*** Bug 11850 has been marked as a duplicate of this bug. ***
Comment 6 Andrew Pinski 2004-05-07 03:02:43 UTC
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)