1
0
mirror of https://github.com/golang/go synced 2024-10-04 12:21:26 -06:00
Commit Graph

90 Commits

Author SHA1 Message Date
Russ Cox
ce35994d4e cmd/6c, cmd/6g: avoid address-as-constant in amd64 instructions
This allows implementing address-of-global
as a pc-relative address instead of as a
32-bit integer constant.

LGTM=rminnich, iant
R=golang-codereviews, rminnich, iant
CC=golang-codereviews
https://golang.org/cl/128070045
2014-08-12 19:53:11 -04:00
Shenghou Ma
e9da5fe279 cmd/5c, cmd/6c, cmd/8c, cmd/cc: remove unused global variable retok.
LGTM=bradfitz
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/107160046
2014-06-17 02:05:27 -04:00
Ian Lance Taylor
58b86e5013 liblink, cmd/gc, cmd/{5,6,8}{a,c}: rename linkwriteobj to writeobj
The name linkwriteobj is misleading because it implies that
the function has something to do with the linker, which it
does not.  The name is historical: the function performs an
operation that was previously performed by the linker, but no
longer is.

LGTM=rsc
R=rsc, minux.ma
CC=golang-codereviews
https://golang.org/cl/88210045
2014-04-16 14:36:44 -07:00
Russ Cox
90093f0634 liblink: introduce TLS register on 386 and amd64
When I did the original 386 ports on Linux and OS X, I chose to
define GS-relative expressions like 4(GS) as relative to the actual
thread-local storage base, which was usually GS but might not be
(it might be FS, or it might be a different constant offset from GS or FS).

The original scope was limited but since then the rewrites have
gotten out of control. Sometimes GS is rewritten, sometimes FS.
Some ports do other rewrites to enable shared libraries and
other linking. At no point in the code is it clear whether you are
looking at the real GS/FS or some synthesized thing that will be
rewritten. The code manipulating all these is duplicated in many
places.

The first step to fixing issue 7719 is to make the code intelligible
again.

This CL adds an explicit TLS pseudo-register to the 386 and amd64.
As a register, TLS refers to the thread-local storage base, and it
can only be loaded into another register:

        MOVQ TLS, AX

An offset from the thread-local storage base is written off(reg)(TLS*1).
Semantically it is off(reg), but the (TLS*1) annotation marks this as
indexing from the loaded TLS base. This emits a relocation so that
if the linker needs to adjust the offset, it can. For example:

        MOVQ TLS, AX
        MOVQ 8(AX)(TLS*1), CX // load m into CX

On systems that support direct access to the TLS memory, this
pair of instructions can be reduced to a direct TLS memory reference:

        MOVQ 8(TLS), CX // load m into CX

The 2-instruction and 1-instruction forms correspond roughly to
ELF TLS initial exec mode and ELF TLS local exec mode, respectively.

Liblink applies this rewrite on systems that support the 1-instruction form.
The decision is made using only the operating system (and probably
the -shared flag, eventually), not the link mode. If some link modes
on a particular operating system require the 2-instruction form,
then all builds for that operating system will use the 2-instruction
form, so that the link mode decision can be delayed to link time.

Obviously it is late to be making changes like this, but I despair
of correcting issue 7719 and issue 7164 without it. To make sure
I am not changing existing behavior, I built a "hello world" program
for every GOOS/GOARCH combination we have and then worked
to make sure that the rewrite generates exactly the same binaries,
byte for byte. There are a handful of TODOs in the code marking
kludges to get the byte-for-byte property, but at least now I can
explain exactly how each binary is handled.

The targets I tested this way are:

        darwin-386
        darwin-amd64
        dragonfly-386
        dragonfly-amd64
        freebsd-386
        freebsd-amd64
        freebsd-arm
        linux-386
        linux-amd64
        linux-arm
        nacl-386
        nacl-amd64p32
        netbsd-386
        netbsd-amd64
        openbsd-386
        openbsd-amd64
        plan9-386
        plan9-amd64
        solaris-amd64
        windows-386
        windows-amd64

There were four exceptions to the byte-for-byte goal:

windows-386 and windows-amd64 have a time stamp
at bytes 137 and 138 of the header.

darwin-386 and plan9-386 have five or six modified
bytes in the middle of the Go symbol table, caused by
editing comments in runtime/sys_{darwin,plan9}_386.s.

Fixes #7164.

LGTM=iant
R=iant, aram, minux.ma, dave
CC=golang-codereviews
https://golang.org/cl/87920043
2014-04-15 13:45:39 -04:00
Dave Cheney
d4896fb876 cmd/cc, cmd/5c, cmd/6c, cmd/8c: introduce linkarchinit and add amd64p32 support
Replaces CL 70000043.

Introduce linkarchinit() from cmd/ld.

For cmd/6c, switch to the amd64p32 linker model if we are building under nacl/amd64p32.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/72010043
2014-03-07 09:55:59 +11:00
Dave Cheney
7954b2b90b cmd/5a, cmd/5c, cmd/6a, cmd/6c, cmd/8a, cmd/8c, cmd/cc: support for Native Client
From the original description in CL 15770043

The main change here is to consult $GOARCH.

In 6c, when GOOS=nacl, some of the more complex addressing modes must be disabled, and the BP and R15 registers must not be used.

See golang.org/s/go13nacl for design overview.

LGTM=rsc
R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/69020044
2014-02-27 06:57:06 +11:00
Shenghou Ma
ca6186aa26 cmd/6c, cmd/8c, cmd/8g: fix print of pc (which is vlong).
While we're at it, fix a wrong for statement in cmd/8g.

LGTM=rsc
R=rsc, golang-codereviews
CC=golang-codereviews
https://golang.org/cl/62700044
2014-02-13 03:09:03 -05:00
Anthony Martin
2cae0591cd cmd/cc, cmd/gc, cmd/ld: consolidate print format routines
We now use the %A, %D, %P, and %R routines from liblink
across the board.

Fixes #7178.
Fixes #7055.

LGTM=iant
R=golang-codereviews, gobot, rsc, dave, iant, remyoudompheng
CC=golang-codereviews
https://golang.org/cl/49170043
2014-02-12 14:29:11 -05:00
Russ Cox
870e821ded cmd/cc, cmd/gc: update compilers, assemblers for liblink changes
- add buffered stdout to all tools and provide to link ctxt.
- avoid extra \n before ! in .6 files written by assemblers
  (makes them match the C compilers).
- use linkwriteobj instead of linkouthist+linkwritefuncs.
- in assemblers and C compilers, record pc explicitly in Prog,
  for use by liblink.
- in C compilers, preserve jump target links.
- in Go compilers (gsubr.c) attach gotype directly to
  corresponding LSym* instead of rederiving from instruction stream.
- in Go compilers, emit just one definition for runtime.zerovalue
  from each compilation.

This CL consists entirely of small adjustments.
The heavy lifting is in CL 39680043.
Each depends on the other.

R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/37030045
2013-12-16 12:51:38 -05:00
Russ Cox
76a8c873cf cmd/5c, cmd/6c, cmd/8c: use liblink
Preparation for golang.org/s/go13linker work.

This CL does not build by itself. It depends on 35740044
and 35790044 and will be submitted at the same time.

R=iant
CC=golang-dev
https://golang.org/cl/34580044
2013-12-08 22:51:31 -05:00
Dave Cheney
8d5ec52e6c cmd/6c, cmd/6g, cmd/cc: fix undefined behavior warnings
Update #5764

Like Tribbles, the more you kill, the more spring up in their place.

R=rsc
CC=golang-dev
https://golang.org/cl/13324049
2013-09-17 13:43:27 +10:00
Dmitriy Vyukov
79dca0327e libbio, all cmd: consistently use BGETC/BPUTC instead of Bgetc/Bputc
Also introduce BGET2/4, BPUT2/4 as they are widely used.
Slightly improve BGETC/BPUTC implementation.
This gives ~5% CPU time improvement on go install -a -p1 std.
Before:
real		user		sys
0m23.561s	0m16.625s	0m5.848s
0m23.766s	0m16.624s	0m5.846s
0m23.742s	0m16.621s	0m5.868s
after:
0m22.999s	0m15.841s	0m5.889s
0m22.845s	0m15.808s	0m5.850s
0m22.889s	0m15.832s	0m5.848s

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12745047
2013-08-30 15:46:12 +04:00
Russ Cox
48769bf546 runtime: use funcdata to supply garbage collection information
This CL introduces a FUNCDATA number for runtime-specific
garbage collection metadata, changes the C and Go compilers
to emit that metadata, and changes the runtime to expect it.

The old pseudo-instructions that carried this information
are gone, as is the linker code to process them.

R=golang-dev, dvyukov, cshapiro
CC=golang-dev
https://golang.org/cl/11406044
2013-07-19 16:04:09 -04:00
Keith Randall
6fc49c1854 runtime: cleanup: use ArgsSizeUnknown to mark all functions
whose argument size is unknown (C vararg functions, and
assembly code without an explicit specification).

We used to use 0 to mean "unknown" and 1 to mean "zero".
Now we use ArgsSizeUnknown (0x80000000) to mean "unknown".

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11590043
2013-07-19 11:19:18 -07:00
Russ Cox
4e141145b7 cmd/5c, cmd/6c, cmd/8c: record arg size for every call
R=ken2
CC=golang-dev
https://golang.org/cl/11364043
2013-07-16 16:24:43 -04:00
Shenghou Ma
faef52c214 all: fix typos
R=golang-dev, bradfitz, khr, r
CC=golang-dev
https://golang.org/cl/7461046
2013-06-09 21:50:24 +08:00
Russ Cox
f268c295a3 cmd/6c: use full 64-bit address in block copy
Already fixed independently in Plan 9.

R=ken2
CC=golang-dev
https://golang.org/cl/10041044
2013-06-05 10:39:06 -04:00
Anthony Martin
2449909d81 cmd/5c, cmd/6c, cmd/8c: isolate textflag and dataflag
Fixes #5419.

R=golang-dev, dave, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/9241044
2013-06-04 15:18:02 -07:00
Rémy Oudompheng
2c0b00744f cmd/6c, cmd/8c: avoid generating long multiplication when not necessary.
On amd64
benchmark                        old ns/op    new ns/op    delta
BenchmarkHashStringSpeed                91           74  -18.49%
BenchmarkHashInt32Speed                 54           45  -17.88%
BenchmarkHashInt64Speed                 76           58  -23.53%
BenchmarkHashStringArraySpeed          231          188  -18.61%

Fixes #5367.

R=golang-dev, iant, dave, daniel.morsing, ality, rsc
CC=golang-dev
https://golang.org/cl/9040043
2013-06-04 08:33:00 +02:00
Dave Cheney
f701e1c320 cmd/6c, cmd/8c: fix stack allocated Biobuf leaking at exit
Fixes #5085.

{6,8}c/swt.c allocates a third Biobuf in automatic memory which is not terminated at the end of the function. This causes the buffer to be 'in use' when the batexit handler fires, confusing valgrind.

Huge thanks to DMorsing for the diagnosis.

R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/7844044
2013-03-20 23:42:00 +11:00
Russ Cox
7556ccc7b1 cmd/cgo, cmd/ld: new cgo object file section
Switch to new pragma names, but leave old ones available for now.
Merge the three cgo-related sections in the .6 files into a single
cgo section.

R=golang-dev, iant, ality
CC=golang-dev
https://golang.org/cl/7424048
2013-03-01 00:27:57 -05:00
Robert Griesemer
3ee87d02b0 cmd/godoc: use go/build to determine package and example files
Also:
- faster code for example extraction
- simplify handling of command documentation:
  all "main" packages are treated as commands
- various minor cleanups along the way

For commands written in Go, any doc.go file containing
documentation must now be part of package main (rather
then package documentation), otherwise the documentation
won't show up in godoc (it will still build, though).

For commands written in C, documentation may still be
in doc.go files defining package documentation, but the
recommended way is to explicitly ignore those files with
a +build ignore constraint to define package main.

Fixes #4806.

R=adg, rsc, dave, bradfitz
CC=golang-dev
https://golang.org/cl/7333046
2013-02-19 11:19:58 -08:00
Russ Cox
07e87885ad cmd/6c: fix build
copy+paste error while cleaning up CL 7303099 before submit

R=ken2
CC=golang-dev
https://golang.org/cl/7308104
2013-02-18 13:29:55 -05:00
Russ Cox
139448fe95 cmd/6c, cmd/8c: cut stack frames by about half
The routine that adds an automatic to the stack was
adding ptrsize-1 to the size before rounding up.
That addition would only make sense to turn a round down
into a round up. Before a round up, it just wastes a word.

The effect was that a 6c function with one local and
one two-word function call used (8+8)+(16+8) = 40 bytes
instead of 8+16 = 24 bytes.

The wasted space mostly didn't matter, but one place where
it does matter is when trying to stay within the 128-byte
total frame constraint for #pragma textflag 7 functions.

This only affects the C compilers, not the Go compilers.

5c already had correct code, which is now copied to 6c and 8c.

R=ken2
CC=golang-dev
https://golang.org/cl/7303099
2013-02-18 13:24:04 -05:00
Elias Naur
fe14ee52cc cmd/6c, cmd/6g: add flag to support large-model code generation
Added the -pic flag to 6c and 6g to avoid assembler instructions that
cannot use RIP-relative adressing. This is needed to support the -shared mode
in 6l.

See also:
https://golang.org/cl/6926049
https://golang.org/cl/6822078

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7064048
2013-02-01 08:35:33 -08:00
Anthony Martin
60826e0be6 cmd/6c, cmd/8c: fix print format for Prog
The FmtLong flag should only be used with the %D verb
when printing an ATEXT Prog. It was erroneously used
for every Prog except ADATA. This caused a preponderance
of exclamation points, "!!", in the assembly listings.

I also cleaned up the code so that the list.c files look
very similar. Now the real differences are easily spotted
with a simple diff.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7128045
2013-01-18 19:00:38 -08:00
Matthew Dempsky
bb192d1399 cmd/6c: Optimize rotate expressions to use rotate instructions.
For simplicity, only recognizes expressions of the exact form
"(x << a) | (x >> b)" where x is a variable and a and b are
integer constant expressions that add to x's bit width.

Fixes #4629.

$ cat rotate.c
unsigned int
rotate(unsigned int x)
{
        x = (x << 3) | (x >> (sizeof(x) * 8 - 3));
        return x;
}

## BEFORE
$ go tool 6c -S rotate.c
(rotate.c:2)	TEXT	rotate+0(SB),$0-8
(rotate.c:2)	MOVL	x+0(FP),!!DX
(rotate.c:4)	MOVL	DX,!!AX
(rotate.c:4)	SALL	$3,!!AX
(rotate.c:4)	MOVL	DX,!!CX
(rotate.c:4)	SHRL	$29,!!CX
(rotate.c:4)	ORL	CX,!!AX
(rotate.c:5)	RET	,!!
(rotate.c:5)	RET	,!!
(rotate.c:5)	END	,!!

## AFTER
$ go tool 6c -S rotate.c
(rotate.c:2)	TEXT	rotate+0(SB),$0-8
(rotate.c:4)	MOVL	x+0(FP),!!AX
(rotate.c:4)	ROLL	$3,!!AX
(rotate.c:5)	RET	,!!
(rotate.c:5)	RET	,!!
(rotate.c:5)	END	,!!

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/7069056
2013-01-18 17:29:53 -05:00
Carl Shapiro
47568c747d cmd/5a, cmd/5c, cmd/6a, cmd/6c, cmd/8a, cmd/8c, cmd/ld: update reference
Reference the 80386 compiler documentation now that the
documentation for the 68020 is offline.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7127053
2013-01-18 13:39:53 -08:00
Matthew Dempsky
41ec481a53 cmd/6c: Improve peep hole optimization of rotate and shift instructions.
Update #4629.

$ cat shift2.c
unsigned int
shift(unsigned int x, unsigned int y)
{
        x = (x << 3);
        y = (y << 5);
        x = (x << 7);
        y = (y << 9);
        return x ^ y;
}

## BEFORE
$ go tool 6c -S shift2.c
(shift2.c:2)	TEXT	shift+0(SB),$0-8
(shift2.c:4)	MOVL	x+0(FP),!!AX
(shift2.c:4)	SALL	$3,!!AX
(shift2.c:4)	MOVL	AX,!!DX
(shift2.c:5)	MOVL	y+4(FP),!!AX
(shift2.c:5)	SALL	$5,!!AX
(shift2.c:5)	MOVL	AX,!!CX
(shift2.c:6)	MOVL	DX,!!AX
(shift2.c:6)	SALL	$7,!!AX
(shift2.c:6)	MOVL	AX,!!DX
(shift2.c:7)	MOVL	CX,!!AX
(shift2.c:7)	SALL	$9,!!AX
(shift2.c:7)	MOVL	AX,!!CX
(shift2.c:8)	MOVL	DX,!!AX
(shift2.c:8)	XORL	CX,!!AX
(shift2.c:8)	RET	,!!
(shift2.c:8)	RET	,!!
(shift2.c:8)	END	,!!

## AFTER
$ go tool 6c -S shift2.c
(shift2.c:2)	TEXT	shift+0(SB),$0-8
(shift2.c:4)	MOVL	x+0(FP),!!AX
(shift2.c:4)	SALL	$3,!!AX
(shift2.c:5)	MOVL	y+4(FP),!!CX
(shift2.c:5)	SALL	$5,!!CX
(shift2.c:6)	SALL	$7,!!AX
(shift2.c:7)	SALL	$9,!!CX
(shift2.c:8)	XORL	CX,!!AX
(shift2.c:8)	RET	,!!
(shift2.c:8)	RET	,!!
(shift2.c:8)	END	,!!

R=rsc, minux.ma, dave, nigeltao
CC=golang-dev
https://golang.org/cl/7066055
2013-01-18 16:33:25 -05:00
Rémy Oudompheng
5cb1ed2189 cmd/6c, cmd/8c: add fixjmp step to regopt.
The fixjmp step eliminates redundant chains of JMP
instructions that are produced by the compiler during
code generation.

It is already implemented in gc, and can be adapted to 6c/8c with
the exception that JMPs refer to destination by pc instead of by
pointer. The algorithm is modified to operate on Regs instead of Progs
for this reason. The pcs are already restored later by regopt.

R=goalng-dev, rsc
CC=golang-dev
https://golang.org/cl/6865046
2012-12-06 07:20:03 +01:00
Rémy Oudompheng
cc224c004d cmd/6c, cmd/8c: use signed char explicitly in mul.c
On ARM, char is unsigned, and the code generation for
multiplication gets totally broken.

Fixes #4354.

R=golang-dev, dave, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6826079
2012-11-09 21:06:45 +01:00
Rémy Oudompheng
33cceb09e2 cmd/{5g,6g,8g,6c}: remove unused macro, use %E to print etype.
R=golang-dev, rsc, dave
CC=golang-dev
https://golang.org/cl/6569044
2012-09-24 23:44:00 +02:00
Shenghou Ma
dac4c3eee9 cmd/cgo, cmd/cc, cmd/ld: detect dynamic linker automatically
Some newer Linux distributions (Ubuntu ARM at least) use a new multiarch
directory organization, where dynamic linker is no longer in the hardcoded
path in our linker.
For example, Ubuntu 12.04 ARM hardfloat places its dynamic linker at
/lib/arm-linux-gnueabihf/ld-linux.so.3

Ref: http://lackof.org/taggart/hacking/multiarch/

Also, to support Debian GNU/kFreeBSD as a FreeBSD variant, we need this capability, so it's part of issue 3533.

This CL add a new pragma (#pragma dynlinker "path") to cc.

R=iant, rsc
CC=golang-dev
https://golang.org/cl/6086043
2012-05-05 01:54:16 +08:00
Russ Cox
d42495aa80 cmd/cc: add PREFETCH built-in (like SET, USED)
This makes it possible to inline the prefetch of upcoming
memory addresses during garbage collection, instead of
needing to flush registers, make a function call, and
reload registers.  On garbage collection-heavy workloads,
this results in a 5% speedup.

Fixes #3493.

R=dvyukov, ken, r, dave
CC=golang-dev
https://golang.org/cl/5990066
2012-05-02 16:22:56 -04:00
Russ Cox
e530d6a1e0 6c, 6g, 6l: add MOVQL to make truncation explicit
Without an explicit signal for a truncation, copy propagation
will sometimes propagate a 32-bit truncation and end up
overwriting uses of the original 64-bit value.

The case that arose in practice is in C but I believe
that the same could plausibly happen in Go.
The main reason we didn't run into the same in Go
is that I (perhaps incorrectly?) drop MOVL AX, AX
during gins, so the truncation was never generated, so
it didn't confuse the optimizer.

Fixes #1315.
Fixes #3488.

R=ken2
CC=golang-dev
https://golang.org/cl/6002043
2012-04-10 12:51:59 -04:00
Russ Cox
b72c7e943c cmd/6c: fix probable code gen bug
This is a pointer being copied; MOVL can't possibly be right.

R=ken2
CC=golang-dev
https://golang.org/cl/5999043
2012-04-10 12:51:36 -04:00
Shenghou Ma
bcdafaa582 5c, 6c, 8c: take GOROOT_FINAL into consideration
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5936050
2012-04-04 00:04:36 +08:00
Russ Cox
5bcad92f07 ld: add NOPTRBSS for large, pointer-free uninitialized data
cc: add #pragma textflag to set it
runtime: mark mheap to go into noptr-bss.
        remove special case in garbage collector

Remove the ARM from.flag field created by CL 5687044.
The DUPOK flag was already in p->reg, so keep using that.

Otherwise test/nilptr.go creates a very large binary.
Should fix the arm build.
Diagnosed by minux.ma; replacement for CL 5690044.

R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/5686060
2012-02-21 22:08:42 -05:00
Shenghou Ma
6ed2b6c47d 5c, 6c, 8c, 6g, 8g: correct boundary checking
CL 5666043 fixed the same checking for 5g.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5666045
2012-02-15 08:59:03 -05:00
Russ Cox
fec7fa8b9d build: delete make paraphernalia
As a convenience to people working on the tools,
leave Makefiles that invoke the go dist tool appropriately.
They are not used during the build.

R=golang-dev, bradfitz, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5636050
2012-02-06 13:34:25 -05:00
Anthony Martin
e280035fc1 gc, cc: avoid using the wrong library when building the compilers
This can happen on Plan 9 if we we're building
with the 32-bit and 64-bit host compilers, one
after the other.

R=rsc
CC=golang-dev
https://golang.org/cl/5599053
2012-02-01 04:14:37 -08:00
Anthony Martin
6273d6e713 build: move the "-c" flag into HOST_CFLAGS
On Plan 9 this flag is used to discover
constant expressions in "if" statements.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5601060
2012-01-31 19:31:30 -08:00
Rob Pike
91cb3489ab go: move compilers into the go-tool directory
Also delete gotest, since it's messy to fix and slated for deletion anyway.
A couple of things outside src can't be tested any more. "go test" will be
fixed and these tests will be re-enabled. They're noisy for now.

Fixes #284.

R=rsc
CC=golang-dev
https://golang.org/cl/5598049
2012-01-30 14:46:31 -08:00
Russ Cox
109a976355 6c, 8c: make floating point code NaN-safe
R=ken2
CC=golang-dev
https://golang.org/cl/5569071
2012-01-26 16:23:29 -05:00
Anthony Martin
d89b7173c2 5c, 6c, 8c: support 64-bit switch value
For real this time. :-)

R=rsc, ken
CC=golang-dev
https://golang.org/cl/5486061
2011-12-14 17:30:40 -05:00
Ron Minnich
1bc1caa802 cc: change cas to newcase
Change the name of cas() in cc to newcase() to avoid a NIX conflict.
cas() is used in cc to create a new Case struct. There is a name
conflict in that cas() is a commonly-used
name for compare and swap. Since cas() is only used internally
in the compiler in 3 places, change the name to avoid a wider
conflict with the NIX runtime. This issue might well come up on
other OSes in the future anyway, as the name is fairly common.

R=rsc
CC=golang-dev
https://golang.org/cl/5294071
2011-10-26 15:27:59 -07:00
Hector Chu
aed2c06dcb 5a, 5c, 6a, 6c, 8a, 8c: fix Windows file paths
Verified with objdump -W.

R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/4974061
2011-09-07 15:49:56 -04:00
Lucio De Re
c8c6e1961d 5c, 6c, 6l: fix Plan 9 build warnings
src/cmd/5c/reg.c:
. Added USED() attribute.

src/cmd/6c/cgen.c:
. Revised code around "REGARG" to resemble use in "8c" and
  consequently remove a warning.

src/cmd/6l/asm.c:
. Added USED() attributes.
. Removed an unnecessary assignment.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4836045
2011-08-16 14:22:08 -04:00
Lucio De Re
4c6280b0f1 6a, 6c, 6l: fix for Plan 9 build
6a/a.h:
. Dropped <u.h> and <libc.h>.
. Made definition of EOF conditional.

6a/a.y:
. Added <u.h> and <libc.h>.

6a/lex.c:
. Added <u.h> and <libc.h>.
. Dropped <ctype.h> (now in <u.h>).

6c/gc.h:
. Added varargck pragma for "lD".

6c/swt.c:
. Dropped unused "thestring" argument in Bprint() calls.

6l/Makefile:
. Dropped unneeded directory prefix.

6l/l.h:
. Dropped unneeded directory prefix.
. Added varargck pragma for "I" and "i".

6l/obj.c:
. Dropped unneeded assignment.
. Dropped unreachable goto statement.

6l/pass.c:
. Dropped assignments flagged as unused.

6l/prof.c:
. Replaced "#if 0" with "#ifdef NOTDEF".

6l/span.c:
. Dropped unused incrementation.
. Added USED() as required.
. Dropped unreachable "return" statement.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4747044
2011-07-15 11:58:39 -04:00
Russ Cox
1eb656784c 5c, 6c: fix build
R=ken2
CC=golang-dev
https://golang.org/cl/4668049
2011-07-01 11:13:38 -04:00