From patchwork Sun Jan 8 12:04:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 134900 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 43CF9B6F69 for ; Sun, 8 Jan 2012 23:05:12 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1326629114; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=elv9h1Y BJnfoy2rjnft5D9lh9WM=; b=HtlsQxdPpblix7F1zsQUBCyPN18iHgFA9IgV0mB 1S8YyGSKr8EIADwv4VpoNScSchHSXWT8pEmLaeB/e48B5wuaqNz3Tpdfg/ky+w1G 7IVsNHjN7F/tD61k23DQy00BbnmZVp96K24+XjEF/Td6xYepNuI9uqRgFI9xzoyW ANrk= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=FKhVuibowiBDDbW1zJFxvgHH+wwun4DoYx9b8WHcFIYZ3alv2/0fJxesqw1lQW qusSntvAXtipWRSq+ocXkyeLu62pYjCP2UI/yY7rq91nxOpfx/fc5iVtKEnG92tG MO9j2/BZ/AbKwKbnDH+9Z0JreE9iImLqLtP73l7Xv6A5A=; Received: (qmail 5243 invoked by alias); 8 Jan 2012 12:05:03 -0000 Received: (qmail 5176 invoked by uid 22791); 8 Jan 2012 12:05:01 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-tul01m020-f175.google.com (HELO mail-tul01m020-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Jan 2012 12:04:49 +0000 Received: by obcwn6 with SMTP id wn6so3421924obc.20 for ; Sun, 08 Jan 2012 04:04:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.15.104 with SMTP id w8mr3129175obc.20.1326024288291; Sun, 08 Jan 2012 04:04:48 -0800 (PST) Received: by 10.182.60.232 with HTTP; Sun, 8 Jan 2012 04:04:48 -0800 (PST) Date: Sun, 8 Jan 2012 13:04:48 +0100 Message-ID: Subject: [patch middle-end]: Fix PR/48814 - [4.4/4.5/4.6/4.7 Regression] Incorrect scalar increment result From: Kai Tietz To: GCC Patches Cc: Richard Guenther X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 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 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) {