public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/46583] New: [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone
@ 2010-11-20 23:01 zsojka at seznam dot cz
  2010-11-21  0:30 ` [Bug debug/46583] " hjl.tools at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: zsojka at seznam dot cz @ 2010-11-20 23:01 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.6 Regression] -fcompare-debug failure with -O
                    -fno-inline -fipa-cp -fipa-cp-clone
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz


Created attachment 22472
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22472
reduced testcase

Compiler output:
$ gcc -O -fno-inline -fipa-cp -fipa-cp-clone -fcompare-debug testcase.C
gcc: error: testcase.C: -fcompare-debug failure
$ diff testcase.*gkd
46d45
< 0:   const unsigned int D.xxxx;
47a47
> 0:   const unsigned int D.xxxx;

Tested revisions:
r166976 - fail
r165699 - fail
r163636 - fail
r161659 - OK
4.5 r166509 - OK


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

* [Bug debug/46583] [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone
  2010-11-20 23:01 [Bug debug/46583] New: [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone zsojka at seznam dot cz
@ 2010-11-21  0:30 ` hjl.tools at gmail dot com
  2010-11-21  2:55 ` amylaar at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2010-11-21  0:30 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.11.21 00:22:11
                 CC|                            |amylaar at spamcop dot net
   Target Milestone|---                         |4.6.0
     Ever Confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2010-11-21 00:22:11 UTC ---
It is caused by revision 162156:

http://gcc.gnu.org/ml/gcc-cvs/2010-07/msg00510.html


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

* [Bug debug/46583] [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone
  2010-11-20 23:01 [Bug debug/46583] New: [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone zsojka at seznam dot cz
  2010-11-21  0:30 ` [Bug debug/46583] " hjl.tools at gmail dot com
@ 2010-11-21  2:55 ` amylaar at gcc dot gnu.org
  2010-11-21  7:54 ` aoliva at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: amylaar at gcc dot gnu.org @ 2010-11-21  2:55 UTC (permalink / raw)
  To: gcc-bugs

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

Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amylaar at gcc dot gnu.org

--- Comment #2 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2010-11-21 01:35:49 UTC ---
(In reply to comment #1)
> It is caused by revision 162156:
> 
> http://gcc.gnu.org/ml/gcc-cvs/2010-07/msg00510.html

This patch gives a diagnosis for an internal compiler inconsistency.
Having different orders of identifiers can lead to different compilation
output, although if it actually does is down to a complex interaction of
compiler internals that to all effects and purposes can be considered
to be pseudo-random.
See PR44832 for an example.

The real question to be asked here is why the identifier order has changed.


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

* [Bug debug/46583] [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone
  2010-11-20 23:01 [Bug debug/46583] New: [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone zsojka at seznam dot cz
  2010-11-21  0:30 ` [Bug debug/46583] " hjl.tools at gmail dot com
  2010-11-21  2:55 ` amylaar at gcc dot gnu.org
@ 2010-11-21  7:54 ` aoliva at gcc dot gnu.org
  2010-11-21  8:18 ` aoliva at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: aoliva at gcc dot gnu.org @ 2010-11-21  7:54 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |aoliva at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #3 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2010-11-21 07:51:45 UTC ---
Mine.  The order changed because we discarded the typedef decl from the block
scope in the original function.  When the time came to clone it, we'd remap the
typedef type after variable a3 of that type, and a3 would not be nonlocalized,
whereas with debug info we retained the typedef, cloned the type first, and a3
would be nonlocalized.  The patch I'm going to attach momentarily fixes this by
keeping the typedef around.


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

* [Bug debug/46583] [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone
  2010-11-20 23:01 [Bug debug/46583] New: [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2010-11-21  7:54 ` aoliva at gcc dot gnu.org
@ 2010-11-21  8:18 ` aoliva at gcc dot gnu.org
  2010-11-21 21:07 ` [Bug tree-optimization/46583] " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: aoliva at gcc dot gnu.org @ 2010-11-21  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2010-11-21 08:06:28 UTC ---
Created attachment 22474
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22474
Patch that fixes the problem

This is the patch I'm testing.


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

* [Bug tree-optimization/46583] [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone
  2010-11-20 23:01 [Bug debug/46583] New: [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2010-11-21  8:18 ` aoliva at gcc dot gnu.org
@ 2010-11-21 21:07 ` rguenth at gcc dot gnu.org
  2010-11-22 15:24 ` aoliva at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-21 21:07 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|debug                       |tree-optimization

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-21 20:46:37 UTC ---
Looks like a sledgehammer.  Why does nonlocalize state depends on debug info?


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

* [Bug tree-optimization/46583] [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone
  2010-11-20 23:01 [Bug debug/46583] New: [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2010-11-21 21:07 ` [Bug tree-optimization/46583] " rguenth at gcc dot gnu.org
@ 2010-11-22 15:24 ` aoliva at gcc dot gnu.org
  2010-11-22 16:03 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: aoliva at gcc dot gnu.org @ 2010-11-22 15:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2010-11-22 15:05:33 UTC ---
It checks whether the var type was already remapped.

tree-inline.c:
can_be_nonlocal(...):
  /* We must use global type.  We call remapped_type instead of
     remap_type since we don't want to remap this type here if it
     hasn't been remapped before.  */
  if (TREE_TYPE (decl) != remapped_type (TREE_TYPE (decl), id))
    return false;


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

* [Bug tree-optimization/46583] [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone
  2010-11-20 23:01 [Bug debug/46583] New: [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2010-11-22 15:24 ` aoliva at gcc dot gnu.org
@ 2010-11-22 16:03 ` jakub at gcc dot gnu.org
  2011-01-20 17:39 ` aoliva at gcc dot gnu.org
  2011-01-20 17:42 ` aoliva at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-22 16:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-22 15:24:04 UTC ---
Yeah.  FYI, I've tried to limit this to VLAs only in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43942#c14
unfortunately it degraded debug info quality, so for now we really need all
types.


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

* [Bug tree-optimization/46583] [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone
  2010-11-20 23:01 [Bug debug/46583] New: [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2010-11-22 16:03 ` jakub at gcc dot gnu.org
@ 2011-01-20 17:39 ` aoliva at gcc dot gnu.org
  2011-01-20 17:42 ` aoliva at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: aoliva at gcc dot gnu.org @ 2011-01-20 17:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2011-01-20 16:56:30 UTC ---
Author: aoliva
Date: Thu Jan 20 16:56:25 2011
New Revision: 169058

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169058
Log:
gcc/ChangeLog:
PR debug/46583
* tree-ssa-live.c (remove_unused_scope_block_p): Keep type decls.
gcc/testsuite/ChangeLog:
PR debug/46583
* g++.dg/debug/pr46583.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/debug/pr46583.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-live.c


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

* [Bug tree-optimization/46583] [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone
  2010-11-20 23:01 [Bug debug/46583] New: [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2011-01-20 17:39 ` aoliva at gcc dot gnu.org
@ 2011-01-20 17:42 ` aoliva at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: aoliva at gcc dot gnu.org @ 2011-01-20 17:42 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

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

--- Comment #9 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2011-01-20 17:09:11 UTC ---
Fixed


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

end of thread, other threads:[~2011-01-20 17:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-20 23:01 [Bug debug/46583] New: [4.6 Regression] -fcompare-debug failure with -O -fno-inline -fipa-cp -fipa-cp-clone zsojka at seznam dot cz
2010-11-21  0:30 ` [Bug debug/46583] " hjl.tools at gmail dot com
2010-11-21  2:55 ` amylaar at gcc dot gnu.org
2010-11-21  7:54 ` aoliva at gcc dot gnu.org
2010-11-21  8:18 ` aoliva at gcc dot gnu.org
2010-11-21 21:07 ` [Bug tree-optimization/46583] " rguenth at gcc dot gnu.org
2010-11-22 15:24 ` aoliva at gcc dot gnu.org
2010-11-22 16:03 ` jakub at gcc dot gnu.org
2011-01-20 17:39 ` aoliva at gcc dot gnu.org
2011-01-20 17:42 ` aoliva at gcc dot gnu.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).