diff mbox

[middle-end] : Fix PR/48814 - [4.4/4.5/4.6/4.7 Regression] Incorrect scalar increment result

Message ID CAEwic4ay8tUMkvKbLz7JiU19nPaSgv8fCxYjZc2yQxq-3d4G0w@mail.gmail.com
State New
Headers show

Commit Message

Kai Tietz Jan. 8, 2012, 12:04 p.m. UTC
Hi,

this patch makes sure that for increment of
postfix-increment/decrement we use also orignal lvalue instead of tmp
lhs value for increment.  This fixes reported issue about sequence
point in PR/48814

ChangeLog

2012-01-08  Kai Tietz  <ktietz@redhat.com>

          PR middle-end/48814
          * gimplify.c (gimplify_self_mod_expr): Use for
postfix-inc/dec lvalue instead of temporary
          lhs.

Regression tested for x86_64-unknown-linux-gnu for all languages
(including Ada and Obj-C++).  Ok for apply?

Regards,
Kai
diff mbox

Patch

Index: gimplify.c
===================================================================
--- gimplify.c  (revision 182720)
+++ gimplify.c  (working copy)
@@ -2258,7 +2258,7 @@ 
       arith_code = POINTER_PLUS_EXPR;
     }

-  t1 = build2 (arith_code, TREE_TYPE (*expr_p), lhs, rhs);
+  t1 = build2 (arith_code, TREE_TYPE (*expr_p), lvalue, rhs);

   if (postfix)
     {