public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/29154] [4.0/4.1/4.2 Regression] *(* ppointer++)++ = *pointer++ generates bad code Date: Fri, 22 Sep 2006 20:25:00 -0000 [thread overview] Message-ID: <20060922202531.20743.qmail@sourceware.org> (raw) In-Reply-To: <bug-29154-13237@http.gcc.gnu.org/bugzilla/> ------- Comment #3 from jakub at gcc dot gnu dot org 2006-09-22 20:25 ------- I wonder if we just shouldn't ensure that for postfix exprs post_p statements of the inner expression are put after, not before the +=/-=. Something like: --- gimplify.c.jj2 2006-09-02 08:47:25.000000000 +0200 +++ gimplify.c 2006-09-22 22:21:29.000000000 +0200 @@ -1896,7 +1896,7 @@ gimplify_self_mod_expr (tree *expr_p, tr bool want_value) { enum tree_code code; - tree lhs, lvalue, rhs, t1; + tree lhs, lvalue, rhs, t1, post = NULL, *orig_post_p = post_p; bool postfix; enum tree_code arith_code; enum gimplify_status ret; @@ -1913,6 +1913,9 @@ gimplify_self_mod_expr (tree *expr_p, tr else postfix = false; + if (postfix) + post_p = &post; + /* Add or subtract? */ if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) arith_code = PLUS_EXPR; @@ -1943,7 +1946,8 @@ gimplify_self_mod_expr (tree *expr_p, tr if (postfix) { - gimplify_and_add (t1, post_p); + gimplify_and_add (t1, orig_post_p); + append_to_statement_list (post, orig_post_p); *expr_p = lhs; return GS_ALL_DONE; } -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dnovillo at redhat dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29154
next prev parent reply other threads:[~2006-09-22 20:25 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-09-20 18:01 [Bug c/29154] New: " ansak at bigfoot dot com 2006-09-20 18:47 ` [Bug c/29154] " pinskia at gcc dot gnu dot org 2006-09-21 9:12 ` [Bug c/29154] [4.0/4.1/4.2 Regression] " rguenth at gcc dot gnu dot org 2006-09-22 7:30 ` pinskia at gcc dot gnu dot org 2006-09-22 20:25 ` jakub at gcc dot gnu dot org [this message] 2006-09-23 10:33 ` rguenth at gcc dot gnu dot org 2006-10-01 22:57 ` mmitchel at gcc dot gnu dot org 2006-10-02 6:12 ` jakub at gcc dot gnu dot org 2006-10-02 6:24 ` jakub at gcc dot gnu dot org 2006-10-02 6:28 ` [Bug c/29154] [4.0 " jakub at gcc dot gnu dot org 2007-02-03 20:18 ` gdr at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20060922202531.20743.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).