https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118457
Bug ID: 118457 Summary: OpenMP: refactor/move dispatch construct handling to get rid of "sorry" Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: sandra at gcc dot gnu.org Target Milestone: --- Some recent commits have added large blocks of code to gimplify_call_expr() in gimplify.cc to handle the OpenMP dispatch directive and its adjust_args/append_args clauses. In parallel with that, I have prepared a set of complicated patches that (among other things) adds support for dynamic selectors in "declare variant". In this case the gimplifier replaces the original CALL_EXPR with a conditional tree expression that has to be re-gimplified, bypassing the newly-added code for the dispatch directive that assumes only the function in the original CALL_EXPR has been replaced. Presently a "sorry" is given for this case. IMO the "right" solution is to refactor the dispatch-related code by pulling it out of gimplify_call_expr() into a separate function, and instead do the adjust_args/append_args clauses at the point the new call exprs are constructed, in gimplify_variant_call_expr().