[Bug target/100936] %p and %P modifiers should not emit segment overrides
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jun 9 07:46:54 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100936
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:
https://gcc.gnu.org/g:267dbd42f42c52a515f49c0875d296a9cf5988fe
commit r12-1318-g267dbd42f42c52a515f49c0875d296a9cf5988fe
Author: Uros Bizjak <ubizjak@gmail.com>
Date: Wed Jun 9 09:46:00 2021 +0200
i386: Do not emit segment overrides for %p and %P [PR100936]
Using %p to move the address of a symbol using LEA:
asm ("lea %p1, %0" : "=r"(addr) : "m"(var));
emits assembler warning when VAR is declared in a non-generic address
space:
Warning: segment override on `lea' is ineffectual
The problem is with %p operand modifier, which should emit raw symbol name:
p -- print raw symbol name.
Similar problem exists with %P modifier, trying to CALL or JMP to an
overridden symbol,e.g:
call %gs:zzz
jmp %gs:zzz
emits assembler warning:
Warning: skipping prefixes on `call'
Warning: skipping prefixes on `jmp'
Ensure that %p and %P never emit segment overrides.
2021-06-08 Uroš Bizjak <ubizjak@gmail.com>
gcc/
PR target/100936
* config/i386/i386.c (print_operand_address_as): Rename "no_rip"
argument to "raw". Do not emit segment overrides when "raw" is
true.
gcc/testsuite/
PR target/100936
* gcc.target/i386/pr100936.c: New test.
More information about the Gcc-bugs
mailing list