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()


On Wed, Jun 3, 2009 at 9:40 PM, David Daney <ddaney@caviumnetworks.com> wrote:
> 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.

Likely because the basic-block ends with just a barrier and lacks outgoing
edges.  You could try adding a fake edge to exit here ...

Richard.

>> ?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]