public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled
@ 2012-02-27  9:33 ebotcazou at gcc dot gnu.org
  2012-02-27  9:40 ` [Bug bootstrap/52397] " rguenth at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-02-27  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52397
           Summary: [4.7 regression] comparison failure with Ada enabled
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ebotcazou@gcc.gnu.org
              Host: ia64-*-linux
            Target: ia64-*-linux
             Build: ia64-*-linux


We have a bootstrap comparison failure on IA-64 with Ada enabled:

Bootstrap comparison failure!
gcc/ada/uintp.o differs
make[2]: *** [compare] Error 1

This is a debug insn issue.  The -fdump-final-insns diff reads:

--- uintp.s.gkd.0       2012-02-25 11:33:14.050677000 -0500
+++ uintp.s.gkd.1       2012-02-25 11:33:58.240145000 -0500
@@ -3350,7 +3350,7 @@
                 (unspec_volatile:DI [
                         (const_int 0 [0])
                     ] UNSPECV_ALLOC))
-            (use (const_int 6 [0x6]))
+            (use (const_int 5 [0x5]))
             (use (const_int 8 [0x8]))
             (use (const_int 2 [0x2]))
             (use (const_int 0 [0]))

This happens because r117 (in5) is df_regs_ever_live_p by the time the prologue
is expanded with debug insns but isn't without debug insns.

It is referenced in a debug insns after fwprop1:

(debug_insn 111 109 5 2 (var_location:DI D#136 (reg:DI 117 in5 [ quotient+8 ]))
-1
     (nil))

and eliminated after dse1:

(debug_insn 111 109 5 2 (var_location:DI D#136 (clobber (const_int 0 [0]))) -1
     (nil))

The debug_insn is generated by delete_trivially_dead_insns but isn't reset in
the second phase of the same processing because the register isn't a pseudo.

Now reginfo is run between fwprop1 and dse1 so the df_hard_reg_used_p r117 is
consequently computed as being regs_ever_live by df_compute_regs_ever_live
called from reginfo_init and nothing resets this afterwards (df_analyze does
call df_compute_regs_ever_live too but with RESET to false).

Teaching df_compute_regs_ever_live to reset individual registers leads to DF
verification failures for artificial registers.


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
@ 2012-02-27  9:40 ` rguenth at gcc dot gnu.org
  2012-02-27 11:06 ` rguenth at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-27  9:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.0


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
  2012-02-27  9:40 ` [Bug bootstrap/52397] " rguenth at gcc dot gnu.org
@ 2012-02-27 11:06 ` rguenth at gcc dot gnu.org
  2012-02-27 11:55 ` ebotcazou at gcc dot gnu.org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-27 11:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-27 10:49:23 UTC ---
ia64 is no longer primary/secondary.


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
  2012-02-27  9:40 ` [Bug bootstrap/52397] " rguenth at gcc dot gnu.org
  2012-02-27 11:06 ` rguenth at gcc dot gnu.org
@ 2012-02-27 11:55 ` ebotcazou at gcc dot gnu.org
  2012-02-27 12:04 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-02-27 11:55 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

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

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-02-27 11:45:43 UTC ---
Jakub, would this impair debug info if we allowed the debug insn handling code
in delete_trivially_dead_insns to reset debug insn for dead (not used)
registers that are FUNCTION_ARG_REGNO_P?


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-02-27 11:55 ` ebotcazou at gcc dot gnu.org
@ 2012-02-27 12:04 ` jakub at gcc dot gnu.org
  2012-02-27 12:28 ` ebotcazou at gcc dot gnu.org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-27 12:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-27 11:54:24 UTC ---
What is specific about FUNCTION_ARG_REGNO_P regs?
We generally need to either reset, or adjust debug insns that refer registers
that aren't live at that point when ignoring the debug insn uses.


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-02-27 12:04 ` jakub at gcc dot gnu.org
@ 2012-02-27 12:28 ` ebotcazou at gcc dot gnu.org
  2012-02-27 13:04 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-02-27 12:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-02-27 12:04:16 UTC ---
> What is specific about FUNCTION_ARG_REGNO_P regs?

We know more or less how they behave.  They (may) hold arguments on entry and
thus have an artificial def in the entry block.  

> We generally need to either reset, or adjust debug insns that refer registers
> that aren't live at that point when ignoring the debug insn uses.

Sure, but doing it correctly for any hard register might prove tricky.


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-02-27 12:28 ` ebotcazou at gcc dot gnu.org
@ 2012-02-27 13:04 ` jakub at gcc dot gnu.org
  2012-02-27 17:15 ` ebotcazou at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-27 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-27 12:57:21 UTC ---
We should already have code that should handle it, the question is where we
have a bug in it.
Anyway, can't reproduce with a cross:
./gnat1 -O2 -g uintp.adb -I ../../gcc/ada/ -fcompare-debug= --param
min-nondebug-insn-uid=10000 -o uintp.s1  -fdump-final-insns=/tmp/1
./gnat1 -O2 -g uintp.adb -I ../../gcc/ada/ -fcompare-debug=-gtoggle -gtoggle
--param min-nondebug-insn-uid=10000 -o uintp.s2  -fdump-final-insns=/tmp/2
yield the same dumps.  What options are you using?


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-02-27 13:04 ` jakub at gcc dot gnu.org
@ 2012-02-27 17:15 ` ebotcazou at gcc dot gnu.org
  2012-02-28 15:48 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-02-27 17:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-02-27 17:14:14 UTC ---
> We should already have code that should handle it, the question is where we
> have a bug in it.

Do you mean the debug code in df-problems.c?

> Anyway, can't reproduce with a cross:
> ./gnat1 -O2 -g uintp.adb -I ../../gcc/ada/ -fcompare-debug= --param
> min-nondebug-insn-uid=10000 -o uintp.s1  -fdump-final-insns=/tmp/1
> ./gnat1 -O2 -g uintp.adb -I ../../gcc/ada/ -fcompare-debug=-gtoggle -gtoggle
> --param min-nondebug-insn-uid=10000 -o uintp.s2  -fdump-final-insns=/tmp/2
> yield the same dumps.  What options are you using?

With a cross from x86-64:

eric@atlantis:~/build/gcc/ia64-linux> gcc/xgcc -Bgcc -S uintp.adb -O2 -gnatpg
-fno-inline -I ~/svn/gcc/gcc/ada -fcompare-debug
xgcc: error: uintp.adb: -fcompare-debug failure

Do not try to reduce with -fcompare-debug failure, you'll end up with another
debug compare failure that is unrelated (some differences in DECL numbering).


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2012-02-27 17:15 ` ebotcazou at gcc dot gnu.org
@ 2012-02-28 15:48 ` jakub at gcc dot gnu.org
  2012-02-28 16:18 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-28 15:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-28 15:40:40 UTC ---
Ok, with additional -fno-inline -gnatpg I can reproduce even with the commands
I tried.

The dead_debug* stuff doesn't handle this probably because the hard reg isn't
ever becoming REG_DEAD or REG_UNUSED etc. in the IL, it is just unused
altogether plus set on entry.

I wonder if df_reg_chain_unlink/df_install_ref shouldn't just ignore DEBUG_INSN
refs when updating df->hard_regs_live_count array, do we care at all when
testing regs_ever_live if something is live in debug insns?


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2012-02-28 15:48 ` jakub at gcc dot gnu.org
@ 2012-02-28 16:18 ` jakub at gcc dot gnu.org
  2012-02-28 16:37 ` ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-28 16:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-02-28
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-28 16:14:52 UTC ---
Created attachment 26772
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26772
gcc47-pr52397.patch

Untested fix.  Not sure if that is the way we want to solve this though.


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2012-02-28 16:18 ` jakub at gcc dot gnu.org
@ 2012-02-28 16:37 ` ebotcazou at gcc dot gnu.org
  2012-02-28 16:43 ` ebotcazou at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-02-28 16:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-02-28 16:33:42 UTC ---
> I wonder if df_reg_chain_unlink/df_install_ref shouldn't just ignore DEBUG_INSN
> refs when updating df->hard_regs_live_count array, do we care at all when
> testing regs_ever_live if something is live in debug insns?

Probably not.  Moreover, hard_regs_live_count isn't used outside of df-scan.c
as both df_hard_reg_used_p and df_hard_reg_used_count are only used there (in
fact  the latter isn't used at all and could be eliminated altogether).


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2012-02-28 16:37 ` ebotcazou at gcc dot gnu.org
@ 2012-02-28 16:43 ` ebotcazou at gcc dot gnu.org
  2012-02-29  8:16 ` jakub at gcc dot gnu.org
  2012-02-29  8:51 ` jakub at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-02-28 16:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-02-28 16:41:04 UTC ---
> Untested fix.  Not sure if that is the way we want to solve this though.

You might want to adjust the comment in df.h because it will be totally off.


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2012-02-28 16:43 ` ebotcazou at gcc dot gnu.org
@ 2012-02-29  8:16 ` jakub at gcc dot gnu.org
  2012-02-29  8:51 ` jakub at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-29  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-29 08:12:15 UTC ---
Author: jakub
Date: Wed Feb 29 08:12:04 2012
New Revision: 184652

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184652
Log:
    PR bootstrap/52397
    * df.h (struct df_d): Adjust comment that hard_regs_live_count
    doesn't count DEBUG_INSN refs.
    * df-scan.c (df_ref_create_structure): Don't set DF_HARD_REG_LIVE
    for DEBUG_INSN refs.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/df-scan.c
    trunk/gcc/df.h


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

* [Bug bootstrap/52397] [4.7 regression] comparison failure with Ada enabled
  2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2012-02-29  8:16 ` jakub at gcc dot gnu.org
@ 2012-02-29  8:51 ` jakub at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-29  8:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-29 08:15:56 UTC ---
Fixed.


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

end of thread, other threads:[~2012-02-29  8:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-27  9:33 [Bug bootstrap/52397] New: [4.7 regression] comparison failure with Ada enabled ebotcazou at gcc dot gnu.org
2012-02-27  9:40 ` [Bug bootstrap/52397] " rguenth at gcc dot gnu.org
2012-02-27 11:06 ` rguenth at gcc dot gnu.org
2012-02-27 11:55 ` ebotcazou at gcc dot gnu.org
2012-02-27 12:04 ` jakub at gcc dot gnu.org
2012-02-27 12:28 ` ebotcazou at gcc dot gnu.org
2012-02-27 13:04 ` jakub at gcc dot gnu.org
2012-02-27 17:15 ` ebotcazou at gcc dot gnu.org
2012-02-28 15:48 ` jakub at gcc dot gnu.org
2012-02-28 16:18 ` jakub at gcc dot gnu.org
2012-02-28 16:37 ` ebotcazou at gcc dot gnu.org
2012-02-28 16:43 ` ebotcazou at gcc dot gnu.org
2012-02-29  8:16 ` jakub at gcc dot gnu.org
2012-02-29  8:51 ` jakub 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).