Module Name:    src
Committed By:   martin
Date:           Mon Oct 29 10:22:57 UTC 2018

Modified Files:
        src/external/gpl3/gcc.old/dist/gcc: ira-color.c
        src/external/gpl3/gcc/dist/gcc: ira-color.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc.old/dist/gcc/ira-color.c
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/gpl3/gcc/dist/gcc/ira-color.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/ira-color.c
diff -u src/external/gpl3/gcc.old/dist/gcc/ira-color.c:1.6 src/external/gpl3/gcc.old/dist/gcc/ira-color.c:1.7
--- src/external/gpl3/gcc.old/dist/gcc/ira-color.c:1.6	Thu Aug  2 00:02:48 2018
+++ src/external/gpl3/gcc.old/dist/gcc/ira-color.c	Mon Oct 29 10:22:56 2018
@@ -2760,7 +2760,13 @@ allocno_copy_cost_saving (ira_allocno_t 
 	}
       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;
 }

Index: src/external/gpl3/gcc/dist/gcc/ira-color.c
diff -u src/external/gpl3/gcc/dist/gcc/ira-color.c:1.1.1.4 src/external/gpl3/gcc/dist/gcc/ira-color.c:1.2
--- src/external/gpl3/gcc/dist/gcc/ira-color.c:1.1.1.4	Fri Feb  2 01:59:17 2018
+++ src/external/gpl3/gcc/dist/gcc/ira-color.c	Mon Oct 29 10:22:56 2018
@@ -2760,7 +2760,13 @@ allocno_copy_cost_saving (ira_allocno_t 
 	}
       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;
 }

Reply via email to