This is the mail archive of the
mailing list for the GCC project.
Re: Marking a builtin function as `noreturn'.
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: daniel dot towner at picochip dot com (Daniel Towner)
- Cc: pinskia at physics dot uc dot edu (Andrew Pinski), gcc at gcc dot gnu dot org
- Date: Wed, 1 Mar 2006 12:01:20 -0500 (EST)
- Subject: Re: Marking a builtin function as `noreturn'.
> Hi Andrew,
> The problem with calling __builtin_trap directly comes when several
> traps are called in the same function. For example, if a function
> contains several identical assertions on different code paths, then gcc
> will generate a single copy of the assertion, and branch to that copy
> from each of the original assertion sites. If an assertion is hit, it
> becomes impossible to tell which of the original source assertions this
> relates to. Note that this is an embedded processor, so the source line,
> error description and so on can't be embedded in the assertion, since
> that consumes too much space; all an assertion does is test the
> condition, and possibly call the HALT.
Well the easy way around this is have a function which just does halt but
sends the line number before halting. I don't see anyway around this really
except taking up more space.