Hi Iain, On Sun, Nov 06, 2016 at 12:13:16PM -0800, Iain Sandoe wrote: > 2016-11-06 Iain Sandoe <i...@codesourcery.com> > > PR target/57438 > * config/i386/i386.c (ix86_code_end): Note that we emitted code where > the > function might otherwise appear empty for picbase thunks. > (ix86_output_function_epilogue): If we find a zero-sized function > assume that > reaching it is UB and trap. If we find a trailing label append a nop. > * config/rs6000/rs6000.c (rs6000_output_function_epilogue): If we find > a zero-sized function assume that reaching it is UB and trap. If we > find a > trailing label, append a nop.
These lines are too long. > diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c > index b0d2b64..326e2e9 100644 > --- a/gcc/config/rs6000/rs6000.c > +++ b/gcc/config/rs6000/rs6000.c > @@ -30148,11 +30148,16 @@ rs6000_output_function_epilogue (FILE *file, > { > #if TARGET_MACHO > macho_branch_islands (); > - /* Mach-O doesn't support labels at the end of objects, so if > - it looks like we might want one, insert a NOP. */ > + > + if (TARGET_MACHO) Both #if and if? > + /* Mach-O doesn't support labels at the end of objects, so if > + it looks like we might want one, take special action. > + > + First, collect any sequence deleted debug labels. */ "sequence of". > + /* If we have: > + label: > + barrier > + That need to be guarded. */ "then this needs to be guarded.", or similar? > + /* up to now we've only seen notes or barriers. */ Sentences start with a capital letter. > + /* See if have a completely empty function body. */ "we have" > + while (insn && ! INSN_P (insn)) > + insn = PREV_INSN (insn); > + /* If we don't find any, we've got an empty function body; i.e. "any insn"? > + completely empty - without a return or branch. GCC declares > + that reaching __builtin_unreachable() means UB (but we want > + finite-sized function bodies; to help the user out, let's trap > + the case. */ Zero is finite size; "non-empty function bodies"? The rs6000 code looks fine, thanks; but please work on the text a bit :-) Segher