diff options
author | Jakub Jelinek <jakub@redhat.com> | 2025-01-10 15:07:41 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2025-01-10 15:07:41 +0100 |
commit | 76b7f60ffdb26c56d2c71bbeddf7da601de0e50e (patch) | |
tree | 2f9fa808c6ea63b1fa2ce8ae6479e2e883cd9609 /gcc/c/c-parser.cc | |
parent | 06c4cf398947b53b4bfc65752f9f879bb2d07924 (diff) | |
download | gcc-76b7f60ffdb26c56d2c71bbeddf7da601de0e50e.zip gcc-76b7f60ffdb26c56d2c71bbeddf7da601de0e50e.tar.gz gcc-76b7f60ffdb26c56d2c71bbeddf7da601de0e50e.tar.bz2 |
c: Fix up expr location for __builtin_stdc_rotate_* [PR118376]
Seems I forgot to set_c_expr_source_range for the __builtin_stdc_rotate_*
case (the other __builtin_stdc_* cases already have it), which means
the locations in expr are uninitialized, sometimes causing ICEs in linemap
code, at other times just valgrind errors about uninitialized var uses.
2025-01-10 Jakub Jelinek <jakub@redhat.com>
PR c/118376
* c-parser.cc (c_parser_postfix_expression): Call
set_c_expr_source_range before break in the __builtin_stdc_rotate_*
case.
* gcc.dg/pr118376.c: New test.
Diffstat (limited to 'gcc/c/c-parser.cc')
-rw-r--r-- | gcc/c/c-parser.cc | 1 |
1 files changed, 1 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; |