Bug 64982 - [5 Regression] Many g++ failures on x86_64-apple-darwin14 with -m32.
Summary: [5 Regression] Many g++ failures on x86_64-apple-darwin14 with -m32.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ipa (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-09 14:21 UTC by Dominique d'Humieres
Modified: 2015-02-10 16:39 UTC (History)
4 users (show)

See Also:
Host: x86_64-apple-darwin14
Target: x86_64-apple-darwin14
Build: x86_64-apple-darwin14
Known to work:
Known to fail:
Last reconfirmed: 2015-02-09 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominique d'Humieres 2015-02-09 14:21:55 UTC
At revision r220526 there are many g++ failures on x86_64-apple-darwin14 with -m32: see https://gcc.gnu.org/ml/gcc-testresults/2015-02/msg00974.html. Revision r220506 is OK. The ICEs are of the kind

/opt/gcc/_clean/gcc/testsuite/g++.dg/abi/covariant2.C:29:28: internal compiler error: Segmentation fault: 11
 c6* c24::f6() {  return 0; }
                            ^

and the backtrace is

* thread #1: tid = 0x6290629, 0x0000000100679ae7 cc1plus`cgraph_node::function_symbol(this=<unavailable>, availability=0x0000000000000000) + 71 at cgraph.c:3129, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x0000000100679ae7 cc1plus`cgraph_node::function_symbol(this=<unavailable>, availability=0x0000000000000000) + 71 at cgraph.c:3129
   3126	
   3127	  while (node->thunk.thunk_p)
   3128	    {
-> 3129	      node = node->callees->callee;
   3130	      if (availability)
   3131		{
   3132		  enum availability a;
(lldb) bt
* thread #1: tid = 0x6290629, 0x0000000100679ae7 cc1plus`cgraph_node::function_symbol(this=<unavailable>, availability=0x0000000000000000) + 71 at cgraph.c:3129, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
  * frame #0: 0x0000000100679ae7 cc1plus`cgraph_node::function_symbol(this=<unavailable>, availability=0x0000000000000000) + 71 at cgraph.c:3129
    frame #1: 0x0000000100eb8281 cc1plus`ix86_function_regparm(type=0x0000000142776a80, decl=0x0000000142777bd0) + 305 at i386.c:5774
    frame #2: 0x0000000100eba687 cc1plus`x86_can_output_mi_thunk((null)=<unavailable>, (null)=<unavailable>, vcall_offset=-16, function=0x0000000142777bd0) + 55 at i386.c:42800
    frame #3: 0x000000010019c0f8 cc1plus`use_thunk(thunk_fndecl=0x0000000142777e58, emit_p=<unavailable>) + 1416 at method.c:422
    frame #4: 0x00000001001b7ddd cc1plus`emit_associated_thunks(fn=<unavailable>) + 509 at semantics.c:4031
    frame #5: 0x00000001001b828b cc1plus`expand_or_defer_fn(fn=0x0000000142777288) + 59 at semantics.c:4122
    frame #6: 0x000000010014aed8 cc1plus`cp_parser_function_definition_after_declarator(parser=0x0000000142767000, inline_p=<unavailable>) + 248 at parser.c:23481
    frame #7: 0x000000010014be27 cc1plus`cp_parser_init_declarator + 3207 at parser.c:23385
    frame #8: 0x000000010014d54e cc1plus`cp_parser_simple_declaration(parser=0x0000000142767000, function_definition_allowed_p=true, maybe_range_for_decl=0x0000000000000000) + 558 at parser.c:11601
    frame #9: 0x000000010014d904 cc1plus`cp_parser_block_declaration(parser=0x0000000142767000, statement_p=<unavailable>) + 116 at parser.c:11475
    frame #10: 0x00000001001568ca cc1plus`cp_parser_declaration(parser=0x0000000142767000) + 394 at parser.c:11372
    frame #11: 0x0000000100156b7d cc1plus`cp_parser_declaration_seq_opt(parser=0x0000000142767000) + 125 at parser.c:11258
    frame #12: 0x0000000100156ed2 cc1plus`c_parse_file() + 22 at parser.c:4109
    frame #13: 0x0000000100156ebc cc1plus`c_parse_file() + 604
    frame #14: 0x00000001002a1e76 cc1plus`c_common_parse_file() + 246 at c-opts.c:1052
    frame #15: 0x0000000100b6921c cc1plus`compile_file + 44 at toplev.c:594
    frame #16: 0x0000000100fe6507 cc1plus`toplev::main(int, char**) + 1288 at toplev.c:2066
    frame #17: 0x0000000100fe5fff cc1plus`toplev::main(this=<unavailable>, argc=4, argv=0x00007fff5fbff328) + 719
    frame #18: 0x0000000100fe720c cc1plus`main(argc=<unavailable>, argv=<unavailable>) + 44 at main.c:39
Comment 1 Jack Howarth 2015-02-09 14:49:36 UTC
Author: hubicka
Date: Sun Feb  8 21:08:44 2015
New Revision: 220521

URL: https://gcc.gnu.org/viewcvs?rev=220521&root=gcc&view=rev
Log:

	PR ipa/63566 
	* ipa-visibility.c (cgraph_node::non_local_p): Accept aliases.
	(cgraph_node::local_p): Remove thunk related FIXME.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-visibility.c

might be a likely suspect.
Comment 2 Jack Howarth 2015-02-09 16:13:36 UTC
Actually reverting...

Author: hubicka
Date: Sun Feb  8 21:04:41 2015
New Revision: 220520

URL: https://gcc.gnu.org/viewcvs?rev=220520&root=gcc&view=rev
Log:
	PR ipa/63566 
	* i386.c (ix86_function_regparm): Look through aliases to see if callee
	is local and optimized.
	(ix86_function_sseregparm): Likewise; also use target's SSE math
	settings; error out instead of silently generating wrong code
	on mismatches.
	(init_cumulative_args): Look through aliases.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c

eliminates the ICEs in g++.dg/abi/covariant2.C at -m32 on x86_64-apple-darwin14. Probably related to the absence of alias support on darwin.
Comment 3 Jan Hubicka 2015-02-09 18:54:44 UTC
Hmm, I see. The problem is that asm_out.can_output_mi_thunk now needs to walk alias to know what ABI the callee function uses and aliases are not analyzed at this point. I solved similar issue in cgraphunit, I think we can safely move that diagnostics there.
Comment 4 Dominique d'Humieres 2015-02-09 19:04:18 UTC
> Actually reverting...
>
> Author: hubicka
> Date: Sun Feb  8 21:04:41 2015
> New Revision: 220520
>
> ...
>
> eliminates the ICEs in g++.dg/abi/covariant2.C at -m32 on
> x86_64-apple-darwin14. Probably related to the absence of alias support on
> darwin.

Actually it eliminates all the new ICES.
Comment 5 Jan Hubicka 2015-02-09 21:08:59 UTC
Possible fix posted at https://gcc.gnu.org/ml/gcc-patches/2015-02/msg00566.html
Does it fix the ICEs and keeps the diagnostics sane?
Comment 6 Jack Howarth 2015-02-10 01:43:18 UTC
(In reply to Jan Hubicka from comment #5)
> Possible fix posted at
> https://gcc.gnu.org/ml/gcc-patches/2015-02/msg00566.html
> Does it fix the ICEs and keeps the diagnostics sane?

I can confirm that the proposed patch bootstraps on x86_64-apple-darwin14 and eliminates all of the regressions at -m32/-m64 in the g++ test suite that were introduced by r220520.
Comment 7 Jan Hubicka 2015-02-10 16:39:03 UTC
Author: hubicka
Date: Tue Feb 10 16:38:31 2015
New Revision: 220587

URL: https://gcc.gnu.org/viewcvs?rev=220587&root=gcc&view=rev
Log:
	PR ipa/64982
	* cgraphunit.c (cgraph_node::expand_thunk): Look for stdarg
	thunks.
	* method.c (use_thunk): Do not check for stdarg thunks.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cgraphunit.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/method.c
Comment 8 Jan Hubicka 2015-02-10 16:39:43 UTC
Fixed.