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/b6e4475c493a
branches:  trunk
changeset: 994269:b6e4475c493a
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 ffd1e4c1a415 -r b6e4475c493a 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 ffd1e4c1a415 -r b6e4475c493a 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