public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/37424]  New: [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap
@ 2008-09-08 14:11 ro at gcc dot gnu dot org
  2008-09-08 15:34 ` [Bug bootstrap/37424] " ebotcazou at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ro at gcc dot gnu dot org @ 2008-09-08 14:11 UTC (permalink / raw)
  To: gcc-bugs

Immediately after the IRA merge, sparc-sun-solaris2.11 bootstrap is broken:
stage2 libgcc fails to configure:

checking for suffix of object files... configure: error: in
`/vol/gccsrc/obj/reghunt/89389/sparc-sun-solaris2.11/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage2-target-libgcc] Error 1

config.log reveals

configure:2590: checking for suffix of object files
configure:2611: /vol/gccsrc/obj/reghunt/89389/./gcc/xgcc
-B/vol/gccsrc/obj/reghunt/89389/./gcc/ -B/usr/local/sparc-sun-solaris2.11/bin/
-B/usr/local/sparc-sun-solaris2.11/lib/ -isystem
/usr/local/sparc-sun-solaris2.11/include -isystem
/usr/local/sparc-sun-solaris2.11/sys-include -c -g -O2    conftest.c >&5
/vol/gcc/src/gcc-reghunt/libgcc/configure[2612]: 28988 Bus Error
configure:2614: $? = 138
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2627: error: in
`/vol/gccsrc/obj/reghunt/89389/sparc-sun-solaris2.11/libgcc':
configure:2629: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

Running cc1 directly gives the same error.  Running cc1 under gdb directly gets
me a segfault instead of SIGBUS:

Program received signal SIGSEGV, Segmentation fault.
0x000ae824 in grokdeclarator (declarator=0x87d7f8, declspecs=0x87d7a0,
decl_context=NORMAL, initialized=1 '\001', width=0x0, decl_attrs=0xffbff47c,
deprecated_state=DEPRECATED_NORMAL) at
/vol/gcc/src/gcc-reghunt/gcc/c-decl.c:4186
(gdb) where
#0  0x000ae824 in grokdeclarator (declarator=0x87d7f8, declspecs=0x87d7a0,
decl_context=NORMAL, initialized=1 '\001', width=0x0, decl_attrs=0xffbff47c,
deprecated_state=DEPRECATED_NORMAL) at
/vol/gcc/src/gcc-reghunt/gcc/c-decl.c:4186
#1  0x000b18bc in start_function (declspecs=0x87d7a0, declarator=0x87d7f8,
attributes=0x0) at /vol/gcc/src/gcc-reghunt/gcc/c-decl.c:6071
#2  0x0010ad00 in c_parser_declaration_or_fndef (parser=0xff01d7e0, fndef_ok=1
'\001', empty_ok=<value optimized out>, nested=0 '\0', start_attr_ok=<value
optimized out>) at /vol/gcc/src/gcc-reghunt/gcc/c-parser.c:1278
#3  0x0010f93c in c_parse_file () at
/vol/gcc/src/gcc-reghunt/gcc/c-parser.c:979
#4  0x000f2854 in c_common_parse_file (set_yydebug=0) at
/vol/gcc/src/gcc-reghunt/gcc/c-opts.c:1239
#5  0x00396468 in toplev_main (argc=<value optimized out>, argv=<value
optimized out>) at /vol/gcc/src/gcc-reghunt/gcc/toplev.c:968
#6  0x00092bc4 in _start ()


-- 
           Summary: [4.4 regression] IRA merge breaks Solaris/SPARC
                    bootstrap
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ro at gcc dot gnu dot org
 GCC build triplet: sparc-sun-solaris2.11
  GCC host triplet: sparc-sun-solaris2.11
GCC target triplet: sparc-sun-solaris2.11


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


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

* [Bug bootstrap/37424] [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap
  2008-09-08 14:11 [Bug bootstrap/37424] New: [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap ro at gcc dot gnu dot org
@ 2008-09-08 15:34 ` ebotcazou at gcc dot gnu dot org
  2008-09-08 20:03 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-09-08 15:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ebotcazou at gcc dot gnu dot org  2008-09-08 15:32 -------
Yep.  I'll try to debug later today.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-09-08 15:32:57
               date|                            |


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


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

* [Bug bootstrap/37424] [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap
  2008-09-08 14:11 [Bug bootstrap/37424] New: [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap ro at gcc dot gnu dot org
  2008-09-08 15:34 ` [Bug bootstrap/37424] " ebotcazou at gcc dot gnu dot org
@ 2008-09-08 20:03 ` pinskia at gcc dot gnu dot org
  2008-09-09 19:18 ` ebotcazou at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-09-08 20:03 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
           Severity|major                       |blocker
           Keywords|                            |ra, wrong-code
   Target Milestone|---                         |4.4.0


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


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

* [Bug bootstrap/37424] [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap
  2008-09-08 14:11 [Bug bootstrap/37424] New: [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap ro at gcc dot gnu dot org
  2008-09-08 15:34 ` [Bug bootstrap/37424] " ebotcazou at gcc dot gnu dot org
  2008-09-08 20:03 ` pinskia at gcc dot gnu dot org
@ 2008-09-09 19:18 ` ebotcazou at gcc dot gnu dot org
  2008-09-09 20:42 ` jsm28 at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-09-09 19:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ebotcazou at gcc dot gnu dot org  2008-09-09 19:17 -------
Several files are miscompiled by the stage1 compiler, starting with c-decl.c.
Now if you take the preprocessed file c-decl.i and compile it with a cross on
Linux, the resulting code is OK (the differences are in offsets against FP).

The discrepancy comes from the second qsort in ira_sort_regnos_for_alter_reg:

  /* Sort regnos according the slot numbers.  */
  regno_max_ref_width = reg_max_ref_width;
  qsort (pseudo_regnos, n, sizeof (int), coalesced_pseudo_reg_slot_compare);

It is not stable and this is quite obvious by looking at the compare function:

/* Sort pseudos according their slot numbers (putting ones with
  smaller numbers first, or last when the frame pointer is not
  needed).  */
static int
coalesced_pseudo_reg_slot_compare (const void *v1p, const void *v2p)
{
  const int regno1 = *(const int *) v1p;
  const int regno2 = *(const int *) v2p;
  ira_allocno_t a1 = ira_regno_allocno_map[regno1];
  ira_allocno_t a2 = ira_regno_allocno_map[regno2];
  int diff, slot_num1, slot_num2;
  int total_size1, total_size2;

  if (a1 == NULL || ALLOCNO_HARD_REGNO (a1) >= 0)
    {
      if (a2 == NULL || ALLOCNO_HARD_REGNO (a2) >= 0)
        return (const int *) v1p - (const int *) v2p; /* Save the order. */
      return 1;
    }
  else if (a2 == NULL || ALLOCNO_HARD_REGNO (a2) >= 0)
    return -1;
  slot_num1 = -ALLOCNO_HARD_REGNO (a1);
  slot_num2 = -ALLOCNO_HARD_REGNO (a2);
  if ((diff = slot_num1 - slot_num2) != 0)
    return (frame_pointer_needed
            || !FRAME_GROWS_DOWNWARD == STACK_GROWS_DOWNWARD ? diff : -diff);
  total_size1 = MAX (PSEUDO_REGNO_BYTES (regno1), regno_max_ref_width[regno1]);
  total_size2 = MAX (PSEUDO_REGNO_BYTES (regno2), regno_max_ref_width[regno2]);
  if ((diff = total_size2 - total_size1) != 0)
    return diff;
  return (const int *) v1p - (const int *) v2p; /* Save the order. */
}

The following patchlet stabilizes the sort:

Index: ira-color.c
===================================================================
--- ira-color.c (revision 140145)
+++ ira-color.c (working copy)
@@ -2169,7 +2169,7 @@ coalesced_pseudo_reg_slot_compare (const
   if (a1 == NULL || ALLOCNO_HARD_REGNO (a1) >= 0)
     {
       if (a2 == NULL || ALLOCNO_HARD_REGNO (a2) >= 0)
-       return (const int *) v1p - (const int *) v2p; /* Save the order. */
+       return regno1 - regno2;
       return 1;
     }
   else if (a2 == NULL || ALLOCNO_HARD_REGNO (a2) >= 0)
@@ -2183,7 +2183,7 @@ coalesced_pseudo_reg_slot_compare (const
   total_size2 = MAX (PSEUDO_REGNO_BYTES (regno2),
regno_max_ref_width[regno2]);
   if ((diff = total_size2 - total_size1) != 0)
     return diff;
-  return (const int *) v1p - (const int *) v2p; /* Save the order. */
+  return regno1 - regno2;
 }

 /* Setup REGNO_COALESCED_ALLOCNO_COST and REGNO_COALESCED_ALLOCNO_NUM

and the resulting code is the same (and correct) on both Linux and Solaris.

Bootstrap is still running, we'll see how far it goes after that.


-- 


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


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

* [Bug bootstrap/37424] [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap
  2008-09-08 14:11 [Bug bootstrap/37424] New: [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap ro at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-09-09 19:18 ` ebotcazou at gcc dot gnu dot org
@ 2008-09-09 20:42 ` jsm28 at gcc dot gnu dot org
  2008-09-09 21:21 ` ebotcazou at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-09-09 20:42 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug bootstrap/37424] [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap
  2008-09-08 14:11 [Bug bootstrap/37424] New: [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap ro at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-09-09 20:42 ` jsm28 at gcc dot gnu dot org
@ 2008-09-09 21:21 ` ebotcazou at gcc dot gnu dot org
  2008-09-11 23:54 ` hjl at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-09-09 21:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ebotcazou at gcc dot gnu dot org  2008-09-09 21:20 -------
> Bootstrap is still running, we'll see how far it goes after that.

Not very far... we need to wait for Jeff's stack slot sharing fix on big
endian.


-- 


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


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

* [Bug bootstrap/37424] [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap
  2008-09-08 14:11 [Bug bootstrap/37424] New: [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap ro at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-09-09 21:21 ` ebotcazou at gcc dot gnu dot org
@ 2008-09-11 23:54 ` hjl at gcc dot gnu dot org
  2008-09-12  5:27 ` ebotcazou at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl at gcc dot gnu dot org @ 2008-09-11 23:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl at gcc dot gnu dot org  2008-09-11 23:53 -------
Subject: Bug 37424

Author: hjl
Date: Thu Sep 11 23:52:12 2008
New Revision: 140303

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140303
Log:
2008-09-11  Eric Botcazou  <ebotcazou@adacore.com>

        PR rtl-optimization/37424
        * ira-color.c (coalesced_pseudo_reg_slot_compare): Untie by comparing
        the regnos instead of the addresses.

Modified:
    branches/ira-merge/gcc/ChangeLog.ira
    branches/ira-merge/gcc/ira-color.c


-- 


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


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

* [Bug bootstrap/37424] [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap
  2008-09-08 14:11 [Bug bootstrap/37424] New: [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap ro at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-09-11 23:54 ` hjl at gcc dot gnu dot org
@ 2008-09-12  5:27 ` ebotcazou at gcc dot gnu dot org
  2008-09-12 20:00 ` ebotcazou at gcc dot gnu dot org
  2008-09-12 21:09 ` andreast at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-09-12  5:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from ebotcazou at gcc dot gnu dot org  2008-09-12 05:26 -------
Subject: Bug 37424

Author: ebotcazou
Date: Fri Sep 12 05:24:41 2008
New Revision: 140312

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140312
Log:
        PR rtl-optimization/37424
        * ira-color.c (coalesced_pseudo_reg_slot_compare): Untie by comparing
        the regnos instead of the addresses.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira-color.c


-- 


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


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

* [Bug bootstrap/37424] [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap
  2008-09-08 14:11 [Bug bootstrap/37424] New: [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap ro at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-09-12  5:27 ` ebotcazou at gcc dot gnu dot org
@ 2008-09-12 20:00 ` ebotcazou at gcc dot gnu dot org
  2008-09-12 21:09 ` andreast at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-09-12 20:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ebotcazou at gcc dot gnu dot org  2008-09-12 19:59 -------
Fixed by

2008-09-11  Jeff Law <law@redhat.com>

        * reload1.c (alter_reg): Undo the BYTE_BIG_ENDIAN correction performed
        by assign_stack_local on the IRA path for stack slot sharing
        as well as the non-IRA path.


-- 

ebotcazou at gcc dot gnu dot org changed:

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


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


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

* [Bug bootstrap/37424] [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap
  2008-09-08 14:11 [Bug bootstrap/37424] New: [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap ro at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-09-12 20:00 ` ebotcazou at gcc dot gnu dot org
@ 2008-09-12 21:09 ` andreast at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: andreast at gcc dot gnu dot org @ 2008-09-12 21:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from andreast at gcc dot gnu dot org  2008-09-12 21:07 -------
Thanks!

First results here, but with disable-checking:
http://gcc.gnu.org/ml/gcc-testresults/2008-09/msg01060.html

Same version is now building w/o disable-checking.


-- 


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


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

end of thread, other threads:[~2008-09-12 21:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-08 14:11 [Bug bootstrap/37424] New: [4.4 regression] IRA merge breaks Solaris/SPARC bootstrap ro at gcc dot gnu dot org
2008-09-08 15:34 ` [Bug bootstrap/37424] " ebotcazou at gcc dot gnu dot org
2008-09-08 20:03 ` pinskia at gcc dot gnu dot org
2008-09-09 19:18 ` ebotcazou at gcc dot gnu dot org
2008-09-09 20:42 ` jsm28 at gcc dot gnu dot org
2008-09-09 21:21 ` ebotcazou at gcc dot gnu dot org
2008-09-11 23:54 ` hjl at gcc dot gnu dot org
2008-09-12  5:27 ` ebotcazou at gcc dot gnu dot org
2008-09-12 20:00 ` ebotcazou at gcc dot gnu dot org
2008-09-12 21:09 ` andreast 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).