[ added missing cc of gcc-patches ]

On 23/10/15 17:46, Tom de Vries wrote:
[ Quote-pasted from
https://gcc.gnu.org/ml/gcc-patches/2012-01/msg01077.html ]

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?



I've just done an x86_64 bootstrap and reg-test (m64, m32), ada included
with this patch:
...
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 66a04b2..dc0cfc4 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -5887,7 +5887,10 @@ intra_create_variable_infos (struct function *fn)

        if (POINTER_TYPE_P (TREE_TYPE (t))
           && TYPE_RESTRICT (TREE_TYPE (t)))
-       make_constraint_from_global_restrict (p, "PARM_RESTRICT");
+       {
+         gcc_unreachable ();
+         make_constraint_from_global_restrict (p, "PARM_RESTRICT");
+       }
        else
         {
           for (; p; p = vi_next (p))
...
to detect the 'type_contains_placeholder_p' case, but the assert did not
trigger.

Is it possible to add an ada testcase that triggers the
'type_contains_placeholder_p' case?

Thanks,
- Tom

2012-01-22  Eric Botcazou  <ebotca...@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

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;

Reply via email to