diff mbox

[committed] Fix ICE in pa_output_function_epilogue

Message ID BLU436-SMTP10022A8794657E4C093E35597BD0@phx.gbl
State New
Headers show

Commit Message

John David Anglin Sept. 28, 2014, 3:48 p.m. UTC
The attached change fixes a segmentation fault that occurs building  
llvm-toolchain-3.4.

Tested on hppa-unknown-linux-gnu.  Committed to trunk, 4.9 and 4.8  
branches.

Dave
--
John David Anglin	dave.anglin@bell.net
2014-09-28  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/pa.c (pa_output_function_epilogue): Only update
	last_address when a nonnote insn is found.
diff mbox

Patch

Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c	(revision 215649)
+++ config/pa/pa.c	(working copy)
@@ -4208,9 +4208,12 @@ 
     {
       last_address = extra_nop ? 4 : 0;
       insn = get_last_nonnote_insn ();
-      last_address += INSN_ADDRESSES (INSN_UID (insn));
-      if (INSN_P (insn))
-	last_address += insn_default_length (insn);
+      if (insn)
+	{
+	  last_address += INSN_ADDRESSES (INSN_UID (insn));
+	  if (INSN_P (insn))
+	    last_address += insn_default_length (insn);
+	}
       last_address = ((last_address + FUNCTION_BOUNDARY / BITS_PER_UNIT - 1)
 		      & ~(FUNCTION_BOUNDARY / BITS_PER_UNIT - 1));
     }