This is the mail archive of the gcc-help@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: Problem of inline assembly for branch instruction


Hi,

>> See define_asm_attributes for a way to estimate the length of an inline
>> asm instruction.  

Modifying the define_asm_attributes to maximum possible length of a 
single machine instruction solved the issue. 
Thanks very much for the suggestion.

Thanks & Regards,
Naveen

-----Original Message-----
From: Ian Lance Taylor [mailto:iant@google.com] 
Sent: Wednesday, September 07, 2011 9:54 PM
To: Naveen H. S
Cc: gcc-help@gcc.gnu.org
Subject: Re: Problem of inline assembly for branch instruction

"Naveen H. S" <Naveen.S@kpitcummins.com> writes:

> The branch instruction has been implemented and working as expected. 
> However, it resulted in error while testing an application with inline
> assembly. In the application, the linker calculated length of offset
> from current location to the branch as 24. However, due to some inline
> assembly in between PC and branch location, the offset is more than 32.
> Hence, the linker generates error while linking application.

See define_asm_attributes for a way to estimate the length of an inline
asm instruction.  In the worst case, you can use this to make every
inline asm large enough to force the use of a long branch.

Ian



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