public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix firefox FDO build
@ 2014-08-18 15:15 Jan Hubicka
  2014-08-19  8:09 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Hubicka @ 2014-08-18 15:15 UTC (permalink / raw)
  To: gcc-patches

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.

	* 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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix firefox FDO build
  2014-08-18 15:15 Fix firefox FDO build Jan Hubicka
@ 2014-08-19  8:09 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2014-08-19  8:09 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: GCC Patches

On Mon, Aug 18, 2014 at 5:15 PM, Jan Hubicka <hubicka@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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-19  8:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-18 15:15 Fix firefox FDO build Jan Hubicka
2014-08-19  8:09 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).