This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/58943] [4.7/4.8/4.9 Regression] wrong calculation of indirect structure member arithmetic via function call


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58943

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Jan 15 08:03:53 2014
New Revision: 206620

URL: http://gcc.gnu.org/viewcvs?rev=206620&root=gcc&view=rev
Log:
    PR c/58943
    * c-typeck.c (build_modify_expr): For lhs op= rhs, if rhs has side
    effects, preevaluate rhs using SAVE_EXPR first.

    * c-omp.c (c_finish_omp_atomic): Set in_late_binary_op around
    build_modify_expr with non-NOP_EXPR opcode.  Handle return from it
    being COMPOUND_EXPR.
    (c_finish_omp_for): Handle incr being COMPOUND_EXPR with first
    operand a SAVE_EXPR and second MODIFY_EXPR.

    * gcc.c-torture/execute/pr58943.c: New test.
    * gcc.dg/tree-ssa/ssa-fre-33.c (main): Avoid using += in the test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr58943.c
Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-omp.c
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-33.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]