diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-05-23 10:34:54 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2019-05-23 10:34:54 +0000 |
commit | 2b8235ea99f231c0840e7375d79c28cec5a525a4 (patch) | |
tree | 3190b5a486c7a608445202c7bd14792faaa1141d /gcc | |
parent | 832ece86e5a9f98f49571ed6407a8d93c4f50e18 (diff) | |
download | gcc-2b8235ea99f231c0840e7375d79c28cec5a525a4.zip gcc-2b8235ea99f231c0840e7375d79c28cec5a525a4.tar.gz gcc-2b8235ea99f231c0840e7375d79c28cec5a525a4.tar.bz2 |
* c-ada-spec.c (compare_node): Compare the DECL_UIDs as a last resort.
From-SVN: r271549
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c-family/c-ada-spec.c | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index ae990fe..328effd 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2019-05-23 Eric Botcazou <ebotcazou@adacore.com> + + * c-ada-spec.c (compare_node): Compare the DECL_UIDs as a last resort. + 2019-05-22 Martin Liska <mliska@suse.cz> PR lto/90500 diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index dc3a044..4526850 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. */ |