diff mbox

Partial fix for LTO bootstrap with Ada

Message ID 201201221542.26263.ebotcazou@adacore.com
State New
Headers show

Commit Message

Eric Botcazou Jan. 22, 2012, 2:42 p.m. UTC
The LTO bootstrap of the Ada compiler is currently plagued by at least three 
different problems.  The attached patch is for the easy one: it prevents fake 
variables whose type contains a placeholder from being created, which doesn't 
work in LTO mode because you cannot instantiate the PLACEHOLDER_EXPRs.  IIUC 
this is only a slight pessimization.

Bootstrapped/regtested on x86_64-suse-linux, OK for mainline?


2012-01-22  Eric Botcazou  <ebotcazou@adacore.com>

	* tree-ssa-structalias.c (intra_create_variable_infos): Do not create
	fake variables for restrict-qualified pointers whose pointed-to type
	contains a placeholder.

Comments

Richard Biener Jan. 23, 2012, 10:58 a.m. UTC | #1
On Sun, Jan 22, 2012 at 3:42 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> The LTO bootstrap of the Ada compiler is currently plagued by at least three
> different problems.  The attached patch is for the easy one: it prevents fake
> variables whose type contains a placeholder from being created, which doesn't
> work in LTO mode because you cannot instantiate the PLACEHOLDER_EXPRs.  IIUC
> this is only a slight pessimization.
>
> Bootstrapped/regtested on x86_64-suse-linux, OK for mainline?

Ok.

I suppose that's different from TYPE_NEEDS_CONSTRUCTING?  So
it fails doing the build_fake_var_decl?  Or does it fail elsewhere?

Thanks,
Richard.

>
> 2012-01-22  Eric Botcazou  <ebotcazou@adacore.com>
>
>        * tree-ssa-structalias.c (intra_create_variable_infos): Do not create
>        fake variables for restrict-qualified pointers whose pointed-to type
>        contains a placeholder.
>
>
> --
> Eric Botcazou
Eric Botcazou Jan. 23, 2012, 11:15 a.m. UTC | #2
> I suppose that's different from TYPE_NEEDS_CONSTRUCTING?  So
> it fails doing the build_fake_var_decl?

Yes, it fails in layout_decl because the VAR_DECL has self-referential size so 
you have PLACEHOLDER_EXPRs in the DECL_SIZE and we cannot handle them this 
late in LTO mode.  We don't use TYPE_NEEDS_CONSTRUCTING in Ada.
diff mbox

Patch

Index: tree-ssa-structalias.c
===================================================================
--- tree-ssa-structalias.c	(revision 183348)
+++ tree-ssa-structalias.c	(working copy)
@@ -5664,7 +5664,8 @@  intra_create_variable_infos (void)
 	 Treat restrict qualified references the same.  */
       if (TYPE_RESTRICT (TREE_TYPE (t))
 	  && ((DECL_BY_REFERENCE (t) && POINTER_TYPE_P (TREE_TYPE (t)))
-	      || TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE))
+	      || TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE)
+	  && !type_contains_placeholder_p (TREE_TYPE (TREE_TYPE (t))))
 	{
 	  struct constraint_expr lhsc, rhsc;
 	  varinfo_t vi;