seen with r259224 on the trunk, x86 architectures, building the i2pd package: $ cat Crypto.ii class b { public: __attribute__((target("aes"))) b() {} __attribute__((target("default"))) b() {} }; class c { b d; }; void fn1() { c a; } __attribute__((target_clones("sse", "default"))) void e() {} $ g++ -std=c++11 -c -O0 -fPIE -Wall Crypto.ii during IPA pass: targetclone Crypto.ii:10:60: internal compiler error: in add_to_same_comdat_group, at symtab.c:460 __attribute__((target_clones("sse", "default"))) void e() {} ^ 0x59d301 symtab_node::add_to_same_comdat_group(symtab_node*) ../../src/gcc/symtab.c:460 0x12bbbc8 create_dispatcher_calls ../../src/gcc/multiple_target.c:157 0x12bbbc8 ipa_target_clone ../../src/gcc/multiple_target.c:437 0x12bbbc8 execute ../../src/gcc/multiple_target.c:466 Please submit a full bug report, with preprocessed source if appropriate.
I'll take a look.
Started with r249365.
It's fishy as we have b::b that has create an alias to __ct_base: #0 symtab_node::create_reference (this=<symtab_node * const 0x7ffff69192e0 "__ct_comp "/2>, referred_node=<symtab_node * 0x7ffff69195c0 "__ct_base "/4>, use_type=IPA_REF_ALIAS, stmt=<gimple 0x0>) at ../../gcc/symtab.c:604 #1 0x0000000000a7048b in symtab_node::resolve_alias (this=<symtab_node * const 0x7ffff69192e0 "__ct_comp "/2>, target=<symtab_node * 0x7ffff69195c0 "__ct_base "/4>, transparent=false) at ../../gcc/symtab.c:1670 #2 0x0000000000a86700 in symbol_table::process_same_body_aliases (this=0x7ffff67aa100) at ../../gcc/cgraphunit.c:709 #3 0x000000000075d516 in c_parse_final_cleanups () at ../../gcc/cp/decl2.c:4683 #4 0x0000000000ec25df in compile_file () at ../../gcc/toplev.c:455 #5 0x0000000000646d45 in do_compile () at ../../gcc/toplev.c:2132 #6 toplev::main (this=this@entry=0x7fffffffd87e, argc=<optimized out>, argc@entry=20, argv=<optimized out>, argv@entry=0x7fffffffd978) at ../../gcc/toplev.c:2267 #7 0x00000000006492fb in main (argc=20, argv=0x7fffffffd978) at ../../gcc/main.c:39 Is it valid to clone the __ct_comp and redirect the alias for the clones? Nathan?
(In reply to Martin Liška from comment #3) > It's fishy as we have b::b that has create an alias to __ct_base: > > #0 symtab_node::create_reference (this=<symtab_node * const 0x7ffff69192e0 > "__ct_comp "/2>, referred_node=<symtab_node * 0x7ffff69195c0 "__ct_base > "/4>, use_type=IPA_REF_ALIAS, stmt=<gimple 0x0>) at ../../gcc/symtab.c:604 > #1 0x0000000000a7048b in symtab_node::resolve_alias (this=<symtab_node * > const 0x7ffff69192e0 "__ct_comp "/2>, target=<symtab_node * 0x7ffff69195c0 > "__ct_base "/4>, transparent=false) at ../../gcc/symtab.c:1670 > #2 0x0000000000a86700 in symbol_table::process_same_body_aliases > (this=0x7ffff67aa100) at ../../gcc/cgraphunit.c:709 > #3 0x000000000075d516 in c_parse_final_cleanups () at > ../../gcc/cp/decl2.c:4683 > #4 0x0000000000ec25df in compile_file () at ../../gcc/toplev.c:455 > #5 0x0000000000646d45 in do_compile () at ../../gcc/toplev.c:2132 > #6 toplev::main (this=this@entry=0x7fffffffd87e, argc=<optimized out>, > argc@entry=20, argv=<optimized out>, argv@entry=0x7fffffffd978) at > ../../gcc/toplev.c:2267 > #7 0x00000000006492fb in main (argc=20, argv=0x7fffffffd978) at > ../../gcc/main.c:39 > > Is it valid to clone the __ct_comp and redirect the alias for the clones? > Nathan? Forget about it, issue of this PR is somewhere else. I'm testing a patch candidate.
Matthias can you please point to source files of the project? And can you please attach full preprocessed source file? Thanks.
Created attachment 43910 [details] preprocessed source source package is https://launchpad.net/ubuntu/+source/i2pd upstream is http://i2pd.website/
Author: marxin Date: Tue Apr 17 05:40:39 2018 New Revision: 259428 URL: https://gcc.gnu.org/viewcvs?rev=259428&root=gcc&view=rev Log: Make redirection only for target_clones: V3 (PR ipa/85329). 2018-04-17 Martin Liska <mliska@suse.cz> PR ipa/85329 * multiple_target.c (create_dispatcher_calls): Set apostrophes for target_clone error message. Make default implementation clone to be a local declaration. (separate_attrs): Add new argument and check for an empty string. (expand_target_clones): Handle it. (ipa_target_clone): Make redirection just for target_clones functions. 2018-04-17 Martin Liska <mliska@suse.cz> PR ipa/85329 * g++.dg/ext/pr85329-2.C: New test. * g++.dg/ext/pr85329.C: New test. * gcc.target/i386/mvc12.c: New test. Added: trunk/gcc/testsuite/g++.dg/ext/pr85329-2.C trunk/gcc/testsuite/g++.dg/ext/pr85329.C trunk/gcc/testsuite/gcc.target/i386/mvc12.c Modified: trunk/gcc/ChangeLog trunk/gcc/multiple_target.c trunk/gcc/testsuite/ChangeLog
Fixed on trunk.