This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Request for discussion: Rewrite of inline assembler docs


dw <limegreensocks@yahoo.com> writes:
>
> What would you say to something like this:
>
> "Since GCC does not parse the asm, it has no visibility of any static
> variables or functions it references.  This may result in those
> symbols getting discarded by GCC as unused.  To avoid this problem,
> list the symbols as inputs or outputs."

output makes no sense I think, only input.

You still need the part about the top-level asm, where input
doesn't work.

>
>> And another common problem:
>>
>> For top level asm there is no guarantee the compiler outputs the
>> statements in order.
>
> Well, basic asm (which is the only thing you can use at top level)
> already says:
>
> "Do not expect a sequence of |asm| statements to remain perfectly
> consecutive after compilation. To ensure that assembler instructions
> maintain their order, use a single |asm| statement containing multiple
> instructions. Note that GCC's optimizer can move |asm| statements
> relative to other code, including across jumps. "
>
> Is something more needed?

Yes it should be made clear that this applies to top-level asm
too.

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]