Re: Stream out default optimization nodes
On Tue, Nov 18, 2014 at 9:29 AM, Jan Hubicka hubi...@ucw.cz wrote: On Tue, Nov 18, 2014 at 9:27 AM, Jan Hubicka hubi...@ucw.cz wrote: https://gcc.gnu.org/ml/gcc-regression/2014-11/msg00473.html /export/gnu/import/git/gcc-test-profiled/bld/./prev-gcc/xg++ -B/export/gnu/import/git/gcc-test-profiled/bld/./prev-gcc/ -B/usr/5.0.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++ -B/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -I/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include -I/export/gnu/import/git/gcc-test-profiled/src-trunk/libstdc++-v3/libsupc++ -L/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -g -O2 -flto=jobserver -frandom-seed=1 -fprofile-use -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc -o build/genmatch \ build/genmatch.o ../libcpp/libcpp.a ../libiberty/libiberty.a build/errors.o build/vec.o build/hash-table.o .././libiberty/libiberty.a ../../src-trunk/libcpp/lex.c: In function âend_directiveâ: ../../src-trunk/libcpp/lex.c:442:43: error: â__builtin_ia32_pcmpestri128â needs isa option -m32 -msse4.2 index = __builtin_ia32_pcmpestri128 (search, 4, sv, 16, 0); ^ make[7]: *** [/tmp/ccTC6Hk9.ltrans9.ltrans.o] Error 1 Indeed, it looks like the bug is that search_line_sse42 gets inlined int end_directive that is compiled w/o SSE support. Probably something that happened previously, too, just led to compiling the function with SSE4.2 I will need to setup -m32 LTO bootstrap enviornment... This is -m64 LTO, not -m32. OK then the message seems bogus, too. I will try to reproduce it. I opened: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63963 -- H.J.
Re: Stream out default optimization nodes
I opened: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63963 I am testing the following. This hunk apparently slipped from my earlier patch Index: tree-streamer-out.c === --- tree-streamer-out.c (revision 217668) +++ tree-streamer-out.c (working copy) @@ -676,10 +676,9 @@ write_ts_function_decl_tree_pointers (st bool ref_p) { stream_write_tree (ob, DECL_VINDEX (expr), ref_p); - /* DECL_STRUCT_FUNCTION is handled by lto_output_function. FIXME lto, - maybe it should be handled here? */ + /* DECL_STRUCT_FUNCTION is handled by lto_output_function. */ stream_write_tree (ob, DECL_FUNCTION_PERSONALITY (expr), ref_p); - /* DECL_FUNCTION_SPECIFIC_TARGET is regenerated. */ + stream_write_tree (ob, DECL_FUNCTION_SPECIFIC_TARGET (expr), ref_p); stream_write_tree (ob, DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr), ref_p); } Index: tree-streamer-in.c === --- tree-streamer-in.c (revision 217668) +++ tree-streamer-in.c (working copy) @@ -774,7 +774,7 @@ lto_input_ts_function_decl_tree_pointers DECL_VINDEX (expr) = stream_read_tree (ib, data_in); /* DECL_STRUCT_FUNCTION is loaded on demand by cgraph_get_body. */ DECL_FUNCTION_PERSONALITY (expr) = stream_read_tree (ib, data_in); - /* DECL_FUNCTION_SPECIFIC_TARGET is regenerated from attributes. */ + DECL_FUNCTION_SPECIFIC_TARGET (expr) = stream_read_tree (ib, data_in); DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr) = stream_read_tree (ib, data_in); /* If the file contains a function with an EH personality set, -- H.J.
Re: Stream out default optimization nodes
On Mon, Nov 17, 2014 at 10:38 AM, Jan Hubicka hubi...@ucw.cz wrote: Hi, this patch makes us to store default optimization node same way as we stream target node. This means that command line options given at compile time prevail those given at linktime. Previously we sort of combined both. We still have a lot of flags that are global (i.e. not marked as Optimization) but affect way how the unit is output. Since I woul dlike to replace the old option merging, I would like to add Global attribute to each of them in .opt file and generate streaming code for them same way as we do for optimization/target nodes. This patch regtested/bootstrapped x86_64-linux and in ealrier tree also ppc64-linux/ppc64-aix that do not work for me at the moment. I alosuse it in my tree for some time and tested firefox/libreoffice builds OK? Honza * tree.c (free_lang_data_in_decl): Store default optimization node. Index: tree.c === --- tree.c (revision 217659) +++ tree.c (working copy) @@ -5118,6 +5118,9 @@ free_lang_data_in_decl (tree decl) if (!DECL_FUNCTION_SPECIFIC_TARGET (decl)) DECL_FUNCTION_SPECIFIC_TARGET (decl) = target_option_default_node; + if (!DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl)) + DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) + = optimization_default_node; } /* DECL_SAVED_TREE holds the GENERIC representation for DECL. I think one of your LTO streaming change breaks GCC LTO build: https://gcc.gnu.org/ml/gcc-regression/2014-11/msg00473.html /export/gnu/import/git/gcc-test-profiled/bld/./prev-gcc/xg++ -B/export/gnu/import/git/gcc-test-profiled/bld/./prev-gcc/ -B/usr/5.0.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++ -B/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -I/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include -I/export/gnu/import/git/gcc-test-profiled/src-trunk/libstdc++-v3/libsupc++ -L/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -g -O2 -flto=jobserver -frandom-seed=1 -fprofile-use -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc -o build/genmatch \ build/genmatch.o ../libcpp/libcpp.a ../libiberty/libiberty.a build/errors.o build/vec.o build/hash-table.o .././libiberty/libiberty.a ../../src-trunk/libcpp/lex.c: In function âend_directiveâ: ../../src-trunk/libcpp/lex.c:442:43: error: â__builtin_ia32_pcmpestri128â needs isa option -m32 -msse4.2 index = __builtin_ia32_pcmpestri128 (search, 4, sv, 16, 0); ^ make[7]: *** [/tmp/ccTC6Hk9.ltrans9.ltrans.o] Error 1 -- H.J.
Re: Stream out default optimization nodes
https://gcc.gnu.org/ml/gcc-regression/2014-11/msg00473.html /export/gnu/import/git/gcc-test-profiled/bld/./prev-gcc/xg++ -B/export/gnu/import/git/gcc-test-profiled/bld/./prev-gcc/ -B/usr/5.0.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++ -B/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -I/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include -I/export/gnu/import/git/gcc-test-profiled/src-trunk/libstdc++-v3/libsupc++ -L/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -g -O2 -flto=jobserver -frandom-seed=1 -fprofile-use -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc -o build/genmatch \ build/genmatch.o ../libcpp/libcpp.a ../libiberty/libiberty.a build/errors.o build/vec.o build/hash-table.o .././libiberty/libiberty.a ../../src-trunk/libcpp/lex.c: In function âend_directiveâ: ../../src-trunk/libcpp/lex.c:442:43: error: â__builtin_ia32_pcmpestri128â needs isa option -m32 -msse4.2 index = __builtin_ia32_pcmpestri128 (search, 4, sv, 16, 0); ^ make[7]: *** [/tmp/ccTC6Hk9.ltrans9.ltrans.o] Error 1 Indeed, it looks like the bug is that search_line_sse42 gets inlined int end_directive that is compiled w/o SSE support. Probably something that happened previously, too, just led to compiling the function with SSE4.2 I will need to setup -m32 LTO bootstrap enviornment... Honza
Re: Stream out default optimization nodes
On Tue, Nov 18, 2014 at 9:27 AM, Jan Hubicka hubi...@ucw.cz wrote: https://gcc.gnu.org/ml/gcc-regression/2014-11/msg00473.html /export/gnu/import/git/gcc-test-profiled/bld/./prev-gcc/xg++ -B/export/gnu/import/git/gcc-test-profiled/bld/./prev-gcc/ -B/usr/5.0.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++ -B/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -I/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include -I/export/gnu/import/git/gcc-test-profiled/src-trunk/libstdc++-v3/libsupc++ -L/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -g -O2 -flto=jobserver -frandom-seed=1 -fprofile-use -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc -o build/genmatch \ build/genmatch.o ../libcpp/libcpp.a ../libiberty/libiberty.a build/errors.o build/vec.o build/hash-table.o .././libiberty/libiberty.a ../../src-trunk/libcpp/lex.c: In function âend_directiveâ: ../../src-trunk/libcpp/lex.c:442:43: error: â__builtin_ia32_pcmpestri128â needs isa option -m32 -msse4.2 index = __builtin_ia32_pcmpestri128 (search, 4, sv, 16, 0); ^ make[7]: *** [/tmp/ccTC6Hk9.ltrans9.ltrans.o] Error 1 Indeed, it looks like the bug is that search_line_sse42 gets inlined int end_directive that is compiled w/o SSE support. Probably something that happened previously, too, just led to compiling the function with SSE4.2 I will need to setup -m32 LTO bootstrap enviornment... This is -m64 LTO, not -m32. -- H.J.
Re: Stream out default optimization nodes
On Tue, Nov 18, 2014 at 9:27 AM, Jan Hubicka hubi...@ucw.cz wrote: https://gcc.gnu.org/ml/gcc-regression/2014-11/msg00473.html /export/gnu/import/git/gcc-test-profiled/bld/./prev-gcc/xg++ -B/export/gnu/import/git/gcc-test-profiled/bld/./prev-gcc/ -B/usr/5.0.0/x86_64-unknown-linux-gnu/bin/ -nostdinc++ -B/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -I/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include -I/export/gnu/import/git/gcc-test-profiled/src-trunk/libstdc++-v3/libsupc++ -L/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/export/gnu/import/git/gcc-test-profiled/bld/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -g -O2 -flto=jobserver -frandom-seed=1 -fprofile-use -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc -o build/genmatch \ build/genmatch.o ../libcpp/libcpp.a ../libiberty/libiberty.a build/errors.o build/vec.o build/hash-table.o .././libiberty/libiberty.a ../../src-trunk/libcpp/lex.c: In function âend_directiveâ: ../../src-trunk/libcpp/lex.c:442:43: error: â__builtin_ia32_pcmpestri128â needs isa option -m32 -msse4.2 index = __builtin_ia32_pcmpestri128 (search, 4, sv, 16, 0); ^ make[7]: *** [/tmp/ccTC6Hk9.ltrans9.ltrans.o] Error 1 Indeed, it looks like the bug is that search_line_sse42 gets inlined int end_directive that is compiled w/o SSE support. Probably something that happened previously, too, just led to compiling the function with SSE4.2 I will need to setup -m32 LTO bootstrap enviornment... This is -m64 LTO, not -m32. OK then the message seems bogus, too. I will try to reproduce it. Honza -- H.J.
Stream out default optimization nodes
Hi, this patch makes us to store default optimization node same way as we stream target node. This means that command line options given at compile time prevail those given at linktime. Previously we sort of combined both. We still have a lot of flags that are global (i.e. not marked as Optimization) but affect way how the unit is output. Since I woul dlike to replace the old option merging, I would like to add Global attribute to each of them in .opt file and generate streaming code for them same way as we do for optimization/target nodes. This patch regtested/bootstrapped x86_64-linux and in ealrier tree also ppc64-linux/ppc64-aix that do not work for me at the moment. I alosuse it in my tree for some time and tested firefox/libreoffice builds OK? Honza * tree.c (free_lang_data_in_decl): Store default optimization node. Index: tree.c === --- tree.c (revision 217659) +++ tree.c (working copy) @@ -5118,6 +5118,9 @@ free_lang_data_in_decl (tree decl) if (!DECL_FUNCTION_SPECIFIC_TARGET (decl)) DECL_FUNCTION_SPECIFIC_TARGET (decl) = target_option_default_node; + if (!DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl)) + DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) + = optimization_default_node; } /* DECL_SAVED_TREE holds the GENERIC representation for DECL.
Re: Stream out default optimization nodes
On November 17, 2014 7:38:24 PM CET, Jan Hubicka hubi...@ucw.cz wrote: Hi, this patch makes us to store default optimization node same way as we stream target node. This means that command line options given at compile time prevail those given at linktime. Previously we sort of combined both. We still have a lot of flags that are global (i.e. not marked as Optimization) but affect way how the unit is output. Since I woul dlike to replace the old option merging, I would like to add Global attribute to each of them in .opt file and generate streaming code for them same way as we do for optimization/target nodes. This patch regtested/bootstrapped x86_64-linux and in ealrier tree also ppc64-linux/ppc64-aix that do not work for me at the moment. I alosuse it in my tree for some time and tested firefox/libreoffice builds OK? OK. Thanks, Richard. Honza * tree.c (free_lang_data_in_decl): Store default optimization node. Index: tree.c === --- tree.c (revision 217659) +++ tree.c (working copy) @@ -5118,6 +5118,9 @@ free_lang_data_in_decl (tree decl) if (!DECL_FUNCTION_SPECIFIC_TARGET (decl)) DECL_FUNCTION_SPECIFIC_TARGET (decl) = target_option_default_node; +if (!DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl)) + DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) += optimization_default_node; } /* DECL_SAVED_TREE holds the GENERIC representation for DECL.