Re: Drop target_option_node reconstruction logic.

2014-11-19 Thread H.J. Lu
On Fri, Nov 14, 2014 at 11:13 AM, Jan Hubicka hubi...@ucw.cz wrote:
 Hi,
 this patch kills lto's code to rebuilt DECL_FUNCTION_SPECIFIC_TARGET from 
 target
 attributes.  This code was never complete and it should be no-op now when we 
 save
 tehe target nodes.
 It also makes free_land_data_in_decl to actually anotate all function bodies 
 with
 a default option node.  The reason is that when LTOint units, one compiled 
 with
 default settings and one, say with -msse3, we want ot keep these functions 
 preserved.

 Incrementally i will proceed with similar changes for optimization nodes.

 Bootstrapped/regtested ppc64-linux, earlier version tested at x86_64-linux and
 firefox LTO, OK?

 Honza

 * lto.c (lto_read_decls): Do not rebuild 
 DECL_FUNCTION_SPECIFIC_TARGET.
 * tree.c (free_lang_data_in_decl): Annotate all functio nbodies with
 DECL_FUNCTION_SPECIFIC_TARGET.

It caused:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63917

-- 
H.J.


Re: Drop target_option_node reconstruction logic.

2014-11-19 Thread Jan Hubicka
 On Fri, Nov 14, 2014 at 11:13 AM, Jan Hubicka hubi...@ucw.cz wrote:
nz
  Hi,
  this patch kills lto's code to rebuilt DECL_FUNCTION_SPECIFIC_TARGET from 
  target
  attributes.  This code was never complete and it should be no-op now when 
  we save
  tehe target nodes.
  It also makes free_land_data_in_decl to actually anotate all function 
  bodies with
  a default option node.  The reason is that when LTOint units, one compiled 
  with
  default settings and one, say with -msse3, we want ot keep these functions 
  preserved.
 
  Incrementally i will proceed with similar changes for optimization nodes.
 
  Bootstrapped/regtested ppc64-linux, earlier version tested at x86_64-linux 
  and
  firefox LTO, OK?
 
  Honza
 
  * lto.c (lto_read_decls): Do not rebuild 
  DECL_FUNCTION_SPECIFIC_TARGET.
  * tree.c (free_lang_data_in_decl): Annotate all functio nbodies with
  DECL_FUNCTION_SPECIFIC_TARGET.
 
 It caused:
 
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63917
This one seems to be abou ifcft change by Zhenqiang?

Honza
 
 -- 
 H.J.


Re: Drop target_option_node reconstruction logic.

2014-11-19 Thread H.J. Lu
On Wed, Nov 19, 2014 at 10:11 AM, Jan Hubicka hubi...@ucw.cz wrote:
 On Fri, Nov 14, 2014 at 11:13 AM, Jan Hubicka hubi...@ucw.cz wrote:
 nz
  Hi,
  this patch kills lto's code to rebuilt DECL_FUNCTION_SPECIFIC_TARGET from 
  target
  attributes.  This code was never complete and it should be no-op now when 
  we save
  tehe target nodes.
  It also makes free_land_data_in_decl to actually anotate all function 
  bodies with
  a default option node.  The reason is that when LTOint units, one compiled 
  with
  default settings and one, say with -msse3, we want ot keep these functions 
  preserved.
 
  Incrementally i will proceed with similar changes for optimization nodes.
 
  Bootstrapped/regtested ppc64-linux, earlier version tested at x86_64-linux 
  and
  firefox LTO, OK?
 
  Honza
 
  * lto.c (lto_read_decls): Do not rebuild 
  DECL_FUNCTION_SPECIFIC_TARGET.
  * tree.c (free_lang_data_in_decl): Annotate all functio nbodies 
  with
  DECL_FUNCTION_SPECIFIC_TARGET.

 It caused:

 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63917
 This one seems to be abou ifcft change by Zhenqiang?

 Honza

 --
 H.J.

Oops. I meant:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63967
-- 
H.J.


Re: Drop target_option_node reconstruction logic.

2014-11-15 Thread Richard Biener
On November 14, 2014 8:13:15 PM CET, Jan Hubicka hubi...@ucw.cz wrote:
Hi,
this patch kills lto's code to rebuilt DECL_FUNCTION_SPECIFIC_TARGET
from target
attributes.  This code was never complete and it should be no-op now
when we save
tehe target nodes.
It also makes free_land_data_in_decl to actually anotate all function
bodies with
a default option node.  The reason is that when LTOint units, one
compiled with
default settings and one, say with -msse3, we want ot keep these
functions preserved.

Incrementally i will proceed with similar changes for optimization
nodes.

Bootstrapped/regtested ppc64-linux, earlier version tested at
x86_64-linux and
firefox LTO, OK?

OK.

Thanks,
Richard.

Honza

   * lto.c (lto_read_decls): Do not rebuild
DECL_FUNCTION_SPECIFIC_TARGET.
   * tree.c (free_lang_data_in_decl): Annotate all functio nbodies with
   DECL_FUNCTION_SPECIFIC_TARGET.
Index: lto/lto.c
===
--- lto/lto.c  (revision 217571)
+++ lto/lto.c  (working copy)
@@ -1935,15 +1935,6 @@
 if (TREE_CODE (t) == INTEGER_CST
  !TREE_OVERFLOW (t))
   cache_integer_cst (t);
-/* Re-build DECL_FUNCTION_SPECIFIC_TARGET, we need that
-   for both WPA and LTRANS stage.  */
-if (TREE_CODE (t) == FUNCTION_DECL)
-  {
-tree attr = lookup_attribute (target, DECL_ATTRIBUTES (t));
-if (attr)
-  targetm.target_option.valid_attribute_p
-  (t, NULL_TREE, TREE_VALUE (attr), 0);
-  }
 /* Register TYPE_DECLs with the debuginfo machinery.  */
 if (!flag_wpa
  TREE_CODE (t) == TYPE_DECL)
Index: tree.c
===
--- tree.c (revision 217571)
+++ tree.c (working copy)
@@ -5115,6 +5115,9 @@
the PARM_DECL will be used in the function's body).  */
 for (t = DECL_ARGUMENTS (decl); t; t = TREE_CHAIN (t))
   DECL_CONTEXT (t) = decl;
+if (!DECL_FUNCTION_SPECIFIC_TARGET (decl))
+  DECL_FUNCTION_SPECIFIC_TARGET (decl)
+= target_option_default_node;
   }
 
   /* DECL_SAVED_TREE holds the GENERIC representation for DECL.




Drop target_option_node reconstruction logic.

2014-11-14 Thread Jan Hubicka
Hi,
this patch kills lto's code to rebuilt DECL_FUNCTION_SPECIFIC_TARGET from target
attributes.  This code was never complete and it should be no-op now when we 
save
tehe target nodes.
It also makes free_land_data_in_decl to actually anotate all function bodies 
with
a default option node.  The reason is that when LTOint units, one compiled with
default settings and one, say with -msse3, we want ot keep these functions 
preserved.

Incrementally i will proceed with similar changes for optimization nodes.

Bootstrapped/regtested ppc64-linux, earlier version tested at x86_64-linux and
firefox LTO, OK?

Honza

* lto.c (lto_read_decls): Do not rebuild DECL_FUNCTION_SPECIFIC_TARGET.
* tree.c (free_lang_data_in_decl): Annotate all functio nbodies with
DECL_FUNCTION_SPECIFIC_TARGET.
Index: lto/lto.c
===
--- lto/lto.c   (revision 217571)
+++ lto/lto.c   (working copy)
@@ -1935,15 +1935,6 @@
  if (TREE_CODE (t) == INTEGER_CST
   !TREE_OVERFLOW (t))
cache_integer_cst (t);
- /* Re-build DECL_FUNCTION_SPECIFIC_TARGET, we need that
-for both WPA and LTRANS stage.  */
- if (TREE_CODE (t) == FUNCTION_DECL)
-   {
- tree attr = lookup_attribute (target, DECL_ATTRIBUTES (t));
- if (attr)
-   targetm.target_option.valid_attribute_p
-   (t, NULL_TREE, TREE_VALUE (attr), 0);
-   }
  /* Register TYPE_DECLs with the debuginfo machinery.  */
  if (!flag_wpa
   TREE_CODE (t) == TYPE_DECL)
Index: tree.c
===
--- tree.c  (revision 217571)
+++ tree.c  (working copy)
@@ -5115,6 +5115,9 @@
 the PARM_DECL will be used in the function's body).  */
  for (t = DECL_ARGUMENTS (decl); t; t = TREE_CHAIN (t))
DECL_CONTEXT (t) = decl;
+ if (!DECL_FUNCTION_SPECIFIC_TARGET (decl))
+   DECL_FUNCTION_SPECIFIC_TARGET (decl)
+ = target_option_default_node;
}
 
   /* DECL_SAVED_TREE holds the GENERIC representation for DECL.


Re: Drop target_option_node reconstruction logic.

2014-11-14 Thread Markus Trippelsdorf
On 2014.11.14 at 20:13 +0100, Jan Hubicka wrote:
 this patch kills lto's code to rebuilt DECL_FUNCTION_SPECIFIC_TARGET from 
 target
 attributes.  This code was never complete and it should be no-op now when we 
 save
 tehe target nodes.
 It also makes free_land_data_in_decl to actually anotate all function bodies 
 with
 a default option node.  The reason is that when LTOint units, one compiled 
 with
 default settings and one, say with -msse3, we want ot keep these functions 
 preserved.

FYI this patch finally fixes: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60607

Thanks.
-- 
Markus


Re: Drop target_option_node reconstruction logic.

2014-11-14 Thread Jan Hubicka
 On 2014.11.14 at 20:13 +0100, Jan Hubicka wrote:
  this patch kills lto's code to rebuilt DECL_FUNCTION_SPECIFIC_TARGET from 
  target
  attributes.  This code was never complete and it should be no-op now when 
  we save
  tehe target nodes.
  It also makes free_land_data_in_decl to actually anotate all function 
  bodies with
  a default option node.  The reason is that when LTOint units, one compiled 
  with
  default settings and one, say with -msse3, we want ot keep these functions 
  preserved.
 
 FYI this patch finally fixes: 
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60607

Yes, properly combining different target flags was the main motivation (so we
get correct LTO for firefox :) Still hope to be able to finish the
optimization_node part, so combining other flags will work as expected.

If you could turn this into a testcase, it would be cool.

Honza
 
 Thanks.
 -- 
 Markus