Re: fs/binfmt_aout.o, Error: suffix or operands invalid for `cmp'[was Re: 2.6.1

From: Steven Rostedt
Date: Sat Jun 24 2006 - 07:52:33 EST



On Fri, 23 Jun 2006, H. Peter Anvin wrote:

> 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...

Yes it is! Calm down, I didn't say it was GCC's fault!

> 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.

And this is why it over optimized. It was the fault of the inline
assembly author. He/she gave it the wrong constraint and this was
the reason for GCC over optimizing. If it didn't over optimize than
it would have worked. But the bug is with the code and not GCC.

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

Then this is all OK.

>
> >
> > #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.
>

I never said it wasn't legal.

-- Steve

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/