Commit a04d9035 by Jan Hubicka Committed by Jan Hubicka

tree-pass.h (make_pass_ipa_comdats): New pass.


	* tree-pass.h (make_pass_ipa_comdats): New pass.
	* timevar.def (TV_IPA_COMDATS): New timevar.
	* passes.def (pass_ipa_comdats): Add.
	* Makefile.in (OBJS): Add ipa-comdats.o
	* ipa-comdats.c: New file.

	* g++.dg/ipa/comdat.C: New file.

From-SVN: r210597
parent 449cdb37
2014-05-17 Jan Hubicka <hubicka@ucw.cz>
* tree-pass.h (make_pass_ipa_comdats): New pass.
* timevar.def (TV_IPA_COMDATS): New timevar.
* passes.def (pass_ipa_comdats): Add.
* Makefile.in (OBJS): Add ipa-comdats.o
* ipa-comdats.c: New file.
2014-05-17 Jan Hubicka <hubicka@ucw.cz>
* ipa.c (update_visibility_by_resolution_info): New function.
(function_and_variable_visibility): Use it.
......
......@@ -1269,6 +1269,7 @@ OBJS = \
ipa-devirt.o \
ipa-split.o \
ipa-inline.o \
ipa-comdats.o \
ipa-inline-analysis.o \
ipa-inline-transform.o \
ipa-profile.o \
......
......@@ -110,6 +110,10 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_ipa_inline);
NEXT_PASS (pass_ipa_pure_const);
NEXT_PASS (pass_ipa_reference);
/* Comdat privatization come last, as direct references to comdat local
symbols are not allowed outside of the comdat group. Privatizing early
would result in missed optimizations due to this restriction. */
NEXT_PASS (pass_ipa_comdats);
TERMINATE_PASS_LIST ()
/* Simple IPA passes executed after the regular passes. In WHOPR mode the
......
2014-05-17 Jan Hubicka <hubicka@ucw.cz>
* g++.dg/ipa/comdat.C: New file.
2014-05-18 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/volatile12.ad[sb]: New test.
......
/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fdump-ipa-comdats" } */
#include <stdio.h>
__attribute__ ((noinline))
static int q(void)
{
return printf ("test");
}
inline int t(void)
{
return q();
}
int (*f)()=t;
/* { dg-final { scan-ipa-dump-times "Localizing symbol" 1 "comdats" } } */
/* { dg-final { cleanup-ipa-dump "comdats" } } */
......@@ -71,6 +71,7 @@ DEFTIMEVAR (TV_IPA_DEVIRT , "ipa devirtualization")
DEFTIMEVAR (TV_IPA_CONSTANT_PROP , "ipa cp")
DEFTIMEVAR (TV_IPA_INLINING , "ipa inlining heuristics")
DEFTIMEVAR (TV_IPA_FNSPLIT , "ipa function splitting")
DEFTIMEVAR (TV_IPA_COMDATS , "ipa comdats")
DEFTIMEVAR (TV_IPA_OPT , "ipa various optimizations")
DEFTIMEVAR (TV_IPA_LTO_GIMPLE_IN , "ipa lto gimple in")
DEFTIMEVAR (TV_IPA_LTO_GIMPLE_OUT , "ipa lto gimple out")
......
......@@ -472,6 +472,7 @@ extern simple_ipa_opt_pass *make_pass_ipa_tm (gcc::context *ctxt);
extern simple_ipa_opt_pass *make_pass_omp_simd_clone (gcc::context *ctxt);
extern ipa_opt_pass_d *make_pass_ipa_profile (gcc::context *ctxt);
extern ipa_opt_pass_d *make_pass_ipa_cdtor_merge (gcc::context *ctxt);
extern ipa_opt_pass_d *make_pass_ipa_comdats (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_cleanup_cfg_post_optimizing (gcc::context
*ctxt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment