From: Eric Botcazou Date: Thu, 23 May 2019 10:35:30 +0000 (+0000) Subject: * c-ada-spec.c (compare_node): Compare the DECL_UIDs as a last resort. X-Git-Tag: releases/gcc-9.2.0~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc172b9806dd22f5eda47a62a0c8b7e6de14e31a;p=thirdparty%2Fgcc.git * c-ada-spec.c (compare_node): Compare the DECL_UIDs as a last resort. From-SVN: r271550 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index abdea1b9280f..871464b8e555 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-03 Release Manager * GCC 9.1.0 released. diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index c85e6060d3e7..76e736964dee 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. */