Bug 40323 - [4.5 Regression] compiling just takes forever and doesn't really process
Summary: [4.5 Regression] compiling just takes forever and doesn't really process
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.5.0
: P1 normal
Target Milestone: 4.5.0
Assignee: Martin Jambor
URL:
Keywords: compile-time-hog
Depends on:
Blocks:
 
Reported: 2009-06-01 18:31 UTC by Albert Zeyer
Modified: 2009-06-03 15:00 UTC (History)
2 users (show)

See Also:
Host: amd64
Target: amd64
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-06-02 10:51:47


Attachments
source file after preprocessor (178.43 KB, application/octet-stream)
2009-06-01 18:36 UTC, Albert Zeyer
Details
Fix (782 bytes, patch)
2009-06-02 17:06 UTC, Martin Jambor
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Zeyer 2009-06-01 18:31:36 UTC
This is with GCC trunk, rev 148041:

I have a cpp file where g++ just takes forever with 100% CPU usage and constant (low) memory usage. I am waiting now for 20 minutes without any visible progress.

I attached with GDB to the process and this is some of the details I am seeing:

az@gcomputer:~$ gdb /opt/gcc4.4-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus 32654
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
Really redefine built-in command "frame"? (y or n) [answered Y; input not from terminal]
Really redefine built-in command "thread"? (y or n) [answered Y; input not from terminal]
Really redefine built-in command "start"? (y or n) [answered Y; input not from terminal]
Attaching to program: /opt/gcc4.4-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus, process 32654
Reading symbols from /usr/lib/libmpfr.so.1...done.
Loaded symbols for /usr/lib/libmpfr.so.1
Reading symbols from /usr/lib/libgmp.so.3...done.
Loaded symbols for /usr/lib/libgmp.so.3
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
_______________________________________________________________________________
Error while running hook_stop:
Value can't be converted to integer.
0x0000000000a6ebd4 in ipa_compute_jump_functions (cs=<value optimized out>) at ../../gcc/ipa-prop.c:437
437	  while (TREE_CODE (rhs) == SSA_NAME && !SSA_NAME_IS_DEFAULT_DEF (rhs))
gdb> bt ful
#0  0x0000000000a6ebd4 in ipa_compute_jump_functions (cs=<value optimized out>) at ../../gcc/ipa-prop.c:437
	info = <value optimized out>
	__FUNCTION__ = "ipa_compute_jump_functions"
	call = <value optimized out>
#1  0x0000000000000002 in ?? ()
No symbol table info available.
#2  0x00007f11dcc99480 in ?? ()
No symbol table info available.
#3  0x0000000002394010 in ?? ()
No symbol table info available.
#4  0x0000000000000002 in ?? ()
No symbol table info available.
#5  0x00007f11df850360 in ?? ()
No symbol table info available.
#6  0x00007f11dd0b6c80 in ?? ()
No symbol table info available.
#7  0x00007f11dd0b6d20 in ?? ()
No symbol table info available.
#8  0x0000000002394040 in ?? ()
No symbol table info available.
#9  0x00007f11dc83b160 in ?? ()
No symbol table info available.
#10 0x00007f11ddb0f400 in ?? ()
No symbol table info available.
#11 0x00007f11dc8865a0 in ?? ()
No symbol table info available.
#12 0x000000000000003b in ?? ()
No symbol table info available.
#13 0x00007f11dd0b6d20 in ?? ()
No symbol table info available.
#14 0x00007f11dd0b6c80 in ?? ()
No symbol table info available.
#15 0x0000000000a6d0d0 in ?? ()
No locals.
#16 0x00007f11dc898600 in ?? ()
No symbol table info available.
#17 0x00007f11dc833600 in ?? ()
No symbol table info available.
#18 0x0000000000000000 in ?? ()
No symbol table info available.
gdb> c


^C
Program received signal SIGINT, Interrupt.
_______________________________________________________________________________
Error while running hook_stop:
Value can't be converted to integer.
gimple_assign_single_p (gs=0x7f11dc839be0) at ../../gcc/gimple.c:1831
1831	}
gdb> bt 
#0  gimple_assign_single_p (gs=0x7f11dc839be0) at ../../gcc/gimple.c:1831
#1  0x0000000000a6ebee in ipa_compute_jump_functions (cs=<value optimized out>) at ../../gcc/ipa-prop.c:441
#2  0x0000000000000002 in ?? ()
#3  0x00007f11dcc99480 in ?? ()
#4  0x0000000002394010 in ?? ()
#5  0x0000000000000002 in ?? ()
#6  0x00007f11df850360 in ?? ()
#7  0x00007f11dd0b6c80 in ?? ()
#8  0x00007f11dd0b6d20 in ?? ()
#9  0x0000000002394040 in ?? ()
#10 0x00007f11dc83b160 in ?? ()
#11 0x00007f11ddb0f400 in ?? ()
#12 0x00007f11dc8865a0 in ?? ()
#13 0x000000000000003b in ?? ()
#14 0x00007f11dd0b6d20 in ?? ()
#15 0x00007f11dd0b6c80 in ?? ()
#16 0x0000000000a6d0d0 in ?? ()
#17 0x00007f11dc898600 in ?? ()
#18 0x00007f11dc833600 in ?? ()
#19 0x0000000000000000 in ?? ()
gdb> c
^C
Program received signal SIGINT, Interrupt.
_______________________________________________________________________________
Error while running hook_stop:
Value can't be converted to integer.
0x0000000000a6ebdf in ipa_compute_jump_functions (cs=<value optimized out>) at ../../gcc/ipa-prop.c:437
437	  while (TREE_CODE (rhs) == SSA_NAME && !SSA_NAME_IS_DEFAULT_DEF (rhs))
gdb> list
432	   return the rhs of its defining statement.  */
433	
434	static inline tree
435	get_ssa_def_if_simple_copy (tree rhs)
436	{
437	  while (TREE_CODE (rhs) == SSA_NAME && !SSA_NAME_IS_DEFAULT_DEF (rhs))
438	    {
439	      gimple def_stmt = SSA_NAME_DEF_STMT (rhs);
440	
441	      if (gimple_assign_single_p (def_stmt))
gdb> bt
#0  0x0000000000a6ebdf in ipa_compute_jump_functions (cs=<value optimized out>) at ../../gcc/ipa-prop.c:437
#1  0x0000000000000002 in ?? ()
#2  0x00007f11dcc99480 in ?? ()
#3  0x0000000002394010 in ?? ()
#4  0x0000000000000002 in ?? ()
#5  0x00007f11df850360 in ?? ()
#6  0x00007f11dd0b6c80 in ?? ()
#7  0x00007f11dd0b6d20 in ?? ()
#8  0x0000000002394040 in ?? ()
#9  0x00007f11dc83b160 in ?? ()
#10 0x00007f11ddb0f400 in ?? ()
#11 0x00007f11dc8865a0 in ?? ()
#12 0x000000000000003b in ?? ()
#13 0x00007f11dd0b6d20 in ?? ()
#14 0x00007f11dd0b6c80 in ?? ()
#15 0x0000000000a6d0d0 in ?? ()
#16 0x00007f11dc898600 in ?? ()
#17 0x00007f11dc833600 in ?? ()
#18 0x0000000000000000 in ?? ()
gdb> c
^C
Program received signal SIGINT, Interrupt.
_______________________________________________________________________________
Error while running hook_stop:
Value can't be converted to integer.
gimple_assign_single_p (gs=0x7f11dc839be0) at ../../gcc/gimple.c:1827
1827	{
gdb> list
1822	   any RHS operand, including those that perform an operation
1823	   and do not have the semantics of a copy, such as COND_EXPR.  */
1824	
1825	bool
1826	gimple_assign_single_p (gimple gs)
1827	{
1828	  return (gimple_code (gs) == GIMPLE_ASSIGN
1829	          && get_gimple_rhs_class (gimple_assign_rhs_code (gs))
1830		     == GIMPLE_SINGLE_RHS);
1831	}
gdb> print gs
$1 = (gimple) 0x7f11dc839be0
gdb> print *gs
$2 = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, gsops = {opbase = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, def_ops = 0x7f11db7df1d0, use_ops = 0x0}, op = {0x0}}, gsmem = {membase = {opbase = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, def_ops = 0x7f11db7df1d0, use_ops = 0x0}, vdef = 0x0, vuse = 0x0}, op = {0x7f11db7dccc0}}, omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, gimple_bind = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, vars = 0x7f11db7df1d0, block = 0x0, body = 0x0}, gimple_catch = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, types = 0x7f11db7df1d0, handler = 0x0}, gimple_eh_filter = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, types = 0x7f11db7df1d0, failure = 0x0}, gimple_phi = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, capacity = 0xdb7df1d0, nargs = 0x7f11, result = 0x0, args = {{imm_use = {prev = 0x0, next = 0x0, loc = {stmt = 0x7f11db7dccc0, ssa_name = 0x7f11db7dccc0}, use = 0x7f11dcb59a80}, def = 0x202205}}}, gimple_resx = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, region = 0xdb7df1d0}, gimple_try = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, eval = 0x7f11db7df1d0, cleanup = 0x0}, gimple_wce = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, cleanup = 0x7f11db7df1d0}, gimple_asm = {membase = {opbase = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, def_ops = 0x7f11db7df1d0, use_ops = 0x0}, vdef = 0x0, vuse = 0x0}, string = 0x7f11db7dccc0 "\216", ni = 0x80, no = 0x9a, nc = 0xdcb5, op = {0x202205}}, gimple_omp_critical = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, name = 0x0}, gimple_omp_for = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, clauses = 0x0, collapse = 0x0, iter = 0x0, pre_body = 0x7f11db7dccc0}, gimple_omp_parallel = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, clauses = 0x0, child_fn = 0x0, data_arg = 0x0}, gimple_omp_task = {par = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, clauses = 0x0, child_fn = 0x0, data_arg = 0x0}, copy_fn = 0x7f11db7dccc0, arg_size = 0x7f11dcb59a80, arg_align = 0x202205}, gimple_omp_sections = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, clauses = 0x0, control = 0x0}, gimple_omp_single = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, clauses = 0x0}, gimple_omp_continue = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, control_def = 0x7f11db7df1d0, control_use = 0x0}, gimple_omp_atomic_load = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, rhs = 0x7f11db7df1d0, lhs = 0x0}, gimple_omp_atomic_store = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, val = 0x7f11db7df1d0}}
gdb>
Comment 1 Albert Zeyer 2009-06-01 18:32:44 UTC
gdb> c
q
^C
Program received signal SIGINT, Interrupt.
_______________________________________________________________________________
Error while running hook_stop:
Value can't be converted to integer.
0x0000000000780a0f in gimple_assign_single_p (gs=0x7f11dc839be0) at ../../gcc/gimple.c:1831
1831	}
gdb> list
1826	gimple_assign_single_p (gimple gs)
1827	{
1828	  return (gimple_code (gs) == GIMPLE_ASSIGN
1829	          && get_gimple_rhs_class (gimple_assign_rhs_code (gs))
1830		     == GIMPLE_SINGLE_RHS);
1831	}
1832	
1833	/* Return true if GS is an assignment with a unary RHS, but the
1834	   operator has no effect on the assigned value.  The logic is adapted
1835	   from STRIP_NOPS.  This predicate is intended to be used in tuplifying
gdb> print gs
$4 = (gimple) 0x7f11dc839be0
gdb> print *gs
$5 = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, gsops = {opbase = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, def_ops = 0x7f11db7df1d0, use_ops = 0x0}, op = {0x0}}, gsmem = {membase = {opbase = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, def_ops = 0x7f11db7df1d0, use_ops = 0x0}, vdef = 0x0, vuse = 0x0}, op = {0x7f11db7dccc0}}, omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, gimple_bind = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, vars = 0x7f11db7df1d0, block = 0x0, body = 0x0}, gimple_catch = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, types = 0x7f11db7df1d0, handler = 0x0}, gimple_eh_filter = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, types = 0x7f11db7df1d0, failure = 0x0}, gimple_phi = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, capacity = 0xdb7df1d0, nargs = 0x7f11, result = 0x0, args = {{imm_use = {prev = 0x0, next = 0x0, loc = {stmt = 0x7f11db7dccc0, ssa_name = 0x7f11db7dccc0}, use = 0x7f11dcb59a80}, def = 0x202205}}}, gimple_resx = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, region = 0xdb7df1d0}, gimple_try = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, eval = 0x7f11db7df1d0, cleanup = 0x0}, gimple_wce = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, cleanup = 0x7f11db7df1d0}, gimple_asm = {membase = {opbase = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, def_ops = 0x7f11db7df1d0, use_ops = 0x0}, vdef = 0x0, vuse = 0x0}, string = 0x7f11db7dccc0 "\216", ni = 0x80, no = 0x9a, nc = 0xdcb5, op = {0x202205}}, gimple_omp_critical = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, name = 0x0}, gimple_omp_for = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, clauses = 0x0, collapse = 0x0, iter = 0x0, pre_body = 0x7f11db7dccc0}, gimple_omp_parallel = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, clauses = 0x0, child_fn = 0x0, data_arg = 0x0}, gimple_omp_task = {par = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, clauses = 0x0, child_fn = 0x0, data_arg = 0x0}, copy_fn = 0x7f11db7dccc0, arg_size = 0x7f11dcb59a80, arg_align = 0x202205}, gimple_omp_sections = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, clauses = 0x0, control = 0x0}, gimple_omp_single = {omp = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, body = 0x7f11db7df1d0}, clauses = 0x0}, gimple_omp_continue = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, control_def = 0x7f11db7df1d0, control_use = 0x0}, gimple_omp_atomic_load = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, rhs = 0x7f11db7df1d0, lhs = 0x0}, gimple_omp_atomic_store = {gsbase = {code = GIMPLE_ASSIGN, no_warning = 0x0, visited = 0x0, nontemporal_move = 0x0, plf = 0x0, modified = 0x0, has_volatile_ops = 0x0, pad = 0x0, subcode = 0x74, uid = 0x0, location = 0x6480dd, num_ops = 0x2, bb = 0x7f11dc8865a0, block = 0x7f11dc83a120}, val = 0x7f11db7df1d0}}
gdb> q
az@gcomputer:~$ 
Comment 2 Albert Zeyer 2009-06-01 18:35:43 UTC
This only happens with -O3. Without specific optimisation, it compiles just fine. With all other GCC versions I have tried so far (GCC 4.4, GCC 4.3, GCC 4.0 and a lot others) it works fine (with any possible optimisation).
Comment 3 Albert Zeyer 2009-06-01 18:36:36 UTC
Created attachment 17943 [details]
source file after preprocessor

This is the specific source after the preprocessor.
Comment 4 Albert Zeyer 2009-06-01 21:36:29 UTC
It runs now for >200 minutes, so I really think this is not normal.
Comment 5 Richard Biener 2009-06-02 10:45:23 UTC
Works fine with rev. 147285, fails with rev. 147953.

Martin - obviously

static inline tree
get_ssa_def_if_simple_copy (tree rhs)
{
  while (TREE_CODE (rhs) == SSA_NAME && !SSA_NAME_IS_DEFAULT_DEF (rhs))
    {
      gimple def_stmt = SSA_NAME_DEF_STMT (rhs);

      if (gimple_assign_single_p (def_stmt))
        rhs = gimple_assign_rhs1 (def_stmt);
    }
  return rhs;
}

doesn't terminate if the condition inside the loop is false.
Comment 6 Martin Jambor 2009-06-02 10:51:47 UTC
Apparently I was not careful enough when turning an if branch to a while loop.  I'll prepare and test a patch straight away.
Comment 7 Martin Jambor 2009-06-02 17:06:37 UTC
Created attachment 17946 [details]
Fix

Ok, creating a simple testcase was not easy for me but here is a patch
that includes one (and fixes the original issue too).  It still needs
testing but I am quite confident it will pass.
Comment 8 Martin Jambor 2009-06-03 11:56:19 UTC
Subject: Bug 40323

Author: jamborm
Date: Wed Jun  3 11:56:05 2009
New Revision: 148126

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148126
Log:
2009-06-03  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/40323
	* ipa-prop.c (get_ssa_def_if_simple_copy): Break if not single
	assignment.

	* testsuite/g++.dg/torture/pr40323.C: New file.


Added:
    trunk/gcc/testsuite/g++.dg/torture/pr40323.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-prop.c
    trunk/gcc/testsuite/ChangeLog

Comment 9 Martin Jambor 2009-06-03 12:54:09 UTC
I have just verified this is fixed on the current trunk.
Comment 10 Albert Zeyer 2009-06-03 15:00:04 UTC
Thanks a lot, works just fine. :)