Commit 2994fb91 by Marek Polacek Committed by Marek Polacek

re PR c/68907 (bogus warning: right-hand operand of comma expression has no…

re PR c/68907 (bogus warning: right-hand operand of comma expression has no effect on an atomic_int preincrement)

	PR c/68907
	* c-typeck.c (build_atomic_assign): Set TREE_NO_WARNING on an
	artificial decl.

	* gcc.dg/pr68907.c: New test.

From-SVN: r231656
parent 4a38b02b
2015-12-15 Marek Polacek <polacek@redhat.com>
PR c/68907
* c-typeck.c (build_atomic_assign): Set TREE_NO_WARNING on an
artificial decl.
2015-12-08 David Malcolm <dmalcolm@redhat.com>
* c-parser.c (c_parser_alignof_expression): Capture location of
......
......@@ -3814,6 +3814,7 @@ build_atomic_assign (location_t loc, tree lhs, enum tree_code modifycode,
newval = create_tmp_var_raw (nonatomic_lhs_type);
newval_addr = build_unary_op (loc, ADDR_EXPR, newval, 0);
TREE_ADDRESSABLE (newval) = 1;
TREE_NO_WARNING (newval) = 1;
loop_decl = create_artificial_label (loc);
loop_label = build1 (LABEL_EXPR, void_type_node, loop_decl);
......
2015-12-15 Marek Polacek <polacek@redhat.com>
PR c/68907
* gcc.dg/pr68907.c: New test.
2015-12-15 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
* gfortran.dg/coarray_critical_1.f90: New.
......
/* PR c/60195 */
/* { dg-do compile } */
/* { dg-options "-std=c11 -Wpedantic -Wall" } */
_Atomic int a;
void
fn (void)
{
++a;
a++;
--a;
a--;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment