public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/42719]  New: "-fcompare-debug failure" with "-O2 -ftracer"
@ 2010-01-12 22:22 zsojka at seznam dot cz
  2010-01-12 22:24 ` [Bug tree-optimization/42719] " zsojka at seznam dot cz
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: zsojka at seznam dot cz @ 2010-01-12 22:22 UTC (permalink / raw)
  To: gcc-bugs

Command line:
gcc -O2 -ftracer -fcompare-debug -c testcase.c
or
gcc -O1 -ftree-pre -freorder-blocks -ftracer -fcompare-debug -c testcase.c

Tested revisions:
r155833 - crash
r155777 - crash
r154830 - crash
r153685 - crash

Output:
$ /mnt/svn/gcc-trunk/binary-155777-lto/bin/gcc -O2 -ftracer -fcompare-debug -c
testcase.c
gcc: testcase.c: -fcompare-debug failure


-- 
           Summary: "-fcompare-debug failure" with "-O2 -ftracer"
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zsojka at seznam dot cz
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42719


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tree-optimization/42719] "-fcompare-debug failure" with "-O2 -ftracer"
  2010-01-12 22:22 [Bug tree-optimization/42719] New: "-fcompare-debug failure" with "-O2 -ftracer" zsojka at seznam dot cz
@ 2010-01-12 22:24 ` zsojka at seznam dot cz
  2010-01-14 15:36 ` jakub at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: zsojka at seznam dot cz @ 2010-01-12 22:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from zsojka at seznam dot cz  2010-01-12 22:24 -------
Created an attachment (id=19567)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19567&action=view)
reduced testcase

reduced from gcc/cfgexpand.c

Command line:
gcc -O2 -ftracer -fcompare-debug -c pr42719.c
or
gcc -O1 -ftree-pre -freorder-blocks -ftracer -fcompare-debug -c pr42719.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42719


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tree-optimization/42719] "-fcompare-debug failure" with "-O2 -ftracer"
  2010-01-12 22:22 [Bug tree-optimization/42719] New: "-fcompare-debug failure" with "-O2 -ftracer" zsojka at seznam dot cz
  2010-01-12 22:24 ` [Bug tree-optimization/42719] " zsojka at seznam dot cz
@ 2010-01-14 15:36 ` jakub at gcc dot gnu dot org
  2010-01-14 15:56 ` matz at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-14 15:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2010-01-14 15:36 -------
The problem here seems to be that trivially_conflicts_p called
insert_backedge_copies returns 0 for -g0 and 1 for -g in:
<bb 5>:
# i_25 = PHI <i_11(5), a_3(D)(4)>
# DEBUG last => i_25
D.2725_8 = (long unsigned int) i_25;
D.2726_9 = D.2725_8 * 4;
prephitmp.9_10 = pretmp.12_39 + D.2726_9;
i_11 = *prephitmp.9_10;
# DEBUG i => i_11
# DEBUG last => i_25
# DEBUG i => i_11
if (i_11 != -1)
  goto <bb 5>;
else
  goto <bb 6>;
(for -g0 of course without the # DEBUG lines).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42719


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tree-optimization/42719] "-fcompare-debug failure" with "-O2 -ftracer"
  2010-01-12 22:22 [Bug tree-optimization/42719] New: "-fcompare-debug failure" with "-O2 -ftracer" zsojka at seznam dot cz
  2010-01-12 22:24 ` [Bug tree-optimization/42719] " zsojka at seznam dot cz
  2010-01-14 15:36 ` jakub at gcc dot gnu dot org
@ 2010-01-14 15:56 ` matz at gcc dot gnu dot org
  2010-01-14 16:11 ` jakub at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: matz at gcc dot gnu dot org @ 2010-01-14 15:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from matz at gcc dot gnu dot org  2010-01-14 15:56 -------
This code and var-tracking was developed in parallel, that's why debug insns
are sometimes not handled correctly in the new out-of-ssa stuff.  In this
case debug insns should probably be ignored, and not lead to claiming a
trivial conflict.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42719


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tree-optimization/42719] "-fcompare-debug failure" with "-O2 -ftracer"
  2010-01-12 22:22 [Bug tree-optimization/42719] New: "-fcompare-debug failure" with "-O2 -ftracer" zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2010-01-14 15:56 ` matz at gcc dot gnu dot org
@ 2010-01-14 16:11 ` jakub at gcc dot gnu dot org
  2010-01-14 16:18 ` matz at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-14 16:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2010-01-14 16:10 -------
Created an attachment (id=19598)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19598&action=view)
gcc45-pr42719.patch

Big hammer patch to reset the debug stmts because of which we'd return true
from trivially_conflicts_p when we'd otherwise return false.
Wonder if we don't have other options though (ignore the debug stmts, then do
something about them) and how much it will affect real-world code.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42719


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tree-optimization/42719] "-fcompare-debug failure" with "-O2 -ftracer"
  2010-01-12 22:22 [Bug tree-optimization/42719] New: "-fcompare-debug failure" with "-O2 -ftracer" zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2010-01-14 16:11 ` jakub at gcc dot gnu dot org
@ 2010-01-14 16:18 ` matz at gcc dot gnu dot org
  2010-01-14 16:21 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: matz at gcc dot gnu dot org @ 2010-01-14 16:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from matz at gcc dot gnu dot org  2010-01-14 16:17 -------
I don't think the big hammer is necessary.  trivially_conflicts_p only is a
heuristic predicate influencing how other code is emitted.  That other code
needs to handle them already, otherwise more transformations would be broken.
The worst that can happen by ignoring debug stmts in the predicate is that
the transformation done later leads to changes or invalidation of those debug
statements.  I think that's exactly what we want.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42719


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tree-optimization/42719] "-fcompare-debug failure" with "-O2 -ftracer"
  2010-01-12 22:22 [Bug tree-optimization/42719] New: "-fcompare-debug failure" with "-O2 -ftracer" zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2010-01-14 16:18 ` matz at gcc dot gnu dot org
@ 2010-01-14 16:21 ` rguenth at gcc dot gnu dot org
  2010-01-18 14:53 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-14 16:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2010-01-14 16:21 -------
Correct.  Especially resetting debug stmts inside a predicate is extra ugly ;)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42719


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tree-optimization/42719] "-fcompare-debug failure" with "-O2 -ftracer"
  2010-01-12 22:22 [Bug tree-optimization/42719] New: "-fcompare-debug failure" with "-O2 -ftracer" zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2010-01-14 16:21 ` rguenth at gcc dot gnu dot org
@ 2010-01-18 14:53 ` jakub at gcc dot gnu dot org
  2010-01-19  8:18 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-18 14:53 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-01-18 14:53:08
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42719


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tree-optimization/42719] "-fcompare-debug failure" with "-O2 -ftracer"
  2010-01-12 22:22 [Bug tree-optimization/42719] New: "-fcompare-debug failure" with "-O2 -ftracer" zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2010-01-18 14:53 ` jakub at gcc dot gnu dot org
@ 2010-01-19  8:18 ` jakub at gcc dot gnu dot org
  2010-01-19 12:40 ` jakub at gcc dot gnu dot org
  2010-01-19 12:41 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-19  8:18 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2010-
                   |                            |01/msg00999.html
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-01-18 14:53:08         |2010-01-19 08:18:17
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42719


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tree-optimization/42719] "-fcompare-debug failure" with "-O2 -ftracer"
  2010-01-12 22:22 [Bug tree-optimization/42719] New: "-fcompare-debug failure" with "-O2 -ftracer" zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2010-01-19  8:18 ` jakub at gcc dot gnu dot org
@ 2010-01-19 12:40 ` jakub at gcc dot gnu dot org
  2010-01-19 12:41 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-19 12:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2010-01-19 12:39 -------
Subject: Bug 42719

Author: jakub
Date: Tue Jan 19 12:39:42 2010
New Revision: 156038

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156038
Log:
        PR tree-optimization/42719
        * tree-outof-ssa.c (trivially_conflicts_p): Don't consider debug
        stmt uses.

        * gcc.dg/pr42719.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr42719.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-outof-ssa.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42719


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug tree-optimization/42719] "-fcompare-debug failure" with "-O2 -ftracer"
  2010-01-12 22:22 [Bug tree-optimization/42719] New: "-fcompare-debug failure" with "-O2 -ftracer" zsojka at seznam dot cz
                   ` (8 preceding siblings ...)
  2010-01-19 12:40 ` jakub at gcc dot gnu dot org
@ 2010-01-19 12:41 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-19 12:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2010-01-19 12:41 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42719


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-01-19 12:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-12 22:22 [Bug tree-optimization/42719] New: "-fcompare-debug failure" with "-O2 -ftracer" zsojka at seznam dot cz
2010-01-12 22:24 ` [Bug tree-optimization/42719] " zsojka at seznam dot cz
2010-01-14 15:36 ` jakub at gcc dot gnu dot org
2010-01-14 15:56 ` matz at gcc dot gnu dot org
2010-01-14 16:11 ` jakub at gcc dot gnu dot org
2010-01-14 16:18 ` matz at gcc dot gnu dot org
2010-01-14 16:21 ` rguenth at gcc dot gnu dot org
2010-01-18 14:53 ` jakub at gcc dot gnu dot org
2010-01-19  8:18 ` jakub at gcc dot gnu dot org
2010-01-19 12:40 ` jakub at gcc dot gnu dot org
2010-01-19 12:41 ` jakub at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).