------- Comment #12 from marc dot glisse at normalesup dot org  2009-07-16 
20:34 -------
(In reply to comment #11)
> for this memset call, which looks correct to me.  The st %g1, [%i0+%l5] line
> stores to %i0 a[n-1] and memset is called with memset (a, 0, (n + 0x3fffffffU)
> << 2);  So, if this doesn't work (and you see the same), you hit a bug in
> Solaris memset implementation, which doesn't handle properly length with
> garbage in upper 32-bits, guess it could use brz,pn %o2, do_nothing or
> something similar, which is fine for 64-bit code, but certainly not for 32-bit
> code.

The sun4v implementation in opensolaris looks fine (but may not have been
backported to solaris 10). The following one on the other hand seems to use the
same brnz for 32 and 64 bit code:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/sparc_hwcap1/common/gen/memset.s#88

It would be good to know which implementation is used...


-- 

marc dot glisse at normalesup dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marc dot glisse at
                   |                            |normalesup dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40757

Reply via email to