Issue101

Title compiler error with -O3
Priority bug Status resolved
Superseder Nosy List erez, gabi, malte, silvia
Assigned To malte Keywords
Optional summary

Created on 2010-08-04.04:48:45 by malte, last changed by malte.

Messages
msg391 (view) Author: malte Date: 2010-08-04.04:53:33
OK, fixed in r4591.

It was indeed an assertion that was fishy (because in the cases where it'd fire,
it'd dereference the end() of an iterator, which is not allowed); I rephrased it
in a way that should be safe.

@Everyone: I'm just nosying you in case you stumbled over this one before and
wondered about it. I remember seeing this one a couple of times before.
msg390 (view) Author: malte Date: 2010-08-04.04:48:45
The current revision of the code (r4589) fails to compile with gcc 4.4 when
using -O2 and -O3 while *not* defining NDEBUG:

  cc1plus: warnings being treated as errors
  landmarks/landmarks_graph.cc: In member function β€˜int
  LandmarksGraph::loop_acyclic_graph(LandmarkNode&,
  __gnu_cxx::hash_set<LandmarkNode*, hash_pointer,
  std::equal_to<LandmarkNode*>, std::allocator<LandmarkNode*> >&)’:
  landmarks/landmarks_graph.cc:909: error: dereferencing pointer β€˜<anonymous>’
  does break strict-aliasing rules
  /usr/include/c++/4.4/bits/stl_list.h:138: note: initialized from here
  make: *** [obj/landmarks/landmarks_graph.o] Error 1

I remember seeing this before; I think there's an assertion there that the
optimizer gets confused about. This doesn't affect us right now because we only
define -O3 together with NDEBUG, but it tripped me up while I was trying out
various optimization options related to issue85.
History
Date User Action Args
2010-08-04 04:53:33maltesetstatus: in-progress -> resolved
nosy: + erez, gabi, silvia
messages: + msg391
2010-08-04 04:48:45maltecreate