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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
#3  0x0000000000d0a0bf in expand_asm_stmt (stmt=0x7ffff667f0b0)
    at /home/rguenther/src/gcc3/gcc/cfgexpand.cc:3332
3332              op = assign_temp (type, 0, 1);
...
3287             allows a register, make a temporary to act as an intermediate.
3288             Make the asm insn write into that, then we will copy it to
3289             the real output operand.  Likewise for promoted variables.  */
3290
3291          generating_concat_p = 0;
3292
3293          if ((TREE_CODE (val) == INDIRECT_REF && allows_mem)
3294              || (DECL_P (val)
3295                  && (allows_mem || REG_P (DECL_RTL (val)))
3296                  && ! (REG_P (DECL_RTL (val))
(gdb) p allows_mem
$1 = true
(gdb) p val
$2 = <mem_ref 0x7ffff6650eb0>

looks like a remanent from before MEM_REF times?

diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc
index 87536ec7ccd..9b5c953fe22 100644
--- a/gcc/cfgexpand.cc
+++ b/gcc/cfgexpand.cc
@@ -3290,7 +3290,7 @@ expand_asm_stmt (gasm *stmt)

       generating_concat_p = 0;

-      if ((TREE_CODE (val) == INDIRECT_REF && allows_mem)
+      if ((TREE_CODE (val) == MEM_REF && allows_mem)
          || (DECL_P (val)
              && (allows_mem || REG_P (DECL_RTL (val)))
              && ! (REG_P (DECL_RTL (val))

fixes this, not sure how "careful" we want to be here (TARGET_MEM_REF?
What about other tcc_reference codes?).

I'm going to test REFERENCE_CLASS_P.

Reply via email to