https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87984

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
The "issue" of GIMPLE is that while it treats local reg vars as "memory":

  # .MEM_11 = VDEF <.MEM_2>
  a = 1;
  # VUSE <.MEM_11>
  __asm__("add %1, %0" : "=g" o_16 : "r" a, "0" o_13);

it doesn't "properly" translate asm constraints mentioning only architectural
register names to alias that "memory:

  __asm__ __volatile__("xor %%eax, %%eax" :  :  : "eax");

(this one is missing a virtual operand).  We'd have to consider this kind
of "registers" memory.  Currently we have

  /* Clobber all memory and addressable symbols for asm ("" : : : "memory"); 
*/
  if (gimple_asm_clobbers_memory_p (stmt))
    add_virtual_operand (fn, stmt, opf_def);

that would need to include walking all local and global reg vars and
architecturally comparing the underlying register.  Note how
compare_base_decls "gives up" for local reg vars unless the register
specifier is byte-for-byte the same (so it can identify some must-alias
cases but never no-alias ones).

Elsewhere people have asked for better (gimple) asm optimizations with
regard to alias analysis - currently the precision is at the virtual
operand level.

Reply via email to