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]
Other format: [Raw text]

Re: [C++ PATCH] Fix regressions introduced by my PR34094 fix (PR c++/34238, c++/34340)


Jakub Jelinek wrote:

> The following patch (which obsoletes my earlier 34238 patch) fixes all of
> this, but letting cgraph_optimize actually emit all the vars into assembly
> and only checking afterwards if we emitted something we shouldn't, which
> seems to be much more reliable.

The diagnostic is not about what the compiler happens to end up spitting
out; it's about the user's program.  If you do:

  namespace { struct A { static int i; }; }
  static int foo() { return A::i; }

the program is still erroneous, even though the compiler may likely
optimize away foo, and the reference to A::i.  So, I don't think we
should be doing this check after cgraph_optimize.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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