LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-19-2012, 06:49 PM   #1
jimmy123
LQ Newbie
 
Registered: Jan 2012
Posts: 13

Rep: Reputation: Disabled
Unhappy Error: Incorrect register `%rcx' used with `l' suffix.


I program the following code and compiling

MLX_ATOM_CAS_RET_T mlxAtomCas(MLX_ATOM_T * v, UINT64 cmp, UINT64 val)
{

UINT64 readval;
char ret;

__asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0"
: "=q" (ret), "=m" (v->counter), "=a" (readval)
: "r" (val), "m" (v->counter), "a" (cmp) : "memory");

}

When cmp, val, readval are 64bit ,copiler will send the following message

/tmp/ccKo6DJc.s: Assembler messages:
/tmp/ccKo6DJc.s:1391: Error: Incorrect register `%rcx' used with `l' suffix.

If cmp , val,readval are 32bit, it won't.

How to solves this problems?

Thank you very much~
 
Old 01-19-2012, 11:12 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,863
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Tried statement cmpxchg (without 'l') or cmpxchg8b yet?
 
1 members found this post helpful.
Old 01-19-2012, 11:34 PM   #3
jimmy123
LQ Newbie
 
Registered: Jan 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Wink

Quote:
Originally Posted by NevemTeve View Post
Tried statement cmpxchg (without 'l') or cmpxchg8b yet?
It works, Thanks~
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
glibc in capter 6 -- error: cannot compute suffix of object files Yoyo302 Linux From Scratch 23 05-21-2010 08:28 AM
error when compiling VPNC: "Incorrect register `%rdx' used with `l' suffix" flowher Slackware 0 03-11-2010 03:03 PM
GCC error cannot compute suffix of object files orcaja Linux - Software 1 08-25-2008 12:55 PM
Error: suffix or operands invalid for `push' in 64 machine arya Linux - General 1 04-19-2007 10:32 AM
configure error : cannot compute suffix of object files status1 Linux From Scratch 1 10-14-2006 10:18 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration