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

--- Comment #2 from Jan-Benedict Glaw <jbg...@lug-owl.de> ---
This is gas's tc-vax.c:

3158                           if ((is_absolute) && (expP->X_op != O_big))
3159                             {
3160                               /* If nbytes > 4, then we are scrod. We
3161                                  don't know if the high order bytes
3162                                  are to be 0xFF or 0x00.  BSD4.2 & RMS
3163                                  say use 0x00. OK --- but this
3164                                  assembler needs ANOTHER rewrite to
3165                                  cope properly with this bug.  */
3166                               md_number_to_chars (p + 1, this_add_number,
3167                                                   min (sizeof (valueT),
3168                                                        (size_t) nbytes));
3169                               if ((size_t) nbytes > sizeof (valueT))
3170                                 memset (p + 1 + sizeof (valueT),
3171                                         '\0', nbytes - sizeof (valueT));
3172                             }
[...]

This is for "small" values (ie. "-1" fitting in a 32bit valueT) and it doesn't
properly sign-extend in this case. Taking into account the next couple lines
(not shown here), this part of the code needs to rethought.

A workaround would be to actually place an all-hex value (through GCC) here,
but that wouldn't fix gas for any hand-written assembler.

Reply via email to