The Go frontend was simply discarding blank labels, which caused it to accept invalid programs, such as:
func F() { for {} _: } This patch from Chris Manghane fixes the problem. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian
Index: gcc/config/arm/arm.c =================================================================== --- gcc/config/arm/arm.c (revision 225715) +++ gcc/config/arm/arm.c (working copy) @@ -22984,12 +22984,12 @@ arm_hard_regno_mode_ok (unsigned int reg return false; if (TARGET_THUMB1) - /* For the Thumb we only allow values bigger than SImode in - registers 0 - 6, so that there is always a second low - register available to hold the upper part of the value. - We probably we ought to ensure that the register is the - start of an even numbered register pair. */ - return (ARM_NUM_REGS (mode) < 2) || (regno < LAST_LO_REGNUM); + /* For the Thumb we only allow a value bigger than SImode in the + lo registers, and we require that the entire value fit in the + lo registers. We probably ought to ensure that the register is + the start of an even numbered register pair. */ + return (ARM_NUM_REGS (mode) < 2 + || regno + ARM_NUM_REGS (mode) - 1 <= LAST_LO_REGNUM); if (TARGET_HARD_FLOAT && TARGET_VFP && IS_VFP_REGNUM (regno)) Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 226007) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -19ff97ed3eb07d902bc4b3f97b21c4b6df834ad2 +5c49a77455f52ba2c7eddb5b831456dc1c67b02f The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: gcc/go/gofrontend/gogo.cc =================================================================== --- gcc/go/gofrontend/gogo.cc (revision 225757) +++ gcc/go/gofrontend/gogo.cc (working copy) @@ -1937,10 +1937,6 @@ Label* Gogo::add_label_definition(const std::string& label_name, Location location) { - // A label with a blank identifier is never declared or defined. - if (label_name == "_") - return NULL; - go_assert(!this->functions_.empty()); Function* func = this->functions_.back().function->func_value(); Label* label = func->add_label_definition(this, label_name, location); @@ -4724,7 +4720,13 @@ Function::add_label_definition(Gogo* gog std::pair<Labels::iterator, bool> ins = this->labels_.insert(std::make_pair(label_name, lnull)); Label* label; - if (ins.second) + if (label_name == "_") + { + label = Label::create_dummy_label(); + if (ins.second) + ins.first->second = label; + } + else if (ins.second) { // This is a new label. label = new Label(label_name); @@ -7625,6 +7627,20 @@ Label::get_addr(Translate_context* conte return context->backend()->label_address(label, location); } +// Return the dummy label that represents any instance of the blank label. + +Label* +Label::create_dummy_label() +{ + static Label* dummy_label; + if (dummy_label == NULL) + { + dummy_label = new Label("_"); + dummy_label->set_is_used(); + } + return dummy_label; +} + // Class Unnamed_label. // Get the backend representation for an unnamed label. Index: gcc/go/gofrontend/gogo.h =================================================================== --- gcc/go/gofrontend/gogo.h (revision 225750) +++ gcc/go/gofrontend/gogo.h (working copy) @@ -2688,6 +2688,10 @@ class Label Bexpression* get_addr(Translate_context*, Location location); + // Return a dummy label, representing any instance of the blank label. + static Label* + create_dummy_label(); + private: // The name of the label. std::string name_; Index: gcc/java/ChangeLog =================================================================== --- gcc/java/ChangeLog (revision 225715) +++ gcc/java/ChangeLog (working copy) @@ -1,3 +1,7 @@ +2014-07-11 Ian Lance Taylor <i...@google.com> + + * config-lang.in (build_by_default): Set to no. + 2015-07-10 Andrew MacLeod <amacl...@redhat.com> * java-gimplify.c: Include cfghooks.h rather than predict.h. Index: gcc/java/config-lang.in =================================================================== --- gcc/java/config-lang.in (revision 225715) +++ gcc/java/config-lang.in (working copy) @@ -36,5 +36,7 @@ gtfiles="\$(srcdir)/java/java-tree.h \$( target_libs=${libgcj_saved} lang_dirs="fastjar" -#build_by_default=no lang_requires=c++ + +# Do not build java by default. +build_by_default=no Index: gcc/testsuite/gcc.dg/complex-6.c =================================================================== --- gcc/testsuite/gcc.dg/complex-6.c (revision 0) +++ gcc/testsuite/gcc.dg/complex-6.c (working copy) @@ -0,0 +1,6 @@ +/* PR target/47540 */ +/* { dg-options "-O2 -std=gnu99" } */ + +extern double f1 (_Complex double); +extern _Complex double f2 (_Complex double); +_Complex double f (_Complex double x) { return f1 (x) == 0 ? 0 : f2 (x); }