From: Eric Botcazou Date: Thu, 23 May 2019 10:34:54 +0000 (+0000) Subject: * c-ada-spec.c (compare_node): Compare the DECL_UIDs as a last resort. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b8235ea99f231c0840e7375d79c28cec5a525a4;p=gcc.git * c-ada-spec.c (compare_node): Compare the DECL_UIDs as a last resort. From-SVN: r271549 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index ae990feeaba..328effd24db 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2019-05-23 Eric Botcazou + + * c-ada-spec.c (compare_node): Compare the DECL_UIDs as a last resort. + 2019-05-22 Martin Liska PR lto/90500 diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index dc3a044fd90..45268508f63 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -679,8 +679,10 @@ compare_node (const void *lp, const void *rp) { const_tree lhs = *((const tree *) lp); const_tree rhs = *((const tree *) rp); + const int ret + = compare_location (decl_sloc (lhs, true), decl_sloc (rhs, true)); - return compare_location (decl_sloc (lhs, true), decl_sloc (rhs, true)); + return ret ? ret : DECL_UID (lhs) - DECL_UID (rhs); } /* Compare two comments (LP and RP) by their source location. */