Skip to content

Commit a37bb38

Browse files
committed
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.
1 parent c368ea5 commit a37bb38

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

gcc/ada/gcc-interface/utils.cc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4689,11 +4689,10 @@ update_pointer_to (tree old_type, tree new_type)
46894689
&& !lookup_attribute ("may_alias",
46904690
TYPE_ATTRIBUTES (new_type))))
46914691
{
4692-
alias_set_type set;
4693-
if (TYPE_STRUCTURAL_EQUALITY_P (old_ptr))
4694-
set = TYPE_ALIAS_SET (old_ptr);
4695-
else
4696-
set = TYPE_ALIAS_SET (TYPE_CANONICAL (old_ptr));
4692+
const alias_set_type set
4693+
= TYPE_STRUCTURAL_EQUALITY_P (old_ptr)
4694+
? TYPE_ALIAS_SET (old_ptr)
4695+
: TYPE_ALIAS_SET (TYPE_CANONICAL (old_ptr));
46974696
TYPE_CANONICAL (old_ptr)
46984697
= build_pointer_type (TYPE_CANONICAL (new_type));
46994698
TYPE_ALIAS_SET (TYPE_CANONICAL (old_ptr)) = set;
@@ -4734,11 +4733,10 @@ update_pointer_to (tree old_type, tree new_type)
47344733
&& !lookup_attribute ("may_alias",
47354734
TYPE_ATTRIBUTES (new_type))))
47364735
{
4737-
alias_set_type set;
4738-
if (TYPE_STRUCTURAL_EQUALITY_P (old_ref))
4739-
set = TYPE_ALIAS_SET (old_ref);
4740-
else
4741-
set = TYPE_ALIAS_SET (TYPE_CANONICAL (old_ref));
4736+
const alias_set_type set
4737+
= TYPE_STRUCTURAL_EQUALITY_P (old_ref)
4738+
? TYPE_ALIAS_SET (old_ref)
4739+
: TYPE_ALIAS_SET (TYPE_CANONICAL (old_ref));
47424740
TYPE_CANONICAL (old_ref)
47434741
= build_reference_type (TYPE_CANONICAL (new_type));
47444742
TYPE_ALIAS_SET (TYPE_CANONICAL (old_ref)) = set;

0 commit comments

Comments
 (0)