On Mon, Aug 18, 2014 at 5:15 PM, Jan Hubicka <hubi...@ucw.cz> wrote:
> Hi,
> Firefox FDO build fails with undefined reference to __builtin_unreachable.  
> THis is caused by a bug
> in gimple-fold that introduces the refernece in the cases it hits impossible 
> devirtualization.
> We use __builtin_unreachable in the case we update call, but when updating 
> reference, we need
> to use something else.  This patch uses NULL - the program is undefined at 
> this point and NULL
> seems to fit the bill well (moreover this path is currently executed only for 
> FDO or speculative
> devirt code. No one introduces GIMPLE_ASSIGN with OBJ_TYPE_REF).
>
> Bootstrapped/regtsted x86_64-linux, will commit it shortly.

Err - you end up building the address of integer_zero_node.  That's
certainly totally bogus.  I think you want to do val = build_int_cst
(TREE_TYPE (val), 0)); instead

Please fix.

Thanks,
Richard.

>         * gimple-fold.c (fold_gimple_assign): Do not intorudce referneces
>         to BUILT_IN_UNREACHABLE.
> Index: gimple-fold.c
> ===================================================================
> --- gimple-fold.c       (revision 213860)
> +++ gimple-fold.c       (working copy)
> @@ -385,7 +385,9 @@ fold_gimple_assign (gimple_stmt_iterator
>                     if (targets.length () == 1)
>                       fndecl = targets[0]->decl;
>                     else
> -                     fndecl = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
> +                     /* We can not use __builtin_unreachable here because it
> +                        can not have address taken.  */
> +                     fndecl = integer_zero_node;
>                     if (dump_enabled_p ())
>                       {
>                         location_t loc = gimple_location_safe (stmt);

Reply via email to