[assert]: remaining c*.c files

Nathan Sidwell nathan@codesourcery.com
Tue Sep 7 16:54:00 GMT 2004


Giovanni Bajo wrote:

Thanks for scanning over my patches!

> Nathan Sidwell wrote:
> 


>>      default:
>>!       /* All other notes should have already been eliminated.
>>!        */
>>!       gcc_assert (NOTE_LINE_NUMBER (insn) >= 0);
>>!
>>        /* It is possible that no_line_number is set and the note
>>           won't be emitted.  */
>>        emit_note_copy (insn);
>>      }
>>    break;
>>  default:
>>!   gcc_unreachable ();
>>  }
>>      }
>>    insn = NEXT_INSN (last);
> 
> 
> This change appears dubious to me. Shouldn't the cases you removed still be
> there with gcc_unreachable? Otherwise they will assert only if
> NOTE_LINE_NUMBER >= 0, while before they were always aborting.
the assertion for lineno >=0 will catch the other notes -- notes look
like negatively numbered line numbers.

>>*************** cgraph_mark_functions_to_output (void)
>>*** 773,785 ****

> I converted some of these to gcc_unreachable, because it is still valuable
> to emit the error dump.

yeah, I'm not entirely sure what the best solution is here.  I've come
across some other instances in emit-rtl.c.  gcc_unreachable is not
quite right, because, if the condition is met, that point will be reached.
(If we're telling the compiler that that point is unreachable, when it becomes
sufficiently smart, it'll deduce that all paths to that point are untraversable
...)

We should probably be explicitly saying 'internal_error'.  puking the cgraph
node looks kind of unprofessional in a release compiler.


nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk




More information about the Gcc-patches mailing list