Commit d127ed53 authored by Rémy Oudompheng's avatar Rémy Oudompheng

cmd/gc, cmd/6g: fix error on large stacks.

Fixes #4666.

R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/7141047
parent 41ec481a
...@@ -1329,7 +1329,7 @@ void ...@@ -1329,7 +1329,7 @@ void
sgen(Node *n, Node *ns, int64 w) sgen(Node *n, Node *ns, int64 w)
{ {
Node nodl, nodr, nodsi, noddi, cx, oldcx, tmp; Node nodl, nodr, nodsi, noddi, cx, oldcx, tmp;
int32 c, q, odst, osrc; vlong c, q, odst, osrc;
if(debug['g']) { if(debug['g']) {
print("\nsgen w=%lld\n", w); print("\nsgen w=%lld\n", w);
......
...@@ -320,7 +320,7 @@ struct Node ...@@ -320,7 +320,7 @@ struct Node
int32 lineno; int32 lineno;
int32 endlineno; int32 endlineno;
vlong xoffset; vlong xoffset;
int32 stkdelta; // offset added by stack frame compaction phase. vlong stkdelta; // offset added by stack frame compaction phase.
int32 ostk; int32 ostk;
int32 iota; int32 iota;
uint32 walkgen; uint32 walkgen;
...@@ -912,8 +912,8 @@ EXTERN int loophack; ...@@ -912,8 +912,8 @@ EXTERN int loophack;
EXTERN int32 iota; EXTERN int32 iota;
EXTERN NodeList* lastconst; EXTERN NodeList* lastconst;
EXTERN Node* lasttype; EXTERN Node* lasttype;
EXTERN int32 maxarg; EXTERN vlong maxarg;
EXTERN int32 stksize; // stack size for current frame EXTERN vlong stksize; // stack size for current frame
EXTERN int32 blockgen; // max block number EXTERN int32 blockgen; // max block number
EXTERN int32 block; // current block number EXTERN int32 block; // current block number
EXTERN int hasdefer; // flag that curfn has defer statetment EXTERN int hasdefer; // flag that curfn has defer statetment
......
...@@ -8,11 +8,17 @@ ...@@ -8,11 +8,17 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// Issue 2444 // Issue 2444
// Issue 4666: issue with arrays of exactly 4GB.
package main package main
func main() { // ERROR "stack frame too large"
func main() { // ERROR "stack frame too large"
var arr [1000200030]int32 var arr [1000200030]int32
arr_bkup := arr arr_bkup := arr
_ = arr_bkup _ = arr_bkup
} }
func F() { // ERROR "stack frame too large"
var arr [1 << 30]int32
_ = arr[42]
}
// compile // skip
// NOTE: this test is now skipped because the relevant code
// is rejected after fixing issue 4666.
// Copyright 2012 The Go Authors. All rights reserved. // Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
......
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