Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/dist/gcc/common/config/aarch64 when sortin...



details:   https://anonhg.NetBSD.org/src/rev/eb75ba67a496
branches:  trunk
changeset: 971300:eb75ba67a496
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Apr 20 21:57:22 2020 +0000

description:
when sorting all_extensions_by_on[] be sure to keep the NULL
entry last.  correct the sizeof() to use the right variable
(they were the same size at least.)  as-was, with the NULL
entry first, all loops across this array were no-ops.

this should fix PR#55158's arm64 side.

diffstat:

 external/gpl3/gcc/dist/gcc/common/config/aarch64/aarch64-common.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (15 lines):

diff -r f79743920255 -r eb75ba67a496 external/gpl3/gcc/dist/gcc/common/config/aarch64/aarch64-common.c
--- a/external/gpl3/gcc/dist/gcc/common/config/aarch64/aarch64-common.c Mon Apr 20 21:39:05 2020 +0000
+++ b/external/gpl3/gcc/dist/gcc/common/config/aarch64/aarch64-common.c Mon Apr 20 21:57:22 2020 +0000
@@ -285,9 +285,9 @@
        to calculate the feature strings is called on every options push,
        pop and attribute change (arm_neon headers, lto etc all cause this to
        happen quite frequently).  It is a trade-off between time and space and
-       so time won.  */
+       so time won.  Keep NULL entry last.  */
     int n_extensions
-      = sizeof (all_extensions) / sizeof (struct aarch64_option_extension);
+      = sizeof (all_extensions_by_on) / sizeof (all_extensions_by_on[0]) - 1;
     qsort (&all_extensions_by_on, n_extensions,
           sizeof (struct aarch64_option_extension), opt_ext_cmp);
 }



Home | Main Index | Thread Index | Old Index