public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Chuck Ebbert <76306.1226@compuserve.com>,
	linux-kernel@vger.kernel.org, mbligh@mbligh.org,
	Mattia Dongili <malattia@linux.it>, Andrew Morton <akpm@osdl.org>
Subject: Re: fs/binfmt_aout.o, Error: suffix or operands invalid for  `cmp' [was Re: 2.6.1
Date: Fri, 23 Jun 2006 09:27:59 -0700	[thread overview]
Message-ID: <449C168F.30708@zytor.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0606230456220.1145@gandalf.stny.rr.com>

Steven Rostedt wrote:
>>>
>> It's not (it's #APP, i.e. inline assembly); rather, it's an illegal
>> constraint.
> 
> It's GCC optimizing a little too much.
> 

No, it's not... it's the author of the inline assembly who told gcc a 
lie at what it was allowed to optimize.  The constraint is "g" 
(equivalent to "rmi"), but "rm" is the correct constraint.

There is already a patch in Andrew's repo for this.

 >
> #define __range_ok(addr,size) ({ \
> 	unsigned long flag,sum; \
> 	__chk_user_ptr(addr); \
> 	asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \
> 		:"=&r" (flag), "=r" (sum) \
> 		:"1" (addr),"g" ((int)(size)),"g" (current_thread_info()->addr_limit.seg)); \
> 	flag; })
> 
> What happened was that gcc optimized the
> (current_thread_info()->addre_limit.seg to be a constant. Thus cmpl
> failed.
> 

... perfectly legally so, given the "g" constraint.

	-hpa

  reply	other threads:[~2006-06-23 16:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-22  6:34 fs/binfmt_aout.o, Error: suffix or operands invalid for `cmp' [was Re: 2.6.1 Chuck Ebbert
2006-06-22 15:36 ` H. Peter Anvin
2006-06-23  9:06   ` Steven Rostedt
2006-06-23 16:27     ` H. Peter Anvin [this message]
2006-06-24 11:53       ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=449C168F.30708@zytor.com \
    --to=hpa@zytor.com \
    --cc=76306.1226@compuserve.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malattia@linux.it \
    --cc=mbligh@mbligh.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox