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: [PATCH] Add new built-in: __builtin_unreachable()


Richard Guenther wrote:
[...]

With this patch, is


  if (i > 1)
    __builtin_unreachable ();
  if (i > 1)
    ,,,

optimized so that the second test is always false?

Yes, the tree optimizers seem to remove the second if statement. However my testcase to verify this is ICEing while expanding to RTL saying that verify_flow_info failed. So perhaps a little more work is needed.


 Thus, is this patch
suitable to implement assert () for the NDEBUG case?


I would defer to others to decide if uses outside of the asm scenario make any sense.


David Daney

Thanks,
Richard.



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