title: Can compiler optimization introduce bugs?
body: <p>Today I had a discussion with a friend of mine and we debated for a couple of hours about "compiler optimization".</p>
  
  <p>I defended the point that <strong>sometimes</strong>, a compiler optimization might introduce bugs or at least, undesired behavior.</p>
  
  <p>My friend totally disagreed, saying that "compilers are built by smart people and do smart things" and thus, can <strong>never</strong> go wrong.</p>
  
  <p>He didn't convince me at all, but I have to admit I lack of real-life examples to strengthen my point.</p>
  
  <p>Who is right here? If I am, do you have any real-life example where a compiler optimization produced a bug in the resulting software? If I'm mistaking, should I stop programming and learn fishing instead?</p>