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/95f7e7e16c04
branches:  trunk
changeset: 445437:95f7e7e16c04
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 052f5b786521 -r 95f7e7e16c04 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 052f5b786521 -r 95f7e7e16c04 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