aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/c/c-parser.cc1
-rw-r--r--gcc/testsuite/gcc.dg/pr118376.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index c46aac5..d2f4591 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -12906,6 +12906,7 @@ c_parser_postfix_expression (c_parser *parser)
expr.value = build2_loc (loc, COMPOUND_EXPR,
TREE_TYPE (expr.value),
instrument_expr, expr.value);
+ set_c_expr_source_range (&expr, loc, close_paren_loc);
break;
}
tree barg1 = arg;
diff --git a/gcc/testsuite/gcc.dg/pr118376.c b/gcc/testsuite/gcc.dg/pr118376.c
new file mode 100644
index 0000000..16b2f54
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr118376.c
@@ -0,0 +1,11 @@
+/* PR c/118376 */
+/* { dg-do compile } */
+/* { dg-options "-Wsign-conversion" } */
+
+unsigned x;
+
+void
+foo ()
+{
+ __builtin_memset (&x, (long long) __builtin_stdc_rotate_right (x, 0), 1);
+} /* { dg-warning "conversion to 'int' from 'long long int' may change the sign of the result" "" { target *-*-* } .-1 } */