Commit f2cd0fa7 authored by Robert Griesemer's avatar Robert Griesemer

cmd/compile/internal/gc: don't print "internal error" twice

The Fatalf mechanism already prints "compiler internal error:"
when reporting an error. There's no need to have "internal error"
in the error message passed to Fatalf calls. Removed them.

Fixes #28575.

Change-Id: I12b1bea37bc839780f257c27ef9e2005bf334925
Reviewed-on: https://go-review.googlesource.com/c/147287
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarMartin Möhrmann <moehrmann@google.com>
parent 6151a6d7
...@@ -599,6 +599,7 @@ var knownFormats = map[string]string{ ...@@ -599,6 +599,7 @@ var knownFormats = map[string]string{
"*cmd/compile/internal/types.Type %v": "", "*cmd/compile/internal/types.Type %v": "",
"*cmd/internal/obj.Addr %v": "", "*cmd/internal/obj.Addr %v": "",
"*cmd/internal/obj.LSym %v": "", "*cmd/internal/obj.LSym %v": "",
"*math/big.Float %f": "",
"*math/big.Int %#x": "", "*math/big.Int %#x": "",
"*math/big.Int %s": "", "*math/big.Int %s": "",
"*math/big.Int %v": "", "*math/big.Int %v": "",
...@@ -706,33 +707,34 @@ var knownFormats = map[string]string{ ...@@ -706,33 +707,34 @@ var knownFormats = map[string]string{
"interface{} %v": "", "interface{} %v": "",
"map[*cmd/compile/internal/gc.Node]*cmd/compile/internal/ssa.Value %v": "", "map[*cmd/compile/internal/gc.Node]*cmd/compile/internal/ssa.Value %v": "",
"map[cmd/compile/internal/ssa.ID]uint32 %v": "", "map[cmd/compile/internal/ssa.ID]uint32 %v": "",
"reflect.Type %s": "", "math/big.Accuracy %s": "",
"rune %#U": "", "reflect.Type %s": "",
"rune %c": "", "rune %#U": "",
"string %-*s": "", "rune %c": "",
"string %-16s": "", "string %-*s": "",
"string %-6s": "", "string %-16s": "",
"string %.*s": "", "string %-6s": "",
"string %q": "", "string %.*s": "",
"string %s": "", "string %q": "",
"string %v": "", "string %s": "",
"time.Duration %d": "", "string %v": "",
"time.Duration %v": "", "time.Duration %d": "",
"uint %04x": "", "time.Duration %v": "",
"uint %5d": "", "uint %04x": "",
"uint %d": "", "uint %5d": "",
"uint %x": "", "uint %d": "",
"uint16 %d": "", "uint %x": "",
"uint16 %v": "", "uint16 %d": "",
"uint16 %x": "", "uint16 %v": "",
"uint32 %#x": "", "uint16 %x": "",
"uint32 %d": "", "uint32 %#x": "",
"uint32 %v": "", "uint32 %d": "",
"uint32 %x": "", "uint32 %v": "",
"uint64 %08x": "", "uint32 %x": "",
"uint64 %d": "", "uint64 %08x": "",
"uint64 %x": "", "uint64 %d": "",
"uint8 %d": "", "uint64 %x": "",
"uint8 %x": "", "uint8 %d": "",
"uintptr %d": "", "uint8 %x": "",
"uintptr %d": "",
} }
...@@ -300,7 +300,7 @@ func beginRange(calls []dwarf.InlCall, p *obj.Prog, ii int, imap map[int]int) *d ...@@ -300,7 +300,7 @@ func beginRange(calls []dwarf.InlCall, p *obj.Prog, ii int, imap map[int]int) *d
} }
callIdx, found := imap[ii] callIdx, found := imap[ii]
if !found { if !found {
Fatalf("internal error: can't find inlIndex %d in imap for prog at %d\n", ii, p.Pc) Fatalf("can't find inlIndex %d in imap for prog at %d\n", ii, p.Pc)
} }
call := &calls[callIdx] call := &calls[callIdx]
......
...@@ -909,7 +909,7 @@ func (w *exportWriter) mpfloat(f *big.Float, typ *types.Type) { ...@@ -909,7 +909,7 @@ func (w *exportWriter) mpfloat(f *big.Float, typ *types.Type) {
manti, acc := mant.Int(nil) manti, acc := mant.Int(nil)
if acc != big.Exact { if acc != big.Exact {
Fatalf("exporter: internal error") Fatalf("mantissa scaling failed for %f (%s)", f, acc)
} }
w.mpint(manti, typ) w.mpint(manti, typ)
if manti.Sign() != 0 { if manti.Sign() != 0 {
......
...@@ -1019,7 +1019,7 @@ func (lv *Liveness) epilogue() { ...@@ -1019,7 +1019,7 @@ func (lv *Liveness) epilogue() {
live := lv.livevars[index] live := lv.livevars[index]
if v.Op.IsCall() && live.regs != 0 { if v.Op.IsCall() && live.regs != 0 {
lv.printDebug() lv.printDebug()
v.Fatalf("internal error: %v register %s recorded as live at call", lv.fn.Func.Nname, live.regs.niceString(lv.f.Config)) v.Fatalf("%v register %s recorded as live at call", lv.fn.Func.Nname, live.regs.niceString(lv.f.Config))
} }
index++ index++
} }
...@@ -1038,7 +1038,7 @@ func (lv *Liveness) epilogue() { ...@@ -1038,7 +1038,7 @@ func (lv *Liveness) epilogue() {
// input parameters. // input parameters.
for j, n := range lv.vars { for j, n := range lv.vars {
if n.Class() != PPARAM && lv.stackMaps[0].Get(int32(j)) { if n.Class() != PPARAM && lv.stackMaps[0].Get(int32(j)) {
Fatalf("internal error: %v %L recorded as live on entry", lv.fn.Func.Nname, n) lv.f.Fatalf("%v %L recorded as live on entry", lv.fn.Func.Nname, n)
} }
} }
// Check that no registers are live at function entry. // Check that no registers are live at function entry.
...@@ -1047,7 +1047,7 @@ func (lv *Liveness) epilogue() { ...@@ -1047,7 +1047,7 @@ func (lv *Liveness) epilogue() {
// so it doesn't appear live at entry. // so it doesn't appear live at entry.
if regs := lv.regMaps[0]; regs != 0 { if regs := lv.regMaps[0]; regs != 0 {
lv.printDebug() lv.printDebug()
lv.f.Fatalf("internal error: %v register %s recorded as live on entry", lv.fn.Func.Nname, regs.niceString(lv.f.Config)) lv.f.Fatalf("%v register %s recorded as live on entry", lv.fn.Func.Nname, regs.niceString(lv.f.Config))
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment