[cfe-dev] Bug fix for ++/-- with -ftrapv

David Keaton dmk at dmk.com
Thu Aug 5 06:53:56 PDT 2010


      The ++/-- operators are currently broken when -ftrapv is turned 
on.  I have attached a program that demonstrates the bug.  (I most 
recently demonstrated this in r110329.)

      The cause is simple.  In 
ScalarExprEmitter::EmitScalarPrePostIncDec() when -ftrapv is enabled, 
the incremented value is returned instead of being passed to the coded 
that stores the incremented value and decides which value to return.  I 
have attached the fix.

					David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prepost.c
Type: text/x-csrc
Size: 566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100805/cbf125c7/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang_lib_CodeGen.diff
Type: text/x-patch
Size: 419 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100805/cbf125c7/attachment.bin>


More information about the cfe-dev mailing list