From: Eric Botcazou Date: Mon, 22 Dec 2025 22:46:53 +0000 (+0100) Subject: Ada: Fix ICE in fld_incomplete_type_of when building GtkAda with LTO (3) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a37bb38838172db59abe4dc48eb2a120d9c295e5;p=thirdparty%2Fgcc.git Ada: Fix ICE in fld_incomplete_type_of when building GtkAda with LTO (3) This streamlines the code by using a ternary expression. gcc/ada/ PR ada/123060 * gcc-interface/utils.cc (update_pointer_to): Streamline. --- diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc index 9176ec29d56..4f0bdec022e 100644 --- a/gcc/ada/gcc-interface/utils.cc +++ b/gcc/ada/gcc-interface/utils.cc @@ -4689,11 +4689,10 @@ update_pointer_to (tree old_type, tree new_type) && !lookup_attribute ("may_alias", TYPE_ATTRIBUTES (new_type)))) { - alias_set_type set; - if (TYPE_STRUCTURAL_EQUALITY_P (old_ptr)) - set = TYPE_ALIAS_SET (old_ptr); - else - set = TYPE_ALIAS_SET (TYPE_CANONICAL (old_ptr)); + const alias_set_type set + = TYPE_STRUCTURAL_EQUALITY_P (old_ptr) + ? TYPE_ALIAS_SET (old_ptr) + : TYPE_ALIAS_SET (TYPE_CANONICAL (old_ptr)); TYPE_CANONICAL (old_ptr) = build_pointer_type (TYPE_CANONICAL (new_type)); TYPE_ALIAS_SET (TYPE_CANONICAL (old_ptr)) = set; @@ -4734,11 +4733,10 @@ update_pointer_to (tree old_type, tree new_type) && !lookup_attribute ("may_alias", TYPE_ATTRIBUTES (new_type)))) { - alias_set_type set; - if (TYPE_STRUCTURAL_EQUALITY_P (old_ref)) - set = TYPE_ALIAS_SET (old_ref); - else - set = TYPE_ALIAS_SET (TYPE_CANONICAL (old_ref)); + const alias_set_type set + = TYPE_STRUCTURAL_EQUALITY_P (old_ref) + ? TYPE_ALIAS_SET (old_ref) + : TYPE_ALIAS_SET (TYPE_CANONICAL (old_ref)); TYPE_CANONICAL (old_ref) = build_reference_type (TYPE_CANONICAL (new_type)); TYPE_ALIAS_SET (TYPE_CANONICAL (old_ref)) = set;