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++/81408] Lots of new -Wunsafe-loop-optimizations warnings with 7 compared to 6


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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-07-12
                 CC|                            |amker at gcc dot gnu.org,
                   |                            |glisse at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, I reduced one test-case:

$ cat pr81408.ii
template <typename b, typename> class d
{
  b e;

public:
  int operator* () {}
  void operator++ () { ++e; }
  b
  base ()
  {
    return e;
  }
};
template <typename f, typename g, typename h>
bool
operator!= (d<f, h> i, d<g, h> j)
{
  return i.base () - j.base ();
}
template <typename> class k;
template <typename> struct m;
template <typename a> struct m<k<a>>
{
  using l = a *;
};
struct p : m<k<int>>
{
  d<l, int> begin ();
  d<l, int> end ();
} n;
void
o ()
{
  for (auto c : n)
    ;
}

Which started to be recognized with r242638. And I also noticed the original
unreduced test-case started to be diagnosed with r238641.
That said it's probably better optimizer work that shows more warnings, am I
right?

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