This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: assertify mn10300


On May  7, 2005, Nathan Sidwell <nathan@codesourcery.com> wrote:

> Alexandre Oliva wrote:
>> I'm just a bit concerned about some of the changes from
>> `if (expr) abort ();' to `gcc_assert (expr);',

> such a transformation would be an error.  Can you point me at one,
> because I can't see any?

Oops, I meant `gcc_assert (!expr);', sorry.

The problem was not the inversion of the condition, but rather the
fact that, with checking disabled, the gcc_assert would be completely
optimized away, thus enabling the broken situation to skip the abort()
call and proceed to code that might fail to handle it properly.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]