Not recording the address being taken was causing
the liveness analysis not to preserve x in the absence
of direct references to x, which in turn was making the
net test fail with GOGC=0.
In addition to the test, this fixes a bug wherein
GOGC=0 go test -short net
crashed if liveness analysis was in use (like at tip, not like Go 1.2).
TBR=ken2
CC=golang-codereviews
https://golang.org/cl/64470043
The existing tests issue4463.go and issue4654.go had failures at
typechecking and did not test walking the AST.
Fixes#7272.
LGTM=khr
R=khr, rsc, iant
CC=golang-codereviews
https://golang.org/cl/60550044
For historical reasons, temp was returning a copy
of the created Node*, not the original Node*.
This meant that if analysis recorded information in the
returned node (for example, n->addrtaken = 1), the
analysis would not show up on the original Node*, the
one kept in fn->dcl and consulted during liveness
bitmap creation.
Correct this, and watch for it when setting addrtaken.
Fixes#7083.
R=khr, dave, minux.ma
CC=golang-codereviews
https://golang.org/cl/51010045
Nodes of goto statements were corrupted when written
to export data.
Fixes#7023.
R=rsc, dave, minux.ma
CC=golang-codereviews
https://golang.org/cl/46190043
Gccgo doesn't have the same equivalent of file name and
package as the gc compiler, so the error messages are
necessarily different.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/40510048
fixedbugs/issue4510.dir/f2.go:7: error: 'fmt' defined as both imported name and global name
f1.go:7: note: 'fmt' imported here
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41530044
const1.go:33: error: integer constant overflow
<similar errors omitted>
const1.go:64: error: division by zero
const1.go:67: error: floating point constant overflow
const1.go:68: error: floating point constant overflow
const1.go:69: error: floating point constant overflow
const1.go:70: error: division by zero
const1.go:71: error: expected integer type
const1.go:77: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:78: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:79: error: argument 1 has incompatible type (cannot use type uint8 as type int)
const1.go:81: error: argument 1 has incompatible type (cannot use type float32 as type int)
const1.go:82: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:83: error: floating point constant truncated to integer
const1.go:85: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:86: error: argument 1 has incompatible type (cannot use type string as type int)
const1.go:87: error: argument 1 has incompatible type (cannot use type bool as type int)
const1.go:90: error: const initializer cannot be nil
const1.go:91: error: expression is not constant
const1.go:92: error: expression is not constant
const1.go:93: error: invalid constant type
const1.go:94: error: invalid constant type
fixedbugs/bug462.go:17: error: unknown field 'os.File' in 'T'
fixedbugs/issue3705.go:9: error: cannot declare init - must be func
fixedbugs/issue4251.go:12: error: inverted slice range
fixedbugs/issue4251.go:16: error: inverted slice range
fixedbugs/issue4251.go:20: error: inverted slice range
fixedbugs/issue4405.go:11: error: invalid character 0x7 in identifier
fixedbugs/issue4405.go:12: error: invalid character 0x8 in identifier
fixedbugs/issue4405.go:13: error: invalid character 0xb in identifier
fixedbugs/issue4405.go:14: error: invalid character 0xc in identifier
fixedbugs/issue4429.go:15: error: expected pointer
fixedbugs/issue4517d.go:9: error: cannot import package as init
fixedbugs/issue4545.go:17: error: invalid context-determined non-integer type for left operand of shift
fixedbugs/issue4545.go:16: error: incompatible types in binary expression
fixedbugs/issue4610.go:15: error: expected ';' or '}' or newline
fixedbugs/issue4610.go:16: error: expected declaration
fixedbugs/issue4654.go:15: error: value computed is not used
<similar errors omitted>
fixedbugs/issue4776.go:9: error: program must start with package clause
fixedbugs/issue4776.go:9: error: expected ';' or newline after package clause
fixedbugs/issue4813.go:31: error: index must be integer
<similar errors omitted>
fixedbugs/issue4847.go:22: error: initialization expression for 'matchAny' depends upon itself
fixedbugs/issue5089.go:13: error: redefinition of 'bufio.Buffered': receiver name changed
fixedbugs/issue5089.go:11: note: previous definition of 'bufio.Buffered' was here
fixedbugs/issue5172.go:17: error: reference to undefined field or method 'bar'
fixedbugs/issue5172.go:18: error: reference to undefined field or method 'bar'
fixedbugs/issue5172.go:12: error: use of undefined type 'bar'
fixedbugs/issue5358.go:16: error: argument 2 has incompatible type
fixedbugs/issue5581.go:29: error: use of undefined type 'Blah'
funcdup.go:10: error: redefinition of 'i'
funcdup.go:10: note: previous definition of 'i' was here
<similar errors omitted>
funcdup2.go:10: error: redefinition of 'i'
funcdup2.go:10: note: previous definition of 'i' was here
<similar errors omitted>
slice3err.go:20: error: middle index required in 3-index slice
<similar errors omitted>
slice3err.go:20: error: final index required in 3-index slice
<similar errors omitted>
slice3err.go:21: error: final index required in 3-index slice
slice3err.go:46: error: invalid 3-index slice of string
<similar errors omitted>
slice3err.go:57: error: inverted slice range
<similar errors omitted>
slice3err.go:62: error: invalid slice index: capacity less than length
slice3err.go:64: error: invalid slice index: capacity less than start
slice3err.go:65: error: invalid slice index: capacity less than start
slice3err.go:66: error: invalid slice index: capacity less than start
slice3err.go:68: error: invalid slice index: capacity less than length
slice3err.go:70: error: invalid slice index: capacity less than start
slice3err.go:80: error: invalid slice index: capacity less than length
slice3err.go:82: error: invalid slice index: capacity less than start
slice3err.go:83: error: invalid slice index: capacity less than start
slice3err.go:84: error: invalid slice index: capacity less than start
slice3err.go:86: error: invalid slice index: capacity less than length
slice3err.go:88: error: invalid slice index: capacity less than start
slice3err.go:99: error: array index out of bounds
<similar errors omitted>
slice3err.go:106: error: invalid slice index: capacity less than length
slice3err.go:107: error: invalid slice index: capacity less than start
slice3err.go:118: error: invalid slice index: capacity less than length
slice3err.go:119: error: invalid slice index: capacity less than start
syntax/semi1.go:10: error: missing '{' after if clause
syntax/semi1.go:10: error: reference to undefined name 'x'
syntax/semi1.go:10: error: reference to undefined name 'y'
syntax/semi1.go:12: error: reference to undefined name 'z'
syntax/semi2.go:10: error: missing '{' after switch clause
syntax/semi2.go:10: error: reference to undefined name 'x'
syntax/semi3.go:10: error: missing '{' after for clause
syntax/semi3.go:10: error: reference to undefined name 'x'
syntax/semi3.go:10: error: reference to undefined name 'y'
syntax/semi3.go:10: error: reference to undefined name 'z'
syntax/semi3.go:12: error: reference to undefined name 'z'
syntax/semi4.go:11: error: missing '{' after for clause
syntax/semi4.go:10: error: reference to undefined name 'x'
syntax/semi4.go:12: error: reference to undefined name 'z'
typecheck.go:12: error: reference to undefined name 'b'
typecheck.go:17: error: reference to undefined name 'c'
typecheck.go:11: error: use of undefined type 'b'
typecheck.go:16: error: not enough arguments
typecheck.go:17: error: not enough arguments
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41520044
There is no necessary relationship between the imports of the
packages a and b, and gccgo happens to import them in a
different order, leading to different output. This ordering
is not the purpose of the test in any case.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/40400043
Types in function scope can have methods on them if they embed another type, but we didn't make the name unique, meaning that 2 identically named types in different functions would conflict with eachother.
Fixes#6269.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13326045
The compiler computes initialization order by finding
a spanning tree between a package's global variables.
But it does so by walking both variables and functions
and stops detecting cycles between variables when they
mix with a cycle of mutually recursive functions.
Fixes#4847.
R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/9663047
Individual variables bigger than 10 MB are now
moved to the heap, as if they had escaped on
their own.
This avoids ridiculous stacks for programs that
do things like
x := [1<<30]byte{}
... use x ...
If 10 MB is too small, we can raise the limit.
Fixes#6077.
R=ken2
CC=golang-dev
https://golang.org/cl/12650045
Backends do not exactly expect receiving binary operators with
constant operands or use workarounds to move them to
register/stack in order to handle them.
Fixes#5841.
R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/11107044
clearfat (used to zero initialize structures) will use AX for x86 block ops. If we write to AX while calculating the dest pointer, we will fill the structure with incorrect values.
Since 64-bit arithmetic uses AX to synthesize a 64-bit register, getting an adress by indexing with 64-bit ops can clobber the register.
Fixes#5820.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11383043
Deferred functions are not run by a call instruction. They are run by
the runtime editing registers to make the call start with a caller PC
returning to a
CALL deferreturn
instruction.
That instruction has always had the line number of the function's
closing brace, but that instruction's line number is irrelevant.
Stack traces show the line number of the instruction before the
return PC, because normally that's what started the call. Not so here.
The instruction before the CALL deferreturn could be almost anywhere
in the function; it's unrelated and its line number is incorrect to show.
Fix the line number by inserting a true hardware no-op with the right
line number before the returned-to CALL instruction. That is, the deferred
calls now appear to start with a caller PC returning to the second instruction
in this sequence:
NOP
CALL deferreturn
The traceback will show the line number of the NOP, which we've set
to be the line number of the function's closing brace.
The NOP here is not the usual pseudo-instruction, which would be
elided by the linker. Instead it is the real hardware instruction:
XCHG AX, AX on 386 and amd64, and AND.EQ R0, R0, R0 on ARM.
Fixes#5856.
R=ken2, ken
CC=golang-dev
https://golang.org/cl/11223043
Escape analysis needs the right curfn value on a dclfunc node, otherwise it will not analyze the function.
When generating method value wrappers, we forgot to set the curfn correctly.
Fixes#5753.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/10383048
A struct with a single field was considered as equivalent to the
field type, which is incorrect is the field is blank.
Fields with padding could make the compiler think some
types are comparable when they are not.
Fixes#5698.
R=rsc, golang-dev, daniel.morsing, bradfitz, gri, r
CC=golang-dev
https://golang.org/cl/10271046
Design doc at golang.org/s/go12slice.
This is an experimental feature and may not be included in the release.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10743046
Exported inlined functions that perform a string conversion
using a non-exported named type may miss it in export data.
Fixes#5755.
R=rsc, golang-dev, ality, r
CC=golang-dev
https://golang.org/cl/10464043
The existing compilers convert empty strings to empty
but non-nil byte and rune slices. The spec required
a nil byte and rune slice in those cases. That seems
an odd additional requirement. Adjust the spec to
match the reality.
Also, removed over-specification for conversions of
nil []byte and []rune: such nil slices already act
like empty slices and thus don't need extra language.
Added extra examples instead.
Fixes#5704.
R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/10440045
This avoids problems with inlining in genwrappers, which
occurs after functions have been compiled. Compiling a
function may cause some unused local vars to be removed from
the list. Since a local var may be unused due to
optimization, it is possible that a removed local var winds up
beingused in the inlined version, in which case hilarity
ensues.
Fixes#5515.
R=golang-dev, khr, dave
CC=golang-dev
https://golang.org/cl/10210043
It works on i386, but fails on amd64 and arm.
««« original CL description
runtime: prevent the GC from seeing the content of a frame in runfinq()
Fixes#5348.
R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/8954044
»»»
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8695051
They caused internal compiler errors and they're expensive enough that inlining them doesn't make sense.
Fixes#5259.
R=golang-dev, r, iant, remyoudompheng
CC=golang-dev
https://golang.org/cl/8636043
The offset of an embedded field s.X must be relative to s
and not to the implicit s.Field of which X is a direct field.
Moreover, no indirections may happen on the path.
Fixes#4909.
R=nigeltao, ality, daniel.morsing, iant, gri, r
CC=golang-dev
https://golang.org/cl/8287043
Reusing it when multiple comparisons occurred in the same
function call led to bad overwriting.
Fixes#5162.
R=golang-dev, daniel.morsing
CC=golang-dev
https://golang.org/cl/8174047
Usually, there is no esc info when inlining, but there will be when generating inlined wrapper functions.
If we don't use this information, we get invalid addresses on the stack.
Fixes#5056.
R=golang-dev, rsc
CC=golang-dev, remyoudompheng
https://golang.org/cl/7850045
It used to not mark parameters as escaping if only one of the
fields it points to leaks out of the function. This causes
problems when importing from another package.
Fixes#4964.
R=rsc, lvd, dvyukov, daniel.morsing
CC=golang-dev
https://golang.org/cl/7648045
Composite literals using the &T{} form were incorrectly
exported, leading to weird errors at import time.
Fixes#4879.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7395054
A new comment directive //go:noescape instructs the compiler
that the following external (no body) func declaration should be
treated as if none of its arguments escape to the heap.
Fixes#4099.
R=golang-dev, dave, minux.ma, daniel.morsing, remyoudompheng, adg, agl, iant
CC=golang-dev
https://golang.org/cl/7289048
Was not re-walking the new AND node, so that its ullman
count was wrong, so that the code generator attempted to
store values in registers across the call.
Fixes#4752.
R=ken2
CC=golang-dev
https://golang.org/cl/7288054
For consistency with conversions that look like function calls,
conversions that don't look like function calls now allow an
optional trailing comma.
That is, int(x,) has always been syntactically valid.
Now []int(x,) is valid too.
Fixes#4162.
R=ken2
CC=golang-dev
https://golang.org/cl/7288045
Expressions involving nil, even if they can be evaluated
at compile time, do not count as Go constants and cannot
be used in const initializers.
Fixes#4673.
Fixes#4680.
R=ken2
CC=golang-dev
https://golang.org/cl/7278043
The test case of issue 4585 was not passing due to
miscalculation of memequal args, and the previous fix
does not handle padding at the end of a struct.
Handling of padding at end of structs also fixes the case
of [n]T where T is such a padded struct.
Fixes#4585.
(again)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7133059
The linker split PKGDEF into (prefix, name, def) pairs,
and defines def to begin after a space following the identifier.
This is totally wrong for the following export data:
func "".FunctionName()
var SomethingCompletelyUnrelated int
The linker would parse
name=`"".FunctionName()\n\tvar`
def=`SomethingCompletelyUnrelated int`
since there is no space after FunctionName.
R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7068051
A constant node of type uintptr with a nil literal could
happen in two cases: []int(nil)[1:] and
uintptr(unsafe.Pointer(nil)).
Fixes#4614.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7059043
Unnamed types like structs with embedded fields can have methods.
These methods are generated on-the-fly by the compiler and
it may happen for identical types in different packages.
The linker must accept these multiple definitions.
Fixes#4590.
R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/7030051
Before this CL, defining the variable worked fine, but then when
the implicit package-level init func was created, that caused a
name collision and a confusing error about the redeclaration.
Also add a test for issue 3705 (func init() needs body).
Fixes#4517.
R=ken2
CC=golang-dev
https://golang.org/cl/7008045
Ordinary variable load was assumed to be not worth saving,
but not if one of the function calls later might change
its value.
Fixes#4313.
R=ken2
CC=golang-dev
https://golang.org/cl/6997047
The patch makes the compile user an ordinary package-local
symbol for the name of embedded fields of builtin type.
This is incompatible with the fix delivered for issue 2687
(revision 3c060add43fb) but fixes it in a different way, because
the explicit symbol on the field makes the typechecker able to
find it in lookdot.
Fixes#3552.
R=lvd, rsc, daniel.morsing
CC=golang-dev
https://golang.org/cl/6866047
The typechecking code was doing an extra, unnecessary
indirection.
Fixes#4458.
R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/6998051
A fatal error used to happen when escassign-ing a multiple
function return to a single node. However, the situation
naturally appears when using "go f(g())" or "defer f(g())",
because g() is escassign-ed to sink.
Fixes#4529.
R=golang-dev, lvd, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6920060
I just committed a patch to gccgo that notices that float was
never defined, causing an additional unmatched error message.
Rename the type to avoid that message.
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6947049
This check for BADWIDTH might happen while in defercheckwidth, making it raise errors for non-erroneous situations.
Fixes#4495.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6927043
Used to say:
issue4251.go:12: inverted slice range
issue4251.go:12: constant -1 overflows uint64
issue4251.go:16: inverted slice range
issue4251.go:16: constant -1 overflows uint64
issue4251.go:20: inverted slice range
issue4251.go:20: constant -1 overflows uint64
With this patch, only gives the "inverted slice range" errors.
R=golang-dev, daniel.morsing
CC=golang-dev
https://golang.org/cl/6871058
Fixes#4396.
For fixed arrays larger than the unmapped page, agenr would general a nil check by loading the first word of the array. However there is no requirement for the first element of a byte array to be word aligned, so this check causes a trap on ARMv5 hardware (ARMv6 since relaxed that restriction, but it probably still comes at a cost).
Switching the check to MOVB ensures alignment is not an issue. This check is only invoked in a few places in the code where large fixed arrays are embedded into structs, compress/lzw is the biggest offender, and switching to MOVB has no observable performance penalty.
Thanks to Rémy and Daniel Morsing for helping me debug this on IRC last night.
R=remyoudompheng, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6854063
The current spec says that when calling make, if both len and
cap are constant, it is an error if len > cap. The gc
compiler does not yet implement that, but when it does this
will need to change. Changing it now for the benefit of
gccgo.
R=gri
CC=golang-dev
https://golang.org/cl/6867064
The compiler was confused when inlining a T.Method(f()) call
where f returns multiple values: support for this was marked
as TODO.
Variadic calls are not supported but are not inlined either.
Add a test preventively for that case.
Fixes#4167.
R=golang-dev, rsc, lvd
CC=golang-dev
https://golang.org/cl/6871043
Bools from comparisons can be assigned to all bool types, but this idealness would propagate through logical operators when the result should have been lowered to a non-ideal form.
Fixes#3924.
R=golang-dev, remyoudompheng, r, rsc, mtj
CC=golang-dev
https://golang.org/cl/6855061
The stack overflow checker in the linker uses the spadj field
to determine whether stack space will be large enough or not.
When spadj=0, the checker treats the function as a nosplit
and emits an error although the program is correct.
Also enable the stack checker in 8l.
Fixes#4316.
R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/6855088
When exporting a body containing
x, ok := v.(Type)
the definition for Type was not being included, so when the body
was actually used, it would cause an "unknown type" compiler error.
Fixes#4370.
R=ken2
CC=golang-dev
https://golang.org/cl/6827064
The old code worked with gc, I assume because the linker
unified identical strings, but it failed with gccgo.
R=rsc
CC=gobot, golang-dev
https://golang.org/cl/6826063
Avoids problems with local declarations shadowing other names.
We write a more explicit form than the incoming program, so there
may be additional type annotations. For example:
int := "hello"
j := 2
would normally turn into
var int string = "hello"
var j int = 2
but the int variable shadows the int type in the second line.
This CL marks all local variables with a per-function sequence number,
so that this would instead be:
var int·1 string = "hello"
var j·2 int = 2
Fixes#4326.
R=ken2
CC=golang-dev
https://golang.org/cl/6816100
When local declarations needed unexported types, these could
be missing in the export data.
Fixes build with -gcflags -lll, except for exp/gotype.
R=golang-dev, rsc, lvd
CC=golang-dev
https://golang.org/cl/6813067
I fixed a bug in gccgo that was causing it to only give an
error for the first package that was imported and not used.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6813058
Someone new to the language may not know the connection between ints and arrays, which was the only thing that the previous error told you anything about.
Fixes#4256.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6739048
Since this patch changes the way complex literals are written
in export data, there are a few other glitches.
Fixes#4159.
R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6674047
The other tests either need a complex procedure
or are architecture- or OS-dependent.
Update #4139.
R=golang-dev, daniel.morsing, iant
CC=golang-dev
https://golang.org/cl/6618062
Also mention that ignoring second blank identifier of range is required by the spec in the code.
Fixes#4173.
R=daniel.morsing, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/6594043
const1.go:31:12: error: integer constant overflow
const1.go:31:12: error: integer constant overflow
const1.go:33:12: error: integer constant overflow
const1.go:33:12: error: integer constant overflow
const1.go:34:14: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:36:19: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:24: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:24: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:41:20: error: integer constant overflow
const1.go:41:20: error: integer constant overflow
const1.go:42:20: error: integer constant overflow
const1.go:42:20: error: integer constant overflow
const1.go:44:28: error: integer constant overflow
const1.go:44:28: error: integer constant overflow
const1.go:45:14: error: integer constant overflow
const1.go:49:14: error: integer constant overflow
const1.go:50:14: error: integer constant overflow
const1.go:51:14: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:56:14: error: integer constant overflow
const1.go:57:24: error: integer constant overflow
const1.go:57:24: error: integer constant overflow
const1.go:58:24: error: integer constant overflow
const1.go:58:24: error: integer constant overflow
const1.go:59:22: error: integer constant overflow
const1.go:59:22: error: integer constant overflow
const1.go:61:24: error: integer constant overflow
const1.go:62:20: error: division by zero
const1.go:65:19: error: floating point constant overflow
const1.go:65:19: error: floating point constant overflow
const1.go:66:28: error: floating point constant overflow
const1.go:66:28: error: floating point constant overflow
const1.go:67:19: error: floating point constant overflow
const1.go:67:19: error: floating point constant overflow
const1.go:68:19: error: division by zero
const1.go:33:14: error: integer constant overflow
const1.go:35:19: error: integer constant overflow
const1.go:42:22: error: integer constant overflow
const1.go:53:17: error: integer constant overflow
const1.go:55:14: error: integer constant overflow
const1.go:59:24: error: integer constant overflow
const1.go:69:20: error: expected integer type
const1.go:75:4: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:76:4: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:77:4: error: argument 1 has incompatible type (cannot use type uint8 as type int)
const1.go:79:4: error: argument 1 has incompatible type (cannot use type float32 as type int)
const1.go:80:4: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:81:4: error: floating point constant truncated to integer
const1.go:83:4: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:84:4: error: argument 1 has incompatible type (cannot use type string as type int)
const1.go:85:4: error: argument 1 has incompatible type (cannot use type bool as type int)
const1.go:88:7: error: const initializer cannot be nil
const2.go:14:8: error: expected ‘=’
const5.go:27:7: error: expression is not constant
const5.go:28:7: error: expression is not constant
const5.go:30:7: error: expression is not constant
const5.go:31:7: error: expression is not constant
ddd1.go:57:23: error: invalid use of ‘...’ in type conversion
ddd1.go:59:6: error: invalid use of ‘...’ in type conversion
ddd1.go:60:12: error: use of ‘[...]’ outside of array literal
ddd1.go:21:15: error: argument 1 has incompatible type
ddd1.go:22:10: error: argument 1 has incompatible type
ddd1.go:30:6: error: invalid use of ‘...’ with non-slice
ddd1.go:30:6: error: invalid use of ‘...’ with non-slice
ddd1.go:46:2: error: invalid use of %<...%> with builtin function
ddd1.go:47:2: error: invalid use of %<...%> with builtin function
ddd1.go:49:2: error: invalid use of %<...%> with builtin function
ddd1.go:50:6: error: invalid use of %<...%> with builtin function
ddd1.go:51:6: error: invalid use of %<...%> with builtin function
ddd1.go:53:6: error: invalid use of %<...%> with builtin function
ddd1.go:58:13: error: invalid use of %<...%> with builtin function
ddd1.go:20:10: error: floating point constant truncated to integer
ddd1.go:32:6: error: invalid use of ‘...’ calling non-variadic function
declbad.go:20:3: error: variables redeclared but no variable is new
declbad.go:38:3: error: variables redeclared but no variable is new
declbad.go:44:3: error: variables redeclared but no variable is new
declbad.go:51:3: error: variables redeclared but no variable is new
declbad.go:57:3: error: variables redeclared but no variable is new
declbad.go:63:3: error: variables redeclared but no variable is new
declbad.go:26:3: error: incompatible types in assignment (cannot use type float32 as type int)
declbad.go:32:3: error: incompatible types in assignment (cannot use type int as type float32)
declbad.go:44:3: error: incompatible types in assignment (different number of results)
fixedbugs/bug223.go:21:5: error: initialization expression for ‘m’ depends upon itself
fixedbugs/bug412.go:10:2: error: duplicate field name ‘x’
fixedbugs/bug413.go:11:5: error: initialization expression for ‘i’ depends upon itself
fixedbugs/bug416.go:13:1: error: method ‘X’ redeclares struct field name
fixedbugs/bug435.go:15:49: error: missing ‘)’
fixedbugs/bug435.go:15:2: error: reference to undefined name ‘bar’
fixedbugs/bug451.go:9:9: error: expected package
typeswitch3.go:39:9: error: no new variables on left side of ‘:=’
typeswitch3.go:24:2: error: impossible type switch case (type has no methods)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6560063
Today, if run.go doesn't understand a test header line it just ignores
the test, making it too easy to write or edit tests that are not actually
being run.
- expand errorcheck to accept flags, so that bounds.go and escape*.go can run.
- create a whitelist of skippable tests in run.go; skipping others is an error.
- mark all skipped tests at top of file.
Update #4139.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6549054
Revision 63f7abcae015 introduced a bug caused by
code assuming registers started at X5, not X0.
Fixes#4138.
R=rsc
CC=golang-dev, remy
https://golang.org/cl/6558043
Broke tests on 386.
««« original CL description
6l/8l: emit correct opcodes to F(SUB|DIV)R?D.
When the destination was not F0, 6l and 8l swapped FSUBD/FSUBRD and
FDIVD/FDIVRD.
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6498092
»»»
R=golang-dev
CC=golang-dev
https://golang.org/cl/6492100
This fixes a spurious 'invalid recursive type' error, and stops the compiler from emitting errors on uses of the invalid type.
Fixes#3766.
R=golang-dev, dave, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6443100
CVTSS2SQ's rounding mode is controlled by the RC field of MXCSR;
as we specifically need truncate semantic, we should use CVTTSS2SQ.
Fixes#3804.
R=rsc, r
CC=golang-dev
https://golang.org/cl/6352079
The receive operator was given incorrect precedence
resulting in incorrect deletion of parentheses.
Fixes#3843.
R=rsc
CC=golang-dev, remy
https://golang.org/cl/6442049
The compiledir pattern compiles all files xxx.dir/*.go
in lexicographic order (which is assumed to coincide with
the topological order of dependencies).
R=rsc
CC=golang-dev, remy
https://golang.org/cl/6440048
They were previously ignored when deciding order and
detecting dependency loops.
Fixes#3824.
R=rsc, golang-dev
CC=golang-dev, remy
https://golang.org/cl/6455055