Bug 12590 - inline asm impossible constraint in `asm'
Summary: inline asm impossible constraint in `asm'
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.3.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-12 18:03 UTC by giffordj
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Preprocessed Source (233.18 KB, application/octet-stream)
2003-10-15 16:14 UTC, giffordj
Details

Note You need to log in before you can comment on or make changes to this bug.
Description giffordj 2003-10-12 18:03:35 UTC
Compiles fine with no -O, but gives impossible constraint in `asm' when 
compiled with -O2 or -O3.

Code

inline jlong atomic::compare_and_exchange_long(jlong exchange_value, jlong*
dest, jlong compare_value) {
  jlong old_value;
  __asm__ volatile (  "pushl %%ebx;mov 4+%1,%%ecx;mov
%1,%%ebx;lock;cmpxchg8b (%3);popl %%ebx"
                    : "=A" (old_value)
                    : "o" (exchange_value), "A" (compare_value), "r" (dest)
                    : "%ebx", "%ecx", "memory");
  return old_value;
}
Comment 1 Andrew Pinski 2003-10-15 02:06:13 UTC
We need a full test case, read <http://gcc.gnu.org/bugs.html>
Comment 2 giffordj 2003-10-15 16:14:32 UTC
Created attachment 4938 [details]
Preprocessed Source
Comment 3 giffordj 2003-10-15 16:15:06 UTC
Error Messages

/usr/src/java/hotspot/src/os_cpu/linux_i486/vm/atomic_linux_i486.inline.hpp: In
   function `jboolean JVM_CX8Field(JNIEnv*, _jobject*, _jfieldID*, long long
   int, long long int)':
/usr/src/java/hotspot/src/os_cpu/linux_i486/vm/atomic_linux_i486.inline.hpp:50:
 error: impossible
   constraint in `asm'
Comment 4 Andrew Pinski 2003-10-15 19:29:41 UTC
Marking invalid to mark it as ...
Comment 5 Andrew Pinski 2003-10-15 19:29:55 UTC
unconfirmed.
Comment 6 Andrew Pinski 2003-10-18 17:34:33 UTC
The problem is with the "o" constriant, if I change it to m (which looks better and is right 
constraint to use in this case because the memory location could be any where).