From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23113 invoked by alias); 28 Nov 2012 09:27:46 -0000 Received: (qmail 22587 invoked by uid 55); 28 Nov 2012 09:27:19 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/35634] [4.6/4.7/4.8 Regression] operand of pre-/postin-/decrement not promoted Date: Wed, 28 Nov 2012 09:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: major X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.4 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg02684.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35634 --- Comment #37 from Richard Biener 2012-11-28 09:27:14 UTC --- Author: rguenth Date: Wed Nov 28 09:27:10 2012 New Revision: 193882 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193882 Log: 2012-11-28 Richard Biener PR c/35634 * gimple.h (gimplify_self_mod_expr): Declare. * gimplify.c (gimplify_self_mod_expr): Export. Take a different type for performing the arithmetic in. (gimplify_expr): Adjust. * tree-vect-loop-manip.c (vect_can_advance_ivs_p): Strip sign conversions we can re-apply after adjusting the IV. c-family/ * c-gimplify.c (c_gimplify_expr): Gimplify self-modify expressions here and use a type with proper overflow behavior for types that would need to be promoted for the arithmetic. * gcc.dg/torture/pr35634.c: New testcase. * g++.dg/torture/pr35634.C: Likewise. * gcc.dg/vect/pr18536.c: Mark worker function noinline. Added: trunk/gcc/testsuite/g++.dg/torture/pr35634.C trunk/gcc/testsuite/gcc.dg/torture/pr35634.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c-gimplify.c trunk/gcc/gimple.h trunk/gcc/gimplify.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/vect/pr18536.c trunk/gcc/tree-vect-loop-manip.c