[Bug inline-asm/87984] [7/8/9 Regression] wrong code for local reg var input to asm
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 8 17:35:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87984
--- Comment #24 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
FRE doesn't, as that breaks the #c9 testcase.
a = 1;
__asm__("add %1, %0" : "=r" o_12 : "r" a, "0" 0);
__asm__ __volatile__("xor %%eax, %%eax" : : : "eax");
i_13 = 1;
a = 1;
__asm__("add %1, %0" : "=r" o_18 : "r" a, "0" o_12);
__asm__ __volatile__("xor %%eax, %%eax" : : : "eax");
i_19 = 2;
a = 1;
__asm__("add %1, %0" : "=r" o_24 : "r" a, "0" o_18);
__asm__ __volatile__("xor %%eax, %%eax" : : : "eax");
i_25 = 3;
to:
a = 1;
__asm__("add %1, %0" : "=r" o_12 : "r" a, "0" 0);
__asm__ __volatile__("xor %%eax, %%eax" : : : "eax");
__asm__("add %1, %0" : "=r" o_18 : "r" a, "0" o_12);
__asm__ __volatile__("xor %%eax, %%eax" : : : "eax");
__asm__("add %1, %0" : "=r" o_24 : "r" a, "0" o_18);
__asm__ __volatile__("xor %%eax, %%eax" : : : "eax");
If SCCVN would never record values for DECL_HARD_REGISTER vars or something
similar, it wouldn't do this.
More information about the Gcc-bugs
mailing list