aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
AgeCommit message (Collapse)AuthorFilesLines
2015-09-16compiler: Don't crash on malformed numeric constants.Ian Lance Taylor2-3/+28
Fixes golang/go#11548. Reviewed-on: https://go-review.googlesource.com/13794 From-SVN: r227830
2015-09-15compiler: Report init dependency errors with builtin functions.Ian Lance Taylor2-6/+8
Fixes golang/go#12319. Reviewed-on: https://go-review.googlesource.com/13931 From-SVN: r227813
2015-09-15libgo: If compiler can split-stack and linker can not, use -fno-split-stack.Ian Lance Taylor1-1/+1
If the compiler supports split-stack but we are using a gold linker that does not, as happens on PPC with current GCC but old gold, then we need to compile the Go code with -fno-split-stack to avoid a linker error avoid the inability to call from split-stack code to non-split-stack code. Reviewed-on: https://go-review.googlesource.com/14598 From-SVN: r227811
2015-09-15libgo: test linking split-stack and non-split-stack togetherIan Lance Taylor1-1/+1
PPC has split-stack support in current GCC, but old version of gold will reject attempts to link PPC split-stack and non-split-stack code together. Test for that, and don't compile the C code with -fsplit-stack if it doesn't work. Reviewed-on: https://go-review.googlesource.com/14594 From-SVN: r227802
2015-09-15runtime: Ignore stack sizes when deciding when to GC.Ian Lance Taylor1-1/+1
This restores https://golang.org/cl/6081043 which was lost accidentally when updating a new version of libgo in https://golang.org/cl/22440043 . Reviewed-on: https://go-review.googlesource.com/14569 From-SVN: r227784
2015-09-15libgo: don't provide ustat on arm64 GNU/LinuxIan Lance Taylor1-1/+1
This avoids linker warnings when linking against glibc, as apparently arm64 GNU/Linux does not support the ustat system call. Also update to automake 1.11.6, as that is the new GCC standard. Reviewed-on: https://go-review.googlesource.com/14567 From-SVN: r227777
2015-09-14compiler: Ignore result context in constant expressions.Ian Lance Taylor2-12/+19
When evaluating a constant expression, the gofrontend would incorrectly force each operand to be represented as the resulting type before checking if the operation was valid with the untyped constants. According to the language specification on constant expressions(http://golang.org/ref/spec#Constant_expressions): "Untyped boolean, numeric, and string constants may be used as operands wherever it is legal to use an operand of boolean, numeric, or string type, respectively." Fixes golang/go#11566. Reviewed-on: https://go-review.googlesource.com/12716 From-SVN: r227758
2015-09-11compiler: Avoid unsafe memcmp for nointerface comments.Ian Lance Taylor2-2/+4
Fixes golang/go#11577. Reviewed-on: https://go-review.googlesource.com/14182 From-SVN: r227699
2015-09-11libgo/runtime: return 0, not NULL, from mainIan Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/13421 From-SVN: r227673
2015-09-10libgo: Use stat_atim.go on Solaris 12+Ian Lance Taylor1-1/+1
From Rainer Orth. Solaris 12 changes the stat_[amc]tim members of struct stat from timestruc_t to timespec_t for XPG7 compatiblity, thus breaking the libgo build. The following patch checks for this change and uses the common stat_atim.go if appropriate. Reviewed-on: https://go-review.googlesource.com/14495 From-SVN: r227665
2015-09-10compiler: Report errors from very large types.Chris Manghane5-19/+81
The gcc backend throws an internal error when trying to get the size of a type which is larger than the amount of address space on the machine. This patch catches this error and reports it in a user friendly way. Fixes golang/go#11554. Reviewed-on: https://go-review.googlesource.com/13684 * go-gcc.cc (Gcc_backend::type_size): Return -1 for unrepresentable size. From-SVN: r227656
2015-09-10compiler: Don't allow shifts with non-integers.Ian Lance Taylor2-1/+7
Fixes golang/go#11616. Reviewed-on: https://go-review.googlesource.com/13688 From-SVN: r227604
2015-09-03compiler: Report invalid receiver types in function definitions.Ian Lance Taylor2-2/+6
Fixes golang/go#12324. Reviewed-on: https://go-review.googlesource.com/13988 From-SVN: r227427
2015-09-02compiler: Mark erroneous constants as invalid.Ian Lance Taylor3-11/+61
When the compiler failed to evaluate a numeric constant because because it was erroneous, there was no way for parent nodes to discover the error and lower themselves into error nodes. This patch now uses the NC_INVALID enumerator to mark numeric constants with a known, reported error. Fixes golang/go#11541. Reviewed-on: https://go-review.googlesource.com/13904 From-SVN: r227420
2015-09-02compiler: Accept out of range integer -> unicode conversions.Ian Lance Taylor2-1/+20
When converting a signed or unsigned integer value into a constant string, if the integer does not fit into the Go "int" type, the string will become "\uFFFD." Fixes golang/go#11525. Reviewed-on: https://go-review.googlesource.com/13906 From-SVN: r227395
2015-08-31compiler: Check for invalid UTF8 in Go comments.Ian Lance Taylor2-1/+11
Fixes golang/go#11527. Reviewed-on: https://go-review.googlesource.com/13905 From-SVN: r227332
2015-08-27compiler: Report unused variables initialized to function literals.Ian Lance Taylor2-8/+9
Fixes golang/go#12317. Reviewed-on: https://go-review.googlesource.com/13908 From-SVN: r227285
2015-08-27compiler: Allow multiple blank label definitions.Ian Lance Taylor3-1/+13
Fixes golang/go#12316. Reviewed-on: https://go-review.googlesource.com/13907 From-SVN: r227284
2015-08-27compiler: Don't record dependencies of invalid redefinitions.Ian Lance Taylor4-2/+26
The gofrontend would crash when trying to find the initialization order of a variable list where one of the listed variables was an invalid redefinition of another in a call statement. This patch fixes initialization from call statements to consider invalid redefinitions before recording dependency information. Fixes golang/go#11543. Reviewed-on: https://go-review.googlesource.com/13895 From-SVN: r227276
2015-08-27compiler: Don't crash on invalid builtin calls.Ian Lance Taylor2-4/+10
Fixes golang/go#11544. Reviewed-on: https://go-review.googlesource.com/13893 From-SVN: r227245
2015-08-26compiler: Don't crash on invalid arithmetic ops.Ian Lance Taylor2-2/+6
The gofrontend would crash after hitting an unreachable state while trying to determine the type of an arithmetic expression involving non-numeric values. Instead of crashing, it should fail gracefully if the relevant error is already reported. Fixes golang/go#11537. Reviewed-on: https://go-review.googlesource.com/13793 From-SVN: r227227
2015-08-25compiler: Disallow use of unary ^ on booleans.Ian Lance Taylor2-4/+3
Fixes golang/go#11529. Reviewed-on: https://go-review.googlesource.com/13790 From-SVN: r227201
2015-08-25compiler: Accept numeric literals with leading zeroes.Ian Lance Taylor2-3/+9
When a numeric literal with leading zeroes was seen in the parser, it would only be accepted if it were a valid hex or octal literal. Any invalid numeric literal would be split up into multiple tokens: the valid hex/octal literal followed by the rest of the characters. Instead, when scanning a numeric literal with leading zeroes, always accept the number and give an appropriate error if the accepted number does not fit in the expected base. Fixes golang/go#11532, golang/go#11533. Reviewed-on: https://go-review.googlesource.com/13791 From-SVN: r227193
2015-08-25compiler: Allow string slices with start index == length.Ian Lance Taylor2-2/+5
Avoid an off-by-one error when checking the start index of a string slice by allowing the start index to be the string length instead of the string length - 1. Fixes golang/go#11522. Reviewed-on: https://go-review.googlesource.com/13030 From-SVN: r227191
2015-08-25compiler: Don't crash on erroneous array types.Ian Lance Taylor2-1/+3
Fixes golang/go#11546. Reviewed-on: https://go-review.googlesource.com/13795 From-SVN: r227184
2015-08-25compiler: Type check params in sink function decl.Ian Lance Taylor2-2/+14
When a function is declared and named with the blank identifier, only the syntax is checked. This patch modifies the parser to add a dummy node for each function declaration with a blank identifier name that will be type checked like any function declaration. Fixes golang/go#11535. Reviewed-on: https://go-review.googlesource.com/13792 From-SVN: r227160
2015-08-24re PR tree-optimization/67284 (libgo fails to build on trunk r227015 / ↵Marek Polacek2-50/+64
*-linux-gnu) PR tree-optimization/67284 * go-gcc.cc (Gcc_backend::define_builtin): Add NORETURN_P parameter. Set TREE_THIS_VOLATILE. (Gcc_backend::Gcc_backend): Mark __builtin_trap as a noreturn call. Pass false to the rest of define_builtin calls. From-SVN: r227134
2015-08-20compiler: Don't crash on invalid print call.Ian Lance Taylor2-1/+7
When the print builtins are called with no arguments, the compiler issues a warning and crashes when trying to produce the backend representation for the arguments. Fixes golang/go#11526. Reviewed-on: https://go-review.googlesource.com/13131 From-SVN: r227039
2015-08-20libgo/testsuite: another fix for killing the sleep processIan Lance Taylor1-1/+1
Avoid ps padding issues. Make sure we locate and kill just the sleep process. Reviewed-on: https://go-review.googlesource.com/13634 From-SVN: r227037
2015-08-14compiler: Report unnamed receiver types.Ian Lance Taylor2-2/+6
gccgo used to crash when presented with an invalid receiver type in a method. Instead, unnamed receiver types should report an error. Fixes golang/go#11557. Reviewed-on: https://go-review.googlesource.com/13245 From-SVN: r226899
2015-08-13compiler: Flatten erroneous subtrees into errors.Ian Lance Taylor4-19/+183
Between the lowering and flattening passes of the compiler, there are several passes that modify the lowered Go parse tree and as errors are discovered, several nodes transform into error nodes. However, for a higher level node such as a construction expression, the erroneous nodes in the subtrees might not propagate their error. The flatten phase for a node now looks for errors in the subtree and flattens the node into an error node if any are found. Fixes golang/go#11559, golang/go#11536, golang/go#11558. Reviewed-on: https://go-review.googlesource.com/13097 From-SVN: r226845
2015-08-12compiler: Don't make gc symbol for bad array type.Ian Lance Taylor2-2/+5
When parsing a malformed array type, i.e. invalid length, gccgo would loop indefinitely based off of a uninitialized length variable. Fixes golang/go#11539. Reviewed-on: https://go-review.googlesource.com/13066 From-SVN: r226825
2015-08-11compiler: Check for EOF in malformed signatures.Ian Lance Taylor2-2/+3
When parsing a malformed function declaration with invalid parameters, gccgo would infinitely loop looking for the end of the function declaration. Fixes golang/go#11530, golang/go#11531. Reviewed-on: https://go-review.googlesource.com/13065 From-SVN: r226795
2015-08-11compiler: Handle newlines in general comments.Ian Lance Taylor3-4/+13
On comments, the specification says (http://golang.org/ref/spec#Comments): General comments start with the character sequence /* and continue through the character sequence */. A general comment containing one or more newlines acts like a newline, otherwise it acts like a space. Fixes golang/go#11528. Reviewed-on: https://go-review.googlesource.com/13064 From-SVN: r226794
2015-08-11compiler: Don't make void-typed temporaries.Ian Lance Taylor2-2/+10
Fixes golang/go#11568. Reviewed-on: https://go-review.googlesource.com/12653 From-SVN: r226788
2015-08-07libgo/testsuite: don't call kill without argsIan Lance Taylor1-1/+1
If the timeout subshell has no child processes, the "xargs | kill" will fail. Ensure there is some input for kill before calling it. Reviewed-on: https://go-review.googlesource.com/13295 From-SVN: r226719
2015-08-04compiler: Verify pointer type's underlying type.Ian Lance Taylor2-1/+5
Fixes golang/go#11547. Reviewed-on: https://go-review.googlesource.com/13031 From-SVN: r226598
2015-08-04compiler: Use context to determine types of complex expressions.Ian Lance Taylor2-4/+3
When determining the type of a complex expression, it is important to recognize cases where a complex value can be represented as a real number. Fixes golang/go#11572. Reviewed-on: https://go-review.googlesource.com/12541 From-SVN: r226596
2015-08-04runtime: initialize variable to avoid compiler warningIan Lance Taylor1-1/+1
Reviewed-on: https://go-review.googlesource.com/13095 From-SVN: r226543
2015-08-03syscall: RawSockaddr fix for ppc64, ppc64leIan Lance Taylor1-1/+1
The struct RawSockaddr contains a field Data which should be uint8 on ppc64 and ppc64le, but is declared as int8 in gccgo. This change adds a two new files which contain the structure declaration for RawSockaddr, one with the correct types for for ppc64 and ppc64le, and the other for non-ppc64 platforms. Fixes golang/go#11469 Reviewed-on: https://go-review.googlesource.com/11946 From-SVN: r226533
2015-08-03compiler: Don't allow multiple function declarations.Ian Lance Taylor3-10/+7
Fixes golang/go#11573. Reviewed-on: https://go-review.googlesource.com/12508 From-SVN: r226529
2015-08-03compiler: Don't make erroneous type descriptors.Ian Lance Taylor2-2/+2
There is no need to make type descriptors for named types when there are errors during package compilation. Particularly, if the error in package compilation is from a malformed named type, there is no guarantee a type descriptor can be created. Fixes golang/go#11560. Reviewed-on: https://go-review.googlesource.com/12792 From-SVN: r226527
2015-08-03libgo/testsuite: kill sleep process in gotestIan Lance Taylor1-1/+1
This change modifies the "gotest" shell script to kill all processes, including "sleep", spawned by the timeout subshell. This prevents the sleep process from living beyond the gotest process. BACKGROUND The "gotest" shell script spawns "sleep" processes in the background to kill off test cases that run past their specified timeout. There are commands included that appear to kill the sleep process, but they only kill the parent shell, causing the sleep process to reparent. The orphaned sleep process can cause issues when gotest is run under some build systems, such as Ninja [0]. The particular issue with Ninja is the method it uses to identify terminated processes: it creates a pipe, passes the write end to the child process, and waits for EOF. In the case of libgo/gotest, the orphaned sleep process inherits the pipe FD and keeps it open for 4 minutes by default. [0] https://github.com/martine/ninja Reviewed-on: https://go-review.googlesource.com/12227 From-SVN: r226526
2015-08-03re PR go/67101 (mprof.goc:408:5: error: calling ↵Ian Lance Taylor1-1/+1
‘__builtin_frame_address’ with a nonzero argument is unsafe [-Werror=frame-address]) PR go/67101 runtime: Remove call to __builtin_frame_address. __builtin_frame_address was only supposed to use nonzero arguments for debugging purposes. Calling it with nonzero arguments can have unpredictable results and uses are now marked unsafe when -Wframe-address is enabled. Reviewed-on: https://go-review.googlesource.com/13063 From-SVN: r226525
2015-07-31compiler: Report errors for malformed builtin calls.Ian Lance Taylor2-2/+3
Errors reported from malformed builtin calls are handled in a later pass than the one in which they are detected. If a malformed builtin call is lowered into an error expression too early, these errors will never be reported. Fixes golang/go#11561. Reviewed-on: https://go-review.googlesource.com/12778 From-SVN: r226459
2015-07-31compiler: Check the type in function declarations.Ian Lance Taylor3-1/+36
Function declarations don't create a block where the variables listed in the parameter list are declared. Because there are no variables declared, the types of the parameter variables is unchecked, allowing for invalid values to be used as the type. This patch adds a special case to the check_types pass for function declarations. Fixes golang/go#11567. Reviewed-on: https://go-review.googlesource.com/12662 From-SVN: r226456
2015-07-31compiler: Update unicode tables.Ian Lance Taylor2-176/+313
Fixes golang/go#11569. Reviewed-on: https://go-review.googlesource.com/12652 From-SVN: r226452
2015-07-31compiler: Don't allow builtin function values.Ian Lance Taylor2-1/+23
According to the spec, http://golang.org/ref/spec#Built-in_functions: "built-in functions do not have standard Go types, so they can only appear in call expressions; they cannot be used as function values." Fixes golang/go#11570. Reviewed-on: https://go-review.googlesource.com/12543 From-SVN: r226448
2015-07-31go-lang.c (go_langhook_init_options_struct): Don't set x_flag_split_stack.Andreas Schwab2-4/+11
* go-lang.c (go_langhook_init_options_struct): Don't set x_flag_split_stack. (go_langhook_post_options): Set it here instead. From-SVN: r226428
2015-07-29syscall: Fix to libgo/mksysinfo.shIan Lance Taylor1-1/+1
In a recent change to mksysinfo.sh, a space was missing on some lines which caused the libgo build to hang on some systems. This corrects that problem. Fixes golang/go#11924 Reviewed-on: https://go-review.googlesource.com/12835 From-SVN: r226366