<i>We were quite surprised to find a bug in some common code for the NIOS II architecture: we were assuming it would have already been tested on enough platforms and with enough compilers&#x2F;situations to not have such issues.</i><p>I&#x27;m betting on the vast majority of memset() uses being to zero memory, so it might&#x27;ve not been tested much with other fill patterns.<p>Compared to MSVC, I&#x27;ve found GCC&#x27;s inline-assembler feature a huge pain to use correctly and the few times it was needed, I decided to use a separate file with pure Asm instead (also with Intel syntax) and link that in. Supposedly it&#x27;s more powerful, but having to essentially understand part of the register allocation process just to use it is a big turn-off. In contrast, MSVC &quot;just works&quot; --- the syntax is far more pleasant and it seems to know automatically what gets modified by the code you added.<p>I think basic operations like these, bulk fill and copy, are best performed be specific instructions that the hardware can do in the best way for the implementation. The nios2 memset() is over two dozen instructions, most of which are just shuffling bits around. Intel did this right with REP MOVSB&#x2F;STOSB.