[LLVMbugs] [Bug 17407] New: executable behaves differently with -O0 and -O1 (and higher)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Sep 29 22:24:18 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17407

            Bug ID: 17407
           Summary: executable behaves differently with -O0 and -O1 (and
                    higher)
           Product: clang
           Version: 3.1
          Hardware: PC
                OS: other
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: artasano at sbcglobal.net
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11300
  --> http://llvm.org/bugs/attachment.cgi?id=11300&action=edit
the source code to reproduce the issue.

With the attached source, the generated executable behaves correctly with -O0
switch, but behaves incorrectly with -O1 or higher.

If it worked correctly, you see 'GOOD - thrown Actual value [print()] did not
match [zzz]'
If not, you see 'BAD - did not throw'

I tried to simplify the code for ease of investigation, but this is what as far
as I could go.

There are many trials in the source code.
If I change just one of '// reprodices' sections with '// works' alternative,
it works.

I think the key is at line 80 'catch (const Exception&)'.
If I replace it with 'catch (Exception)', it works.

$ clang++ --version
clang version 3.1 (branches/release_31)
Target: i386-pc-cygwin
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130930/b12e433e/attachment.html>


More information about the llvm-bugs mailing list