diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-14 18:55:01 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-14 18:55:01 +0000 |
commit | bde1393a7b0583bc123ac962ed2f729b80cd7498 (patch) | |
tree | d9e8972ddece739bbdc248c5e33919ded2862cf7 /gcc/go | |
parent | 8f8a206e72c6183084a6792ae98593944dd06fbd (diff) | |
download | gcc-bde1393a7b0583bc123ac962ed2f729b80cd7498.tar.gz |
2016-04-14 Basile Starynkevitch <basile@starynkevitch.net>
{{merging with even more of GCC 6, using subversion 1.9
svn merge -r228401:229500 ^/trunk
}}
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@234985 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 15 | ||||
-rw-r--r-- | gcc/go/gofrontend/gogo.cc | 97 | ||||
-rw-r--r-- | gcc/go/gofrontend/gogo.h | 97 | ||||
-rw-r--r-- | gcc/go/gofrontend/lex.cc | 58 | ||||
-rw-r--r-- | gcc/go/gofrontend/parse.cc | 4 | ||||
-rw-r--r-- | gcc/go/gofrontend/unsafe.cc | 2 | ||||
-rw-r--r-- | gcc/go/gospec.c | 14 | ||||
-rw-r--r-- | gcc/go/lang.opt | 16 |
10 files changed, 193 insertions, 120 deletions
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index be1fd0cb09b..f25c898782b 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,11 @@ +2015-10-20 Alan Modra <amodra@gmail.com> + + PR go/66870 + * gospec.c (saw_opt_m32): Rename to.. + (is_m64): ..this, initialised by TARGET_CAN_SPLIT_STACK_64BIT. + Update uses. + (lang_specific_driver): Set is_m64 if OPT_m64, clear if OPT_m32. + 2015-10-01 Ian Lance Taylor <iant@google.com> PR go/66870 diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index eaa24dcbfef..6fcd18593a6 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -f187e13b712824b08f2a8833033840cd52a3b95a +11e249a59e8c627fe9c2938c38e39cb1efefb1fb The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 56bbf619bd8..0d25dda1f44 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -4909,14 +4909,7 @@ Binary_expression::do_lower(Gogo* gogo, Named_object*, Numeric_constant nc; if (!Binary_expression::eval_constant(op, &left_nc, &right_nc, location, &nc)) - { - if (nc.is_invalid()) - { - go_assert(saw_errors()); - return Expression::make_error(location); - } return this; - } return nc.expression(location); } } @@ -5200,13 +5193,13 @@ Binary_expression::do_flatten(Gogo* gogo, Named_object*, || (is_idiv_op && (gogo->check_divide_by_zero() || gogo->check_divide_overflow()))) { - if (!this->left_->is_variable()) + if (!this->left_->is_variable() && !this->left_->is_constant()) { temp = Statement::make_temporary(NULL, this->left_, loc); inserter->insert(temp); this->left_ = Expression::make_temporary_reference(temp, loc); } - if (!this->right_->is_variable()) + if (!this->right_->is_variable() && !this->right_->is_constant()) { temp = Statement::make_temporary(NULL, this->right_, loc); @@ -5601,7 +5594,9 @@ Binary_expression::do_check_types(Gogo*) if (left_type->integer_type() == NULL) this->report_error(_("shift of non-integer operand")); - if (!right_type->is_abstract() + if (right_type->is_string_type()) + this->report_error(_("shift count not unsigned integer")); + else if (!right_type->is_abstract() && (right_type->integer_type() == NULL || !right_type->integer_type()->is_unsigned())) this->report_error(_("shift count not unsigned integer")); diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index 5ecc55d0dbb..363fd5cff18 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -516,7 +516,6 @@ Gogo::import_package(const std::string& filename, { Package* package = p->second; package->set_location(location); - package->set_is_imported(); std::string ln = local_name; bool is_ln_exported = is_local_name_exported; if (ln.empty()) @@ -525,7 +524,9 @@ Gogo::import_package(const std::string& filename, go_assert(!ln.empty()); is_ln_exported = Lex::is_exported_name(ln); } - if (ln == ".") + if (ln == "_") + ; + else if (ln == ".") { Bindings* bindings = package->bindings(); for (Bindings::const_declarations_iterator p = @@ -533,11 +534,12 @@ Gogo::import_package(const std::string& filename, p != bindings->end_declarations(); ++p) this->add_dot_import_object(p->second); + std::string dot_alias = "." + package->package_name(); + package->add_alias(dot_alias, location); } - else if (ln == "_") - package->set_uses_sink_alias(); else { + package->add_alias(ln, location); ln = this->pack_hidden_name(ln, is_ln_exported); this->package_->bindings()->add_package(ln, package); } @@ -563,7 +565,6 @@ Gogo::import_package(const std::string& filename, "being compiled (see -fgo-pkgpath option)")); this->imports_.insert(std::make_pair(filename, package)); - package->set_is_imported(); } delete stream; @@ -1544,7 +1545,10 @@ Gogo::lookup(const std::string& name, Named_object** pfunction) const if (ret != NULL) { if (ret->package() != NULL) - ret->package()->note_usage(); + { + std::string dot_alias = "." + ret->package()->package_name(); + ret->package()->note_usage(dot_alias); + } return ret; } } @@ -1594,10 +1598,14 @@ Gogo::add_imported_package(const std::string& real_name, *padd_to_globals = false; - if (alias_arg == ".") - *padd_to_globals = true; - else if (alias_arg == "_") - ret->set_uses_sink_alias(); + if (alias_arg == "_") + ; + else if (alias_arg == ".") + { + *padd_to_globals = true; + std::string dot_alias = "." + real_name; + ret->add_alias(dot_alias, location); + } else { std::string alias = alias_arg; @@ -1606,6 +1614,7 @@ Gogo::add_imported_package(const std::string& real_name, alias = real_name; is_alias_exported = Lex::is_exported_name(alias); } + ret->add_alias(alias, location); alias = this->pack_hidden_name(alias, is_alias_exported); Named_object* no = this->package_->bindings()->add_package(alias, ret); if (!no->is_package()) @@ -2356,15 +2365,30 @@ Gogo::clear_file_scope() ++p) { Package* package = p->second; - if (package != this->package_ - && package->is_imported() - && !package->used() - && !package->uses_sink_alias() - && !quiet) - error_at(package->location(), "imported and not used: %s", - Gogo::message_name(package->package_name()).c_str()); - package->clear_is_imported(); - package->clear_uses_sink_alias(); + if (package != this->package_ && !quiet) + { + for (Package::Aliases::const_iterator p1 = package->aliases().begin(); + p1 != package->aliases().end(); + ++p1) + { + if (!p1->second->used()) + { + // Give a more refined error message if the alias name is known. + std::string pkg_name = package->package_name(); + if (p1->first != pkg_name && p1->first[0] != '.') + { + error_at(p1->second->location(), + "imported and not used: %s as %s", + Gogo::message_name(pkg_name).c_str(), + Gogo::message_name(p1->first).c_str()); + } + else + error_at(p1->second->location(), + "imported and not used: %s", + Gogo::message_name(pkg_name).c_str()); + } + } + } package->clear_used(); } } @@ -7741,8 +7765,7 @@ Package::Package(const std::string& pkgpath, const std::string& pkgpath_symbol, Location location) : pkgpath_(pkgpath), pkgpath_symbol_(pkgpath_symbol), package_name_(), bindings_(new Bindings(NULL)), priority_(0), - location_(location), used_(false), is_imported_(false), - uses_sink_alias_(false) + location_(location) { go_assert(!pkgpath.empty()); @@ -7796,6 +7819,16 @@ Package::set_priority(int priority) this->priority_ = priority; } +// Note that symbol from this package was and qualified by ALIAS. + +void +Package::note_usage(const std::string& alias) const +{ + Aliases::const_iterator p = this->aliases_.find(alias); + go_assert(p != this->aliases_.end()); + p->second->note_usage(); +} + // Forget a given usage. If forgetting this usage means this package becomes // unused, report that error. @@ -7811,7 +7844,7 @@ Package::forget_usage(Expression* usage) const if (this->fake_uses_.empty()) error_at(this->location(), "imported and not used: %s", - Gogo::message_name(this->package_name()).c_str()); + Gogo::message_name(this->package_name()).c_str()); } // Clear the used field for the next file. If the only usages of this package @@ -7820,10 +7853,26 @@ Package::forget_usage(Expression* usage) const void Package::clear_used() { - if (this->used_ > this->fake_uses_.size()) + std::string dot_alias = "." + this->package_name(); + Aliases::const_iterator p = this->aliases_.find(dot_alias); + if (p != this->aliases_.end() && p->second->used() > this->fake_uses_.size()) this->fake_uses_.clear(); - this->used_ = 0; + this->aliases_.clear(); +} + +Package_alias* +Package::add_alias(const std::string& alias, Location location) +{ + Aliases::const_iterator p = this->aliases_.find(alias); + if (p == this->aliases_.end()) + { + std::pair<Aliases::iterator, bool> ret; + ret = this->aliases_.insert(std::make_pair(alias, + new Package_alias(location))); + p = ret.first; + } + return p->second; } // Determine types of constants. Everything else in a package diff --git a/gcc/go/gofrontend/gogo.h b/gcc/go/gofrontend/gogo.h index 3af2af745fb..6333c834c35 100644 --- a/gcc/go/gofrontend/gogo.h +++ b/gcc/go/gofrontend/gogo.h @@ -2771,6 +2771,37 @@ class Unnamed_label Blabel* blabel_; }; +// An alias for an imported package. + +class Package_alias +{ + public: + Package_alias(Location location) + : location_(location), used_(0) + { } + + // The location of the import statement. + Location + location() + { return this->location_; } + + // How many symbols from the package were used under this alias. + size_t + used() const + { return this->used_; } + + // Note that some symbol was used under this alias. + void + note_usage() + { this->used_++; } + + private: + // The location of the import statement. + Location location_; + // The amount of times some name from this package was used under this alias. + size_t used_; +}; + // An imported package. class Package @@ -2793,7 +2824,7 @@ class Package void set_pkgpath_symbol(const std::string&); - // Return the location of the import statement. + // Return the location of the most recent import statement. Location location() const { return this->location_; } @@ -2829,15 +2860,18 @@ class Package bindings() { return this->bindings_; } - // Whether some symbol from the package was used. - bool - used() const - { return this->used_ > 0; } + // Type used to map import names to package aliases. + typedef std::map<std::string, Package_alias*> Aliases; - // Note that some symbol from this package was used. + // Return the set of package aliases. + const Aliases& + aliases() const + { return this->aliases_; } + + // Note that some symbol from this package was used and qualified by ALIAS. + // For dot imports, the ALIAS should be ".PACKAGE_NAME". void - note_usage() const - { this->used_++; } + note_usage(const std::string& alias) const; // Note that USAGE might be a fake usage of this package. void @@ -2852,36 +2886,6 @@ class Package void clear_used(); - // Whether this package was imported in the current file. - bool - is_imported() const - { return this->is_imported_; } - - // Note that this package was imported in the current file. - void - set_is_imported() - { this->is_imported_ = true; } - - // Clear the imported field for the next file. - void - clear_is_imported() - { this->is_imported_ = false; } - - // Whether this package was imported with a name of "_". - bool - uses_sink_alias() const - { return this->uses_sink_alias_; } - - // Note that this package was imported with a name of "_". - void - set_uses_sink_alias() - { this->uses_sink_alias_ = true; } - - // Clear the sink alias field for the next file. - void - clear_uses_sink_alias() - { this->uses_sink_alias_ = false; } - // Look up a name in the package. Returns NULL if the name is not // found. Named_object* @@ -2898,6 +2902,10 @@ class Package set_location(Location location) { this->location_ = location; } + // Add a package name as an ALIAS for this package. + Package_alias* + add_alias(const std::string& alias, Location); + // Add a constant to the package. Named_object* add_constant(const Typed_identifier& tid, Expression* expr) @@ -2942,18 +2950,13 @@ class Package // than the priority of all of the packages that it imports. This // is used to run init functions in the right order. int priority_; - // The location of the import statement. + // The location of the most recent import statement. Location location_; - // The amount of times some name from this package was used. This is mutable - // because we can use a package even if we have a const pointer to it. - mutable size_t used_; - // A set of possibly fake uses of this package. This is mutable because we + // The set of aliases associated with this package. + Aliases aliases_; + // A set of possibly fake uses of this package. This is mutable because we // can track fake uses of a package even if we have a const pointer to it. mutable std::set<Expression*> fake_uses_; - // True if this package was imported in the current file. - bool is_imported_; - // True if this package was imported with a name of "_". - bool uses_sink_alias_; }; // Return codes for the traversal functions. This is not an enum diff --git a/gcc/go/gofrontend/lex.cc b/gcc/go/gofrontend/lex.cc index 98d98da74ec..30167e581ac 100644 --- a/gcc/go/gofrontend/lex.cc +++ b/gcc/go/gofrontend/lex.cc @@ -1882,7 +1882,7 @@ static const Unicode_range unicode_letters[] = { 0x081a, 0x0824, 10}, { 0x0828, 0x0840, 24}, { 0x0841, 0x0858, 1}, - { 0x08a0, 0x08b2, 1}, + { 0x08a0, 0x08b4, 1}, { 0x0904, 0x0939, 1}, { 0x093d, 0x0950, 19}, { 0x0958, 0x0961, 1}, @@ -1915,7 +1915,8 @@ static const Unicode_range unicode_letters[] = { 0x0ab5, 0x0ab9, 1}, { 0x0abd, 0x0ad0, 19}, { 0x0ae0, 0x0ae1, 1}, - { 0x0b05, 0x0b0c, 1}, + { 0x0af9, 0x0b05, 12}, + { 0x0b06, 0x0b0c, 1}, { 0x0b0f, 0x0b10, 1}, { 0x0b13, 0x0b28, 1}, { 0x0b2a, 0x0b30, 1}, @@ -1940,9 +1941,9 @@ static const Unicode_range unicode_letters[] = { 0x0c12, 0x0c28, 1}, { 0x0c2a, 0x0c39, 1}, { 0x0c3d, 0x0c58, 27}, - { 0x0c59, 0x0c60, 7}, - { 0x0c61, 0x0c85, 36}, - { 0x0c86, 0x0c8c, 1}, + { 0x0c59, 0x0c5a, 1}, + { 0x0c60, 0x0c61, 1}, + { 0x0c85, 0x0c8c, 1}, { 0x0c8e, 0x0c90, 1}, { 0x0c92, 0x0ca8, 1}, { 0x0caa, 0x0cb3, 1}, @@ -1953,7 +1954,7 @@ static const Unicode_range unicode_letters[] = { 0x0d05, 0x0d0c, 1}, { 0x0d0e, 0x0d10, 1}, { 0x0d12, 0x0d3a, 1}, - { 0x0d3d, 0x0d4e, 17}, + { 0x0d3d, 0x0d5f, 17}, { 0x0d60, 0x0d61, 1}, { 0x0d7a, 0x0d7f, 1}, { 0x0d85, 0x0d96, 1}, @@ -2012,7 +2013,8 @@ static const Unicode_range unicode_letters[] = { 0x1312, 0x1315, 1}, { 0x1318, 0x135a, 1}, { 0x1380, 0x138f, 1}, - { 0x13a0, 0x13f4, 1}, + { 0x13a0, 0x13f5, 1}, + { 0x13f8, 0x13fd, 1}, { 0x1401, 0x166c, 1}, { 0x166f, 0x167f, 1}, { 0x1681, 0x169a, 1}, @@ -2034,7 +2036,7 @@ static const Unicode_range unicode_letters[] = { 0x1950, 0x196d, 1}, { 0x1970, 0x1974, 1}, { 0x1980, 0x19ab, 1}, - { 0x19c1, 0x19c7, 1}, + { 0x19b0, 0x19c9, 1}, { 0x1a00, 0x1a16, 1}, { 0x1a20, 0x1a54, 1}, { 0x1aa7, 0x1b05, 94}, @@ -2111,7 +2113,7 @@ static const Unicode_range unicode_letters[] = { 0x31a0, 0x31ba, 1}, { 0x31f0, 0x31ff, 1}, { 0x3400, 0x4db5, 1}, - { 0x4e00, 0x9fcc, 1}, + { 0x4e00, 0x9fd5, 1}, { 0xa000, 0xa48c, 1}, { 0xa4d0, 0xa4fd, 1}, { 0xa500, 0xa60c, 1}, @@ -2122,9 +2124,8 @@ static const Unicode_range unicode_letters[] = { 0xa6a0, 0xa6e5, 1}, { 0xa717, 0xa71f, 1}, { 0xa722, 0xa788, 1}, - { 0xa78b, 0xa78e, 1}, - { 0xa790, 0xa7ad, 1}, - { 0xa7b0, 0xa7b1, 1}, + { 0xa78b, 0xa7ad, 1}, + { 0xa7b0, 0xa7b7, 1}, { 0xa7f7, 0xa801, 1}, { 0xa803, 0xa805, 1}, { 0xa807, 0xa80a, 1}, @@ -2132,8 +2133,8 @@ static const Unicode_range unicode_letters[] = { 0xa840, 0xa873, 1}, { 0xa882, 0xa8b3, 1}, { 0xa8f2, 0xa8f7, 1}, - { 0xa8fb, 0xa90a, 15}, - { 0xa90b, 0xa925, 1}, + { 0xa8fb, 0xa8fd, 2}, + { 0xa90a, 0xa925, 1}, { 0xa930, 0xa946, 1}, { 0xa960, 0xa97c, 1}, { 0xa984, 0xa9b2, 1}, @@ -2160,9 +2161,8 @@ static const Unicode_range unicode_letters[] = { 0xab20, 0xab26, 1}, { 0xab28, 0xab2e, 1}, { 0xab30, 0xab5a, 1}, - { 0xab5c, 0xab5f, 1}, - { 0xab64, 0xab65, 1}, - { 0xabc0, 0xabe2, 1}, + { 0xab5c, 0xab65, 1}, + { 0xab70, 0xabe2, 1}, { 0xac00, 0xd7a3, 1}, { 0xd7b0, 0xd7c6, 1}, { 0xd7cb, 0xd7fb, 1}, @@ -2221,6 +2221,8 @@ static const Unicode_range unicode_letters[] = { 0x10840, 0x10855, 1}, { 0x10860, 0x10876, 1}, { 0x10880, 0x1089e, 1}, + { 0x108e0, 0x108f2, 1}, + { 0x108f4, 0x108f5, 1}, { 0x10900, 0x10915, 1}, { 0x10920, 0x10939, 1}, { 0x10980, 0x109b7, 1}, @@ -2238,6 +2240,8 @@ static const Unicode_range unicode_letters[] = { 0x10b60, 0x10b72, 1}, { 0x10b80, 0x10b91, 1}, { 0x10c00, 0x10c48, 1}, + { 0x10c80, 0x10cb2, 1}, + { 0x10cc0, 0x10cf2, 1}, { 0x11003, 0x11037, 1}, { 0x11083, 0x110af, 1}, { 0x110d0, 0x110e8, 1}, @@ -2246,9 +2250,14 @@ static const Unicode_range unicode_letters[] = { 0x11176, 0x11183, 13}, { 0x11184, 0x111b2, 1}, { 0x111c1, 0x111c4, 1}, - { 0x111da, 0x11200, 38}, - { 0x11201, 0x11211, 1}, + { 0x111da, 0x111dc, 2}, + { 0x11200, 0x11211, 1}, { 0x11213, 0x1122b, 1}, + { 0x11280, 0x11286, 1}, + { 0x11288, 0x1128a, 2}, + { 0x1128b, 0x1128d, 1}, + { 0x1128f, 0x1129d, 1}, + { 0x1129f, 0x112a8, 1}, { 0x112b0, 0x112de, 1}, { 0x11305, 0x1130c, 1}, { 0x1130f, 0x11310, 1}, @@ -2256,20 +2265,24 @@ static const Unicode_range unicode_letters[] = { 0x1132a, 0x11330, 1}, { 0x11332, 0x11333, 1}, { 0x11335, 0x11339, 1}, - { 0x1133d, 0x1135d, 32}, - { 0x1135e, 0x11361, 1}, + { 0x1133d, 0x11350, 19}, + { 0x1135d, 0x11361, 1}, { 0x11480, 0x114af, 1}, { 0x114c4, 0x114c5, 1}, { 0x114c7, 0x11580, 185}, { 0x11581, 0x115ae, 1}, + { 0x115d8, 0x115db, 1}, { 0x11600, 0x1162f, 1}, { 0x11644, 0x11680, 60}, { 0x11681, 0x116aa, 1}, + { 0x11700, 0x11719, 1}, { 0x118a0, 0x118df, 1}, { 0x118ff, 0x11ac0, 449}, { 0x11ac1, 0x11af8, 1}, - { 0x12000, 0x12398, 1}, + { 0x12000, 0x12399, 1}, + { 0x12480, 0x12543, 1}, { 0x13000, 0x1342e, 1}, + { 0x14400, 0x14646, 1}, { 0x16800, 0x16a38, 1}, { 0x16a40, 0x16a5e, 1}, { 0x16ad0, 0x16aed, 1}, @@ -2343,6 +2356,7 @@ static const Unicode_range unicode_letters[] = { 0x20000, 0x2a6d6, 1}, { 0x2a700, 0x2b734, 1}, { 0x2b740, 0x2b81d, 1}, + { 0x2b820, 0x2cea1, 1}, { 0x2f800, 0x2fa1d, 1}, }; diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index cc4377627e9..9d6a8c6f4a6 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -198,7 +198,7 @@ Parse::qualified_ident(std::string* pname, Named_object** ppackage) return false; } - package->package_value()->note_usage(); + package->package_value()->note_usage(Gogo::unpack_hidden_name(name)); token = this->advance_token(); if (!token->is_identifier()) @@ -2430,7 +2430,7 @@ Parse::operand(bool may_be_sink, bool* is_parenthesized) return Expression::make_error(location); } package = named_object->package_value(); - package->note_usage(); + package->note_usage(id); id = this->peek_token()->identifier(); is_exported = this->peek_token()->is_identifier_exported(); packed = this->gogo_->pack_hidden_name(id, is_exported); diff --git a/gcc/go/gofrontend/unsafe.cc b/gcc/go/gofrontend/unsafe.cc index ca9622569bd..9ed5b9d0d3c 100644 --- a/gcc/go/gofrontend/unsafe.cc +++ b/gcc/go/gofrontend/unsafe.cc @@ -32,8 +32,6 @@ Gogo::import_unsafe(const std::string& local_name, bool is_local_name_exported, } package->set_location(location); - package->set_is_imported(); - this->imports_.insert(std::make_pair("unsafe", package)); Bindings* bindings = package->bindings(); diff --git a/gcc/go/gospec.c b/gcc/go/gospec.c index ca3c2d70d68..a56ffe0fad1 100644 --- a/gcc/go/gospec.c +++ b/gcc/go/gospec.c @@ -120,8 +120,10 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, /* Whether the -S option was used. */ bool saw_opt_S = false; - /* Whether the -m32 option was used. */ - bool saw_opt_m32 ATTRIBUTE_UNUSED = false; +#ifdef TARGET_CAN_SPLIT_STACK_64BIT + /* Whether the -m64 option is in force. */ + bool is_m64 = TARGET_CAN_SPLIT_STACK_64BIT; +#endif /* The first input file with an extension of .go. */ const char *first_go_file = NULL; @@ -160,7 +162,11 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, #ifdef TARGET_CAN_SPLIT_STACK_64BIT case OPT_m32: - saw_opt_m32 = true; + is_m64 = false; + break; + + case OPT_m64: + is_m64 = true; break; #endif @@ -253,7 +259,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, #endif #ifdef TARGET_CAN_SPLIT_STACK_64BIT - if (!saw_opt_m32) + if (is_m64) supports_split_stack = 1; #endif diff --git a/gcc/go/lang.opt b/gcc/go/lang.opt index 4b1c671b323..3b304eac7bc 100644 --- a/gcc/go/lang.opt +++ b/gcc/go/lang.opt @@ -39,35 +39,35 @@ Go fgo-check-divide-zero Go Var(go_check_divide_zero) Init(1) -Add explicit checks for division by zero +Add explicit checks for division by zero. fgo-check-divide-overflow Go Var(go_check_divide_overflow) Init(1) -Add explicit checks for division overflow in INT_MIN / -1 +Add explicit checks for division overflow in INT_MIN / -1. fgo-dump- Go Joined RejectNegative --fgo-dump-<type> Dump Go frontend internal information +-fgo-dump-<type> Dump Go frontend internal information. fgo-optimize- Go Joined RejectNegative --fgo-optimize-<type> Turn on optimization passes in the frontend +-fgo-optimize-<type> Turn on optimization passes in the frontend. fgo-pkgpath= Go Joined RejectNegative --fgo-pkgpath=<string> Set Go package path +-fgo-pkgpath=<string> Set Go package path. fgo-prefix= Go Joined RejectNegative --fgo-prefix=<string> Set package-specific prefix for exported Go names +-fgo-prefix=<string> Set package-specific prefix for exported Go names. fgo-relative-import-path= Go Joined RejectNegative --fgo-relative-import-path=<path> Treat a relative import as relative to path +-fgo-relative-import-path=<path> Treat a relative import as relative to path. frequire-return-statement Go Var(go_require_return_statement) Init(1) Warning -Functions which return values must end with return statements +Functions which return values must end with return statements. o Go Joined Separate |