[Bug bootstrap/49383] [4.7 regression] powerpc64-linux bootstrap failure due to ice in cgraph_only_called_directly_p

2011-06-23 Thread hubicka at ucw dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49383

--- Comment #8 from Jan Hubicka hubicka at ucw dot cz 2011-06-23 17:09:43 UTC 
---
Hi,
sorry for late reply, I was not reading bugs ML very curefully on the GCC
gathering...
 Honza, the code here is called during expansion of functions.  If called at 
 the
 start of a function body, the function is attempting to answer the question:
 Can this function be called from anywhere external to this object file?
 If called for the expansion of a call then the question is:
 Can this function call go to a function external to this object file?
 Then, once those questions are answered, further code checks whether function
 arguments and return value might be affected by the ABI in force.
 
 We aren't at all interested in local functions, so I don't think c_node-local
 and c_node-can_change_signature are relevant.  At least, I don't see that 
 they
 give any more information than cgraph_only_called_directly_p relevant to the
 questions call_ABI_of_interest is trying to answer.

Hmm, it seems that I managed to invent here quite confusing variants of same
test.
Ideas for improvements here are certainly welcome.

Function is local if
 a) it is not having address taken
 b) it is not exported from current unit
 c) it is locally defined
 d) it is not extern inline function.
 e) it is not static ctor or dtor 

Function is only called directly must match a,b,c and e. I.e. it can be extern
inline
and this fact is useful for i.e. ipa-cp cloning decisions.

This however makes no difference at backend compilation, since all offline
copies of extern inlines are eliminated by that time. So when not doing WHOPR
both predicates are equivalent at the time you are querying them.

Main difference is that locality is defined at WPA time, while
cgraph_only_called_directly_p is computed from cgraph.  This means that in
WHOPR
when you have function A only called directly from function B and functoin A
goes
into partition 1 while, function B into partition 2,
cgraph_only_called_directly_p
at the ltrans stage will return 0, while the function will still be local.

i386 backend use the locality test to alter the ABI and it can consequentely
use
the register calling conventions cross the ltrans boubdaries (relying that both
parallel ltrans compilation will make the same decisions to alter the ABI).
I am not sure what call_ABI_of_interest control, really, but I can't imagine
it being too different from i386 case.

Honza


[Bug bootstrap/49383] [4.7 regression] powerpc64-linux bootstrap failure due to ice in cgraph_only_called_directly_p

2011-06-22 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49383

Alan Modra amodra at gmail dot com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 AssignedTo|unassigned at gcc dot   |amodra at gmail dot com
   |gnu.org |


[Bug bootstrap/49383] [4.7 regression] powerpc64-linux bootstrap failure due to ice in cgraph_only_called_directly_p

2011-06-22 Thread amodra at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49383

--- Comment #6 from Alan Modra amodra at gcc dot gnu.org 2011-06-23 02:21:03 
UTC ---
Author: amodra
Date: Thu Jun 23 02:21:01 2011
New Revision: 175328

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=175328
Log:
PR bootstrap/49383
* config/rs6000/rs6000.c (call_ABI_of_interest): Adjust cgraph
invocation for 2011-06-09 changes.


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


[Bug bootstrap/49383] [4.7 regression] powerpc64-linux bootstrap failure due to ice in cgraph_only_called_directly_p

2011-06-22 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49383

Alan Modra amodra at gmail dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
URL||http://gcc.gnu.org/ml/gcc-p
   ||atches/2011-06/msg01735.htm
   ||l
 Resolution||FIXED

--- Comment #7 from Alan Modra amodra at gmail dot com 2011-06-23 02:22:31 
UTC ---
Patch applied


[Bug bootstrap/49383] [4.7 regression] powerpc64-linux bootstrap failure due to ice in cgraph_only_called_directly_p

2011-06-19 Thread amodra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49383

Alan Modra amodra at gmail dot com changed:

   What|Removed |Added

 CC||amodra at gmail dot com

--- Comment #4 from Alan Modra amodra at gmail dot com 2011-06-19 23:18:08 
UTC ---
Honza, the code here is called during expansion of functions.  If called at the
start of a function body, the function is attempting to answer the question:
Can this function be called from anywhere external to this object file?
If called for the expansion of a call then the question is:
Can this function call go to a function external to this object file?
Then, once those questions are answered, further code checks whether function
arguments and return value might be affected by the ABI in force.

We aren't at all interested in local functions, so I don't think c_node-local
and c_node-can_change_signature are relevant.  At least, I don't see that they
give any more information than cgraph_only_called_directly_p relevant to the
questions call_ABI_of_interest is trying to answer.


[Bug bootstrap/49383] [4.7 regression] powerpc64-linux bootstrap failure due to ice in cgraph_only_called_directly_p

2011-06-19 Thread wschmidt at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49383

--- Comment #5 from William J. Schmidt wschmidt at gcc dot gnu.org 2011-06-20 
01:02:33 UTC ---
We've verified that one-line fix allows the bootstrap to complete successfully.


[Bug bootstrap/49383] [4.7 regression] powerpc64-linux bootstrap failure due to ice in cgraph_only_called_directly_p

2011-06-18 Thread hubicka at ucw dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49383

--- Comment #3 from Jan Hubicka hubicka at ucw dot cz 2011-06-18 09:00:22 UTC 
---
Hi,
the problem is in cgraph_only_called_directl_p call within
call_abi_of_interest.
Getting the one can probably fix the problem by:
Index: rs6000.c
===
--- rs6000.c(revision 175166)
+++ rs6000.c(working copy)
@@ -7419,7 +7419,7 @@ call_ABI_of_interest (tree fndecl)

   /* Interesting functions that we are emitting in this object file.  */
   c_node = cgraph_get_node (fndecl);
-  return !cgraph_only_called_directly_p (c_node);
+  return !cgraph_only_called_directly_p (cgraph_function_or_thunk_node
(c_node, NULL));
 }
   return false;
 }

however I can't make sense of the logic here.  Doesn't it want to use 
c_node-local  c_node-can_change_signature
like other ABI change issues?  It makes it possible to use modified ABI cross
ltrans partitions.

Honza


[Bug bootstrap/49383] [4.7 regression] powerpc64-linux bootstrap failure due to ice in cgraph_only_called_directly_p

2011-06-17 Thread wschmidt at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49383

William J. Schmidt wschmidt at gcc dot gnu.org changed:

   What|Removed |Added

 CC||wschmidt at gcc dot gnu.org

--- Comment #1 from William J. Schmidt wschmidt at gcc dot gnu.org 2011-06-17 
13:37:45 UTC ---
Here's a backtrace:

#0  fancy_abort (file=0x10d1b918
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cgraph.c, line=3012,
function=0x10d1b870 cgraph_only_called_directly_p) at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/diagnostic.c:893
#1  0x103db28c in cgraph_only_called_directly_p (node=Unhandled dwarf
expression opcode 0xf3
) at /home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cgraph.c:3012
#2  0x10991bbc in call_ABI_of_interest (fndecl=Unhandled dwarf
expression opcode 0xf3
) at /home/wschmidt/gcc/gcc-mainline-pr49383/gcc/config/rs6000/rs6000.c:7422
#3  0x109a4848 in init_cumulative_args (cum=0xfffd4d0,
fntype=0xfffb6ff9108, libname=Unhandled dwarf expression opcode 0xf3
) at /home/wschmidt/gcc/gcc-mainline-pr49383/gcc/config/rs6000/rs6000.c:7485
#4  0x1039ed88 in expand_call (exp=0xfffb6f6fa00, target=0x0,
ignore=Unhandled dwarf expression opcode 0xf3
) at /home/wschmidt/gcc/gcc-mainline-pr49383/gcc/calls.c:2248
#5  0x1049c724 in expand_expr_real_1 (exp=0xfffb6f6fa00, target=value
optimized out, tmode=Unhandled dwarf expression opcode 0xf3
) at /home/wschmidt/gcc/gcc-mainline-pr49383/gcc/expr.c:9351
#6  0x103aff98 in expand_call_stmt (stmt=0xfffb7034c80) at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cfgexpand.c:1870
#7  expand_gimple_stmt_1 (stmt=0xfffb7034c80) at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cfgexpand.c:1907
#8  expand_gimple_stmt (stmt=0xfffb7034c80) at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cfgexpand.c:2054
#9  0x103b1434 in expand_gimple_basic_block (bb=0xfffb6ea96b8) at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cfgexpand.c:3637
#10 0x103b7d24 in gimple_expand_cfg () at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cfgexpand.c:4120
#11 0x10670860 in execute_one_pass (pass=0x10fd0a28) at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/passes.c:2023
#12 0x10670c50 in execute_pass_list (pass=0x10fd0a28) at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/passes.c:2078
#13 0x107b2cc0 in tree_rest_of_compilation (fndecl=0xfffb6f8c900) at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/tree-optimize.c:416
#14 0x103e1d20 in cgraph_expand_function (node=0xfffb6fc9240) at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cgraphunit.c:1768
#15 0x103e41a8 in cgraph_expand_all_functions () at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cgraphunit.c:1827
#16 cgraph_optimize () at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cgraphunit.c:2090
#17 0x103e49c8 in cgraph_finalize_compilation_unit () at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cgraphunit.c:1269
#18 0x101b5d54 in cp_write_global_declarations () at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/cp/decl2.c:4006
#19 0x1073bbf8 in compile_file () at
/home/wschmidt/gcc/gcc-mainline-pr49383/gcc/toplev.c:587
#20 do_compile () at /home/wschmidt/gcc/gcc-mainline-pr49383/gcc/toplev.c:1924
#21 toplev_main () at /home/wschmidt/gcc/gcc-mainline-pr49383/gcc/toplev.c:1996
#22 0x100b3f34 in main (argc=value optimized out, argv=value
optimized out) at /home/wschmidt/gcc/gcc-mainline-pr49383/gcc/main.c:36


[Bug bootstrap/49383] [4.7 regression] powerpc64-linux bootstrap failure due to ice in cgraph_only_called_directly_p

2011-06-17 Thread bergner at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49383

--- Comment #2 from Peter Bergner bergner at gcc dot gnu.org 2011-06-17 
15:53:39 UTC ---
We die on this assert:

  gcc_assert (cgraph_function_or_thunk_node (node, NULL) == node);

Here's a couple of dumps of the two decls if that helps.

(gdb) frame 1

(gdb) ptree node-decl
 function_decl 0xfffb6f7ca00 __comp_dtor 
type method_type 0xfffb6fe9108
type void_type 0xfffb6e40d20 void asm_written type_6 VOID
align 8 symtab 0 alias set -1 canonical type 0xfffb6e40d20
pointer_to_this pointer_type 0xfffb6e40dc8
SI
size integer_cst 0xfffb6d52420 constant 32
unit size integer_cst 0xfffb6d52440 constant 4
align 32 symtab 0 alias set -1 canonical type 0xfffb6fe9108 method
basetype record_type 0xfffb6fe8c70 __array_type_info
arg-types tree_list 0xfffb6f8b2e8 value pointer_type 0xfffb6fe8f10
chain tree_list 0xfffb6dd07f8 value void_type 0xfffb6e40d20
void
pointer_to_this pointer_type 0xfffb6fe94f8
addressable used public static decl_5 SI file
/home/bergner/gcc/gcc-mainline-20110614/libstdc++-v3/libsupc++/array_type_info.cc
line 29 col 1 align 32 context record_type 0xfffb6fe8c70 __array_type_info
initial block 0xfffb6e84150 abstract_origin function_decl 0xfffb6f7c600
__array_type_info
arguments parm_decl 0xfffb6e17d60 this
type pointer_type 0xfffb6fe8fb8 type record_type 0xfffb6fe8c70
__array_type_info
readonly unsigned SI size integer_cst 0xfffb6d52420 32 unit size
integer_cst 0xfffb6d52440 4
align 32 symtab 4095 alias set -1 canonical type 0xfffb6fe8fb8
readonly used unsigned SI file
/home/bergner/gcc/gcc-mainline-20110614/libstdc++-v3/libsupc++/array_type_info.cc
line 30 col 21 size integer_cst 0xfffb6d52420 32 unit size integer_cst
0xfffb6d52440 4
align 32 context function_decl 0xfffb6f7ca00 __comp_dtor 
abstract_origin parm_decl 0xfffb7024620 this arg-type pointer_type
0xfffb6fe8fb8
result result_decl 0xfffb6d82800 D.2747 type void_type 0xfffb6e40d20
void
ignored VOID file
/home/bergner/gcc/gcc-mainline-20110614/libstdc++-v3/libsupc++/array_type_info.cc
line 31 col 2
align 8 context function_decl 0xfffb6f7ca00 __comp_dtor 
full-name __cxxabiv1::__array_type_info::~__array_type_info()
pending-inline-info 0xfffb6d25c50
(mem:SI (symbol_ref:SI (_ZN10__cxxabiv117__array_type_infoD1Ev) [flags
0x1] function_decl 0xfffb6f7ca00 __comp_dtor ) [0 S4 A32])
struct-function 0xfffb6e08890 chain function_decl 0xfffb6f7c900
__deleting_dtor 

(gdb) p cgraph_function_or_thunk_node (node, NULL)
$9 = (struct cgraph_node *) 0xfffb6fb9000

(gdb) ptree $9-decl
 function_decl 0xfffb6f7cb00 __base_dtor 
type method_type 0xfffb6fe9108
type void_type 0xfffb6e40d20 void asm_written type_6 VOID
align 8 symtab 0 alias set -1 canonical type 0xfffb6e40d20
pointer_to_this pointer_type 0xfffb6e40dc8
SI
size integer_cst 0xfffb6d52420 constant 32
unit size integer_cst 0xfffb6d52440 constant 4
align 32 symtab 0 alias set -1 canonical type 0xfffb6fe9108 method
basetype record_type 0xfffb6fe8c70 __array_type_info
arg-types tree_list 0xfffb6f8b2e8 value pointer_type 0xfffb6fe8f10
chain tree_list 0xfffb6dd07f8 value void_type 0xfffb6e40d20
void
pointer_to_this pointer_type 0xfffb6fe94f8
asm_written public static decl_5 SI file
/home/bergner/gcc/gcc-mainline-20110614/libstdc++-v3/libsupc++/array_type_info.cc
line 29 col 1 align 32 context record_type 0xfffb6fe8c70 __array_type_info
initial error_mark 0xfffb6de1d58 abstract_origin function_decl 0xfffb6f7c600
__array_type_info
arguments parm_decl 0xfffb6e17ef8 this
type pointer_type 0xfffb6fe8fb8 type record_type 0xfffb6fe8c70
__array_type_info
readonly unsigned SI size integer_cst 0xfffb6d52420 32 unit size
integer_cst 0xfffb6d52440 4
align 32 symtab 4095 alias set -1 canonical type 0xfffb6fe8fb8
readonly used unsigned SI file
/home/bergner/gcc/gcc-mainline-20110614/libstdc++-v3/libsupc++/array_type_info.cc
line 30 col 21 size integer_cst 0xfffb6d52420 32 unit size integer_cst
0xfffb6d52440 4
align 32 context function_decl 0xfffb6f7cb00 __base_dtor 
abstract_origin parm_decl 0xfffb7024620 this
(mem/f/c/i:SI (plus:SI (reg/f:SI 113 sfp)
(const_int 8 [0x8])) [0 this+0 S4 A32]) arg-type pointer_type
0xfffb6fe8fb8
incoming-rtl (reg:SI 3 3 [ this ])
result result_decl 0xfffb6d82680 D.2744 type void_type 0xfffb6e40d20
void
ignored VOID file
/home/bergner/gcc/gcc-mainline-20110614/libstdc++-v3/libsupc++/array_type_info.cc
line 31 col 2
align 8 context function_decl 0xfffb6f7cb00 __base_dtor 
full-name __cxxabiv1::__array_type_info::~__array_type_info()
pending-inline-info 0xfffb6d25b70
(mem:SI (symbol_ref:SI (_ZN10__cxxabiv117__array_type_infoD2Ev) [flags
0x1] function_decl 

[Bug bootstrap/49383] [4.7 regression] powerpc64-linux bootstrap failure due to ice in cgraph_only_called_directly_p

2011-06-13 Thread meissner at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49383

Michael Meissner meissner at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011.06.13 18:36:20
 CC||meissner at gcc dot gnu.org
 Ever Confirmed|0   |1
   Severity|normal  |blocker


[Bug bootstrap/49383] [4.7 regression] powerpc64-linux bootstrap failure due to ice in cgraph_only_called_directly_p

2011-06-12 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49383

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org
   Target Milestone|--- |4.7.0