This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c++/55619] [4.8 Regression] Chromium build fails with: error: memory input is not directly addressable


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55619

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-10 10:51:21 UTC ---
>From what I can see, the C++ FE always did what it does now, i.e. even in only
"m" inputs fold the const value into its initializer.  GCC up to 3.2 was
supporting pushing constants into constant pool without a warning, 3.3/3.4
emitted a deprecation warning on that
warning: use of memory input without lvalue in asm operand 0 is deprecated
and finally from 4.0 onwards this is a hard error.
In this light, the user inline asm could be considered invalid.

Perhaps the C++ FE could be changed, in finish_asm_stmt:

          constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t)));
          operand = decay_conversion (TREE_VALUE (t), tf_warning_or_error);

          /* If the type of the operand hasn't been determined (e.g.,
             because it involves an overloaded function), then issue
             an error message.  There's no context available to
             resolve the overloading.  */
          if (TREE_TYPE (operand) == unknown_type_node)
            {
              error ("type of asm operand %qE could not be determined",
                     TREE_VALUE (t));
              operand = error_mark_node;
            }

          if (parse_input_constraint (&constraint, i, ninputs, noutputs, 0,
                                      oconstraints, &allows_mem, &allows_reg))
            {
              /* If the operand is going to end up in memory,
                 mark it addressable.  */
              if (!allows_reg && allows_mem)
                {
                  /* Strip the nops as we allow this case.  FIXME, this really
                     should be rejected or made deprecated.  */
                  STRIP_NOPS (operand);
                  if (!cxx_mark_addressable (operand))
                    operand = error_mark_node;
                }
            }
          else
            operand = error_mark_node;

perhaps parse_input_constraint could be done before decay_conversion (and just
remember its return value in a bool), if it returned true and !allows_reg &&
allows_mem, we would need to use some other *_conversion instead of
decay_conversion that wouldn't fold it into a constant and thus make something
originally potentially addressable into something non-addressable.
No idea what function would that be though.  Worst case parse it as if it was
surrounded by implicit & and then dereference the result?  That could generate
different and less clear diagnostics though.


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