Re: input constraints in atomic.h too loose ?

Mike Frysinger <[email protected]>
Newsgroups gmane.linux.ports.hppa
Organization wh0rd.org
Message-ID <[email protected]>
On Friday 02 February 2007, Mike Frysinger wrote:
> while building glibc-2.5/cvs with gcc-4.1.1, i hit an error about invalid
> operands in the locking code ... looks like the declared constraints for
> the inputs in atomic.h are too loose ?

perhaps we should be using =o instead of =m for the first two constraints ?  
that seems to work for me ...
-mike

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
signature.asc (application/pgp-signature, 827 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.2 (GNU/Linux)

iQIVAwUARc4rvEFjO5/oN/WBAQKLBA//ch1G3huzO7phVdC961+bxRgGzXWsp5ar
FaVTC2v+d1mGu7zy8J4zW35uMH+rikLaAdXJKLvWtni1h5DKpeGZnXSj3g9XU1IR
npsp35muKFFZRvg8RuAS7B4A8WwFV4dbGaRe2tzLu8znN8jdaa35Jzae2xB11F4C
pkUpCLVOYUrfqMXwCRXNMxKAXzri0C4uqF5/OKRyksOK8qlNfwA/41O19FfIAS+8
Ro+BghuK/d0M5XONdHBb2kB/iYvpD62iBxuMsmatrdNDsPx4MmG6J9Yl/Fj4c7WE
pkU9UdpCf2PLjhm2az0I7Ylvv+b2DTwHI253ZwMb7bm5hgawgegQkiIFT7iJi5Vq
QGwQwAoDCjHvdSeJl9b5JTCPWUVVXs9AQHtiz72723qjz2rQg7jmeD0TQcfcwww+
vhPJuyFePGdOmRkT4cZfII8jXu4adVUIGj87n8cLD+LzJNbmlI5UsOQXZvMYkzkN
IRWbEJvdOUl14+vrsmMIX7A7FBkDx+4cdOrW5QAOM3OiGVKBCRzuBf2WkwdxFBgs
VeRy6m5NIxr984AGyE0UVAmaEetKxcISw7IjGBrkXrcgB1WWfGSwAr+q28N+5oSW
HWKp5uSOsHC28yZNLsVeG+MDOCVoEydc+SsuUXhDCqlKyhG3JrqgFRpvgHPm71dJ
Qhw2wa/QzGE=
=BpAA
-----END PGP SIGNATURE-----
glibc-hppa-tighter-atomic-constraints.patch (text/x-diff, 864 B)
With some code compiled with -fPIC -O1, gcc may use a "register(register)"
format when stw can only take "constant(register)" ... so change the
constraint to match this requirement.

2007-02-10  Mike Frysinger  <[email protected]>

	* sysdeps/unix/sysv/linux/hppa/bits/atomic.h
	(atomic_compare_and_exchange_val_acq): Change `m' constraint to an
	`o' memory constraint for first two input operands.

--- ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
+++ ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
@@ -76,7 +76,7 @@ typedef uintmax_t uatomic_max_t;
 	"stw	%%r28, %0			\n\t"			\
         "sub	%%r0, %%r21, %%r21		\n\t"			\
 	"stw	%%r21, %1			\n\t"			\
-	: "=m" (lws_ret), "=m" (lws_errno), "=m" (*mem)			\
+	: "=o" (lws_ret), "=o" (lws_errno), "=m" (*mem)			\
         : "r" (mem), "r" (oldval), "r" (newval)				\
 	: LWS_CLOBBER							\
      );									\
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.