[LLVMbugs] [Bug 23597] New: Casting result of side-effecting unary operation to union removes side effecting expression

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 20 13:30:54 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23597

            Bug ID: 23597
           Summary: Casting result of side-effecting unary operation to
                    union removes side effecting expression
           Product: clang
           Version: 3.6
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: colin.gordon at samsung.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14350
  --> https://llvm.org/bugs/attachment.cgi?id=14350&action=edit
Code to reproduce

Overview:
Casting the result of a side-effecting unary expression (e.g., ++) to a union
without using the cast's result removes the side effect.

Steps to reproduce:
1. Compile the attached file, with any optimization level.
2. Run resulting binary.


Actual results:
Prints 0.

Expected results:
Prints 10.

Build Date and Platform:
First observed on:
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

Additional Builds and Platforms:
Also observed on:
clang version 3.6.0 (tags/RELEASE_360/final)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

and:
Ubuntu clang version 3.5.0-4ubuntu2~trusty2 (tags/RELEASE_350/final) (based on
LLVM 3.5.0)
Target: x86_64-pc-linux-gnu
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/20150520/bd84451b/attachment.html>


More information about the llvm-bugs mailing list