This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: MEM/u trouble


    I thought that (mem (addressof ())) means a stack slot has not been
    assigned for it yet and it is unclear whether it is actually needed,

Only if what's inside the ADDRESSOF is a REG, not a MEM.

    so IMHO clearing the /u flag should just kill it for all mems for that
    addressof and nothing else.

No, because the stack slot will be created from the type of the variable,
and so the /u will be determined that way.

    In
      foo(const K x) : h(x) {}
    x is a const variable (so its VAR_DECLs DECL_RTL got /u) and is addressable
    (so it was put_var_into_stack() and got assigned a
    (addressof:SI (reg/v/u:SI 63) 62 0x401d5888)).

    x is being initialized from a temporary variable (surrounded by
    TARGET_EXPR) and expand_expr in the TARGET_EXPR case decides it can
    optimize things by simply initializing the temporary variable at the
    location of x (and thus avoid copying). But the temporary variable is
    not const whyle x is.

I'm sorry: I still don't follow.  It looks like TARGET_EXPR looks at DECL_RTL,
which should have been set properly.  Remember that I don't know C++, so
you have to explain this just in terms of the defined tree and RTL.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]