This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
decl_conflicts_with_clobbers_p problem
- From: Gunther Nikl <gni at gecko dot de>
- To: hans-peter dot nilsson at axis dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 13 Mar 2003 10:17:32 +0100
- Subject: decl_conflicts_with_clobbers_p problem
Hello!
I am using a port (not the repository) that uses asm() statements to
access system functions. This is an example how its done (its for m68k):
--cut--
#define LP1NR(offs, name, t1, v1, r1, bt, bn) \
({ \
t1 _##name##_v1 = (v1); \
{ \
register void *const _##name##_bn __asm("a6") = (bn); \
register t1 _n1 __asm(#r1) = _##name##_v1; \
__asm volatile ("jsr a6@(-"#offs":W)" \
: /* no output */ \
: "r" (_##name##_bn), "rf"(_n1) \
: "d0", "d1", "a0", "a1", "fp0", "fp1", "cc", "memory"); \
} \
})
#define SendIO(ioRequest) \
LP1NR(0x1ce, SendIO, struct IORequest *, ioRequest, a1, \
, EXEC_BASE_NAME)
--cut--
The clobber list contains all registers that can be changed by a system
function as defined by the system ABI. In this example the system function
expects its argument in register "a1". Thus the value for _n1 is bound to
register "a1" and passed as an input to the asm() statement. With GCC 3.3
the asm statement is rejected because of overlapping inputs and clobbers :-(
For me the asm statememt looks fine because I must pass the argument in
register "a1" and its correct that the contents of register "a1" cannot be
relied on after the call anymore.
Is the example asm statement wrong or is decl_conflicts_with_clobbers_p()
wrong?
Regards,
Gunther Nikl