Merge pull request #3231 from yebblies/issue12095

Issue 12095 - Wrong code with -O -inline