* [Bug rtl-optimization/56605] Redundant branch introduced during loop2 phases
2013-03-12 18:57 [Bug rtl-optimization/56605] New: Redundant branch introduced during loop2 phases wschmidt at gcc dot gnu.org
@ 2013-03-12 19:20 ` steven at gcc dot gnu.org
2013-03-12 19:54 ` steven at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: steven at gcc dot gnu.org @ 2013-03-12 19:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56605
Steven Bosscher <steven at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-03-12
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/56605] Redundant branch introduced during loop2 phases
2013-03-12 18:57 [Bug rtl-optimization/56605] New: Redundant branch introduced during loop2 phases wschmidt at gcc dot gnu.org
2013-03-12 19:20 ` [Bug rtl-optimization/56605] " steven at gcc dot gnu.org
@ 2013-03-12 19:54 ` steven at gcc dot gnu.org
2013-03-12 23:00 ` steven at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: steven at gcc dot gnu.org @ 2013-03-12 19:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56605
--- Comment #1 from Steven Bosscher <steven at gcc dot gnu.org> 2013-03-12 19:54:05 UTC ---
Confirmed, compiling with -mcpu=power7 -msvx -O3 -fno-unroll-loops
Comes from here:
Breakpoint 8, doloop_modify (loop=0x3fffb5dc0ee0, desc=0x111d6d00,
doloop_seq=0x3fffb5f35780, condition=0x3fffb5fd1680, count=0x3fffb5fd16e0)
at ../../trunk/gcc/loop-doloop.c:505
505 for (; ass; ass = XEXP (ass, 1))
(gdb) p debug_rtx(ass)
(expr_list:REG_DEP_TRUE (eq:SI (subreg:SI (reg:DI 153) 4)
(const_int 0 [0]))
(expr_list:REG_DEP_TRUE (eq:SI (subreg:SI (reg:DI 153) 4)
(const_int 0 [0]))
(nil)))
$51 = void
(gdb)
These are the noloop_assumptions, and the same assertion appears twice.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/56605] Redundant branch introduced during loop2 phases
2013-03-12 18:57 [Bug rtl-optimization/56605] New: Redundant branch introduced during loop2 phases wschmidt at gcc dot gnu.org
2013-03-12 19:20 ` [Bug rtl-optimization/56605] " steven at gcc dot gnu.org
2013-03-12 19:54 ` steven at gcc dot gnu.org
@ 2013-03-12 23:00 ` steven at gcc dot gnu.org
2013-03-12 23:15 ` steven at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: steven at gcc dot gnu.org @ 2013-03-12 23:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56605
Steven Bosscher <steven at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |steven at gcc dot gnu.org
--- Comment #2 from Steven Bosscher <steven at gcc dot gnu.org> 2013-03-12 23:00:07 UTC ---
The first assumption is recorded at loop-iv.c:2472:
Breakpoint 7, iv_number_of_iterations (loop=0x3fffb5dc0ee0,
insn=0x3fffb5db6fa8, condition=0x3fffb5fd13c8, desc=0x3fffffffdf98)
at ../../trunk/gcc/loop-iv.c:2472
2472 alloc_EXPR_LIST (0, assumption,
desc->noloop_assumptions);
(gdb) p assumption
$1 = (rtx) 0x3fffb5fd1410
(gdb) p debug_rtx(assumption)
(eq:SI (subreg:SI (reg:DI 153 [ bnd.10D.2035+-4 ]) 4)
(const_int 0 [0]))
$2 = void
(gdb) cont
Continuing.
The second comes from loop-iv.c:2623:
Breakpoint 8, iv_number_of_iterations (loop=0x3fffb5dc0ee0,
insn=0x3fffb5db6fa8, condition=0x3fffb5fd13c8, desc=0x3fffffffdf98)
at ../../trunk/gcc/loop-iv.c:2623
2623 alloc_EXPR_LIST (0, assumption,
desc->noloop_assumptions);
(gdb) p debug_rtx(assumption)
(gtu:SI (plus:SI (subreg:SI (reg:DI 163 [ ivtmp.33D.2058+-4 ]) 4)
(const_int 1 [0x1]))
(subreg:SI (reg:DI 153 [ bnd.10D.2035+-4 ]) 4))
The second one is simplified using initial values at loop-iv.c:2777:
2777 simplify_using_initial_values (loop, IOR, &desc->noloop_assumptions);
(gdb) p debug_rtx(desc->noloop_assumptions)
(expr_list:REG_DEP_TRUE (gtu:SI (plus:SI (subreg:SI (reg:DI 163 [
ivtmp.33D.2058+-4 ]) 4)
(const_int 1 [0x1]))
(subreg:SI (reg:DI 153 [ bnd.10D.2035+-4 ]) 4))
(expr_list:REG_DEP_TRUE (eq:SI (subreg:SI (reg:DI 153 [ bnd.10D.2035+-4 ])
4)
(const_int 0 [0]))
(nil)))
$15 = void
(gdb) next
2778 simplify_using_initial_values (loop, IOR, &desc->infinite);
(gdb) p debug_rtx(desc->noloop_assumptions)
(expr_list:REG_DEP_TRUE (eq:SI (subreg:SI (reg:DI 153 [ bnd.10D.2035+-4 ]) 4)
(const_int 0 [0]))
(expr_list:REG_DEP_TRUE (eq:SI (subreg:SI (reg:DI 153 [ bnd.10D.2035+-4 ])
4)
(const_int 0 [0]))
(nil)))
$16 = void
(gdb)
Insofar I can claim to understand loop-iv.c, this is supposed to be
cleaned up by eliminate_implied_conditions.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/56605] Redundant branch introduced during loop2 phases
2013-03-12 18:57 [Bug rtl-optimization/56605] New: Redundant branch introduced during loop2 phases wschmidt at gcc dot gnu.org
` (2 preceding siblings ...)
2013-03-12 23:00 ` steven at gcc dot gnu.org
@ 2013-03-12 23:15 ` steven at gcc dot gnu.org
2013-04-15 18:32 ` wschmidt at gcc dot gnu.org
2013-04-23 19:49 ` wschmidt at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: steven at gcc dot gnu.org @ 2013-03-12 23:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56605
Steven Bosscher <steven at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|steven at gcc dot gnu.org |
--- Comment #3 from Steven Bosscher <steven at gcc dot gnu.org> 2013-03-12 23:14:39 UTC ---
GCC gets to implies_p with:
Breakpoint 11, implies_p (a=0x3fffb5fd1410, b=0x3fffb5fd15c0) at
../../trunk/gcc/loop-iv.c:1499
1499 if (GET_CODE (a) == EQ)
(gdb) p debug_rtx(a)
(eq:SI (subreg:SI (reg:DI 153 [ bnd.10D.2035+-4 ]) 4)
(const_int 0 [0]))
$26 = void
(gdb) p debug_rtx(b)
(eq:SI (subreg:SI (reg:DI 153 [ bnd.10D.2035+-4 ]) 4)
(const_int 0 [0]))
$27 = void
(gdb)
But implies_p doesn't handle SUBREGs. If it would allow REGs and SUBREGs
of REGs, it would fold the assumption away:
1504 if (REG_P (op0))
(gdb) p op0
$29 = (rtx) 0x3fffb5fd13e0
(gdb) p debug_rtx(op0)
(subreg:SI (reg:DI 153 [ bnd.10D.2035+-4 ]) 4)
$30 = void
(gdb) p debug_rtx(op1)
(const_int 0 [0])
$31 = void
(gdb) p debug_rtx(simplify_replace_rtx (b, op0, op1))
(const_int 1 [0x1])
$32 = void
Something like the following, perhaps?
Index: loop-iv.c
===================================================================
--- loop-iv.c (revision 196575)
+++ loop-iv.c (working copy)
@@ -1496,19 +1496,26 @@ implies_p (rtx a, rtx b)
rtx op0, op1, opb0, opb1, r;
enum machine_mode mode;
+ if (rtx_equal_p (a, b))
+ return true;
+
if (GET_CODE (a) == EQ)
{
op0 = XEXP (a, 0);
op1 = XEXP (a, 1);
- if (REG_P (op0))
+ if (REG_P (op0)
+ || (GET_CODE (op0) == SUBREG
+ && REG_P (SUBREG_REG (op0))))
{
r = simplify_replace_rtx (b, op0, op1);
if (r == const_true_rtx)
return true;
}
- if (REG_P (op1))
+ if (REG_P (op1)
+ || (GET_CODE (op1) == SUBREG
+ && REG_P (SUBREG_REG (op1))))
{
r = simplify_replace_rtx (b, op1, op0);
if (r == const_true_rtx)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/56605] Redundant branch introduced during loop2 phases
2013-03-12 18:57 [Bug rtl-optimization/56605] New: Redundant branch introduced during loop2 phases wschmidt at gcc dot gnu.org
` (3 preceding siblings ...)
2013-03-12 23:15 ` steven at gcc dot gnu.org
@ 2013-04-15 18:32 ` wschmidt at gcc dot gnu.org
2013-04-23 19:49 ` wschmidt at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2013-04-15 18:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56605
Bill Schmidt <wschmidt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot |wschmidt at gcc dot gnu.org
|gnu.org |
Target Milestone|--- |4.8.1
--- Comment #4 from Bill Schmidt <wschmidt at gcc dot gnu.org> 2013-04-15 18:32:53 UTC ---
This was fixed in trunk on 2013-03-20. Now that it's burned in for a few
weeks, I'll plan to fix it in 4.8.1 shortly, provided there are no objections.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug rtl-optimization/56605] Redundant branch introduced during loop2 phases
2013-03-12 18:57 [Bug rtl-optimization/56605] New: Redundant branch introduced during loop2 phases wschmidt at gcc dot gnu.org
` (4 preceding siblings ...)
2013-04-15 18:32 ` wschmidt at gcc dot gnu.org
@ 2013-04-23 19:49 ` wschmidt at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2013-04-23 19:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56605
Bill Schmidt <wschmidt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #5 from Bill Schmidt <wschmidt at gcc dot gnu.org> 2013-04-23 19:49:08 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 7+ messages in thread