You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Crash in C++-generating back end: GNU statement expression in short-circuited &&/|| operand #577
Originally posted by jakub-labenski November 20, 2026
Issue Summary
The C++-generating back end can crash when the right operand of a
short-circuited && or || contains a GNU statement expression with a
local declaration.
[Front End] This code SHOULD compile with these options.
Additional Details
When the front end folds (0 && x) / (1 || x) to a constant
(exprutil.c), it calls eliminate_stmt_expr_refs_if_operand_dropped() on
the right operand. That removes the source-sequence entries for that operand's
declarations. But in contexts where constant expressions are recorded
(curr_expr_kind_is_one_in_which_const_exprs_are_recorded()), the original
expression is kept as the backing expression, and the C++ generator still
emits it. It then refers to declarations whose entries are gone.
Reproducing (Standard) Configuration(s)
linux-gcc-debug
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
I have checked open issues and existing discussions before filing this report.
The reproducing source code that I have provided does not depend on headers that I have not included with my submission.
I have reduced the reproducing source code to the best of my ability.
I have selected at least one standard configuration or uploaded a non-standard configuration dump.
I understand code shared via this form is NOT confidential.
I have permission to share the reproducing source code and grant permission for the project to use the source code (or derivatives of the source code) to create tests.
I agree that any tests created using the reproducing source code (or deriatives of it) will be licensed under project license unless I included a LICENSE.txt file in my .zip or .tar.gz upload. If I included a LICENSE.txt file, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.
Activity