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.ang...@bell.net
2014-09-28 John David Anglin <dang...@gcc.gnu.org>
* config/pa/pa.c (pa_output_function_epilogue): Only update
last_address when a nonnote insn is found.
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));
}