diff mbox

Go patch committed: Don't move nil subexpressions into temporaries

Message ID CAOyqgcWsF5HSwRGW_yz6dL==C4bdd6E8q3JE3kNm4csYj1Zd8Q@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Dec. 13, 2014, 1:41 a.m. UTC
This patch from Chris Manghane changes the Go frontend to avoid moving
nil subexpressions into temporary variables.  This fixes GCC PR 61254,
a compiler crash on some rather unlikely, but valid, code.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian
diff mbox

Patch

diff -r f557f41e0008 go/statements.cc
--- a/go/statements.cc	Fri Dec 12 17:00:18 2014 -0800
+++ b/go/statements.cc	Fri Dec 12 17:40:13 2014 -0800
@@ -677,7 +677,8 @@ 
 {
   if (this->skip_ > 0)
     --this->skip_;
-  else if ((*pexpr)->temporary_reference_expression() == NULL)
+  else if ((*pexpr)->temporary_reference_expression() == NULL
+	   && !(*pexpr)->is_nil_expression())
     {
       Location loc = (*pexpr)->location();
       Temporary_statement* temp = Statement::make_temporary(NULL, *pexpr, loc);