Source-Changes-HG archive

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

[src/trunk]: src/external/gpl3 VAX does not fully populate the register move ...



details:   https://anonhg.NetBSD.org/src/rev/fe9fc023b328
branches:  trunk
changeset: 836651:fe9fc023b328
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Oct 29 10:22:56 2018 +0000

description:
VAX does not fully populate the register move costs table, so do not
access it w/o checks.
Hack to work around PR toolchain/53176.

diffstat:

 external/gpl3/gcc.old/dist/gcc/ira-color.c |  8 +++++++-
 external/gpl3/gcc/dist/gcc/ira-color.c     |  8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r d3a061dd1e7d -r fe9fc023b328 external/gpl3/gcc.old/dist/gcc/ira-color.c
--- a/external/gpl3/gcc.old/dist/gcc/ira-color.c        Mon Oct 29 05:15:21 2018 +0000
+++ b/external/gpl3/gcc.old/dist/gcc/ira-color.c        Mon Oct 29 10:22:56 2018 +0000
@@ -2760,7 +2760,13 @@
        }
       else
        gcc_unreachable ();
-      cost += cp->freq * ira_register_move_cost[allocno_mode][rclass][rclass];
+      cost += cp->freq *
+            (   ira_register_move_cost
+             && ira_register_move_cost[allocno_mode]
+            && ira_register_move_cost[allocno_mode][rclass]
+           )
+          ? ira_register_move_cost[allocno_mode][rclass][rclass] 
+          : 0;
     }
   return cost;
 }
diff -r d3a061dd1e7d -r fe9fc023b328 external/gpl3/gcc/dist/gcc/ira-color.c
--- a/external/gpl3/gcc/dist/gcc/ira-color.c    Mon Oct 29 05:15:21 2018 +0000
+++ b/external/gpl3/gcc/dist/gcc/ira-color.c    Mon Oct 29 10:22:56 2018 +0000
@@ -2760,7 +2760,13 @@
        }
       else
        gcc_unreachable ();
-      cost += cp->freq * ira_register_move_cost[allocno_mode][rclass][rclass];
+      cost += cp->freq *
+            (   ira_register_move_cost
+             && ira_register_move_cost[allocno_mode]
+            && ira_register_move_cost[allocno_mode][rclass]
+           )
+          ? ira_register_move_cost[allocno_mode][rclass][rclass] 
+          : 0;
     }
   return cost;
 }



Home | Main Index | Thread Index | Old Index