public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/33676]  New: selected_int_kind.f90:22:
@ 2007-10-06 11:47 gerald at pfeifer dot com
  2007-10-06 18:59 ` [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault kargl at gcc dot gnu dot org
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: gerald at pfeifer dot com @ 2007-10-06 11:47 UTC (permalink / raw)
  To: gcc-bugs

libtool: compile:  /usr/nabil-files/pfeifer/OBJ-1003-1117/./gcc/gfortran
-B/usr/
nabil-files/pfeifer/OBJ-1003-1117/./gcc/
-B/files/pfeifer/gcc/i386-unknown-freeb
sd6.2/bin/ -B/files/pfeifer/gcc/i386-unknown-freebsd6.2/lib/ -isystem
/files/pfe
ifer/gcc/i386-unknown-freebsd6.2/include -isystem
/files/pfeifer/gcc/i386-unknow
n-freebsd6.2/sys-include -I . -Wall -fno-repack-arrays -fno-underscoring
-fallow
-leading-underscore -g -O2 -c
/sw/test/GCC/trunk/libgfortran/intrinsics/selected
_int_kind.f90  -fPIC -o .libs/selected_int_kind.o
/sw/test/GCC/trunk/libgfortran/intrinsics/selected_int_kind.f90:22: internal
com
piler error: Segmentation fault: 11


Forcing a core dump with -dH doesn't really seem very helpful here:

% gdb ../../gcc/f951 f951.core 
(gdb) bt
#0  0x488b3ecb in kill () from /lib/libc.so.6
#1  0x488b3e68 in raise () from /lib/libc.so.6
#2  0x488b2b78 in abort () from /lib/libc.so.6
#3  0x08148fa6 in diagnostic_action_after_output (context=0x5,
    diagnostic=0x662a) at /sw/test/GCC/trunk/gcc/diagnostic.c:670
#4  0x08149173 in diagnostic_report_diagnostic (context=0x8777860,
    diagnostic=0xbfbfde8c) at /sw/test/GCC/trunk/gcc/diagnostic.c:425
#5  0x081492a7 in internal_error (gmsgid=0x869d6e5 "%s")
    at /sw/test/GCC/trunk/gcc/diagnostic.c:606
#6  0x082c72a7 in crash_signal (signo=Variable "signo" is not available.
) at /sw/test/GCC/trunk/gcc/toplev.c:610
#7  0x00000007 in ?? ()


-- 
           Summary: selected_int_kind.f90:22:
                    libgfortran bootstrap failure: selected_int_kind.f90:22:
                    internal compiler error: Segmentation fault: 11
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gerald at pfeifer dot com
  GCC host triplet: i386-unknown-freebsd5.4


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


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

* [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
@ 2007-10-06 18:59 ` kargl at gcc dot gnu dot org
  2007-10-07  3:20 ` kargl at gcc dot gnu dot org
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-10-06 18:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from kargl at gcc dot gnu dot org  2007-10-06 18:59 -------
Sigh.  GCC appears to be miscompiling itself on i386-*-freebsd.

configure --disable-bootstrap
make

Builds a working compiler

configure
make bootstrap
dies.


-- 

kargl 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         |2007-10-06 18:59:19
               date|                            |


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


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

* [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
  2007-10-06 18:59 ` [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault kargl at gcc dot gnu dot org
@ 2007-10-07  3:20 ` kargl at gcc dot gnu dot org
  2007-10-07 16:39 ` kargl at gcc dot gnu dot org
                   ` (23 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-10-07  3:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from kargl at gcc dot gnu dot org  2007-10-07 03:20 -------
Sources that are obtained via

  svn merge -r HEAD:'{2007-10-01}' .

bootstrap without a problem.  I'll slide forward to 10-03.


-- 


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


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

* [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
  2007-10-06 18:59 ` [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault kargl at gcc dot gnu dot org
  2007-10-07  3:20 ` kargl at gcc dot gnu dot org
@ 2007-10-07 16:39 ` kargl at gcc dot gnu dot org
  2007-10-09 14:25 ` fxcoudert at gcc dot gnu dot org
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-10-07 16:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from kargl at gcc dot gnu dot org  2007-10-07 16:39 -------
Sources retrieved with

svn merge -r HEAD:'{2007-10-04}' .

lead to the seg fault reported by Gerald.  So the
problem was introduced between 2007-10-03 and 
2007-10-04.

Also, note that the problem does not appear in
x86_64-*-freebsd.


-- 

kargl at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu dot org


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


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

* [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (2 preceding siblings ...)
  2007-10-07 16:39 ` kargl at gcc dot gnu dot org
@ 2007-10-09 14:25 ` fxcoudert at gcc dot gnu dot org
  2007-10-09 16:14 ` giovannibajo at libero dot it
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-10-09 14:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from fxcoudert at gcc dot gnu dot org  2007-10-09 14:24 -------
*** Bug 33679 has been marked as a duplicate of this bug. ***


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org


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


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

* [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (3 preceding siblings ...)
  2007-10-09 14:25 ` fxcoudert at gcc dot gnu dot org
@ 2007-10-09 16:14 ` giovannibajo at libero dot it
  2007-10-09 16:15 ` giovannibajo at libero dot it
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: giovannibajo at libero dot it @ 2007-10-09 16:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from giovannibajo at libero dot it  2007-10-09 16:14 -------
After each merge command, use "svn info" to identify the unique revision number
to which those dates correspond. You can then use the same "svn merge" with
revision number to further reghunt this bug.


-- 

giovannibajo at libero dot it changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|libgfortran bootstrap       |libgfortran bootstrap
                   |failure:                    |failure:
                   |selected_int_kind.f90:22:   |selected_int_kind.f90:22:
                   |Segmentation fault          |Segmentation fault
                   |libgfortran bootstrap       |
                   |failure:                    |
                   |selected_int_kind.f90:22:   |
                   |internal compiler error:    |
                   |Segmentation fault: 11      |


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


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

* [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (4 preceding siblings ...)
  2007-10-09 16:14 ` giovannibajo at libero dot it
@ 2007-10-09 16:15 ` giovannibajo at libero dot it
  2007-10-09 17:06 ` hjl at lucon dot org
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: giovannibajo at libero dot it @ 2007-10-09 16:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from giovannibajo at libero dot it  2007-10-09 16:15 -------
Scratch that, sorry, "svn info" wouldn't convey the correct info. You need to
use svn log to roughly convert between dates and revnums.


-- 


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


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

* [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (5 preceding siblings ...)
  2007-10-09 16:15 ` giovannibajo at libero dot it
@ 2007-10-09 17:06 ` hjl at lucon dot org
  2007-10-09 18:43 ` belyshev at depni dot sinp dot msu dot ru
                   ` (18 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: hjl at lucon dot org @ 2007-10-09 17:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from hjl at lucon dot org  2007-10-09 17:05 -------
It may be related to PR 33669.


-- 

hjl at lucon dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl at lucon dot org


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


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

* [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (6 preceding siblings ...)
  2007-10-09 17:06 ` hjl at lucon dot org
@ 2007-10-09 18:43 ` belyshev at depni dot sinp dot msu dot ru
  2007-10-09 18:47 ` hjl at lucon dot org
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2007-10-09 18:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from belyshev at depni dot sinp dot msu dot ru  2007-10-09 18:43 -------
// Small testcase, compile with "-march=i586 -O0 -fomit-frame-pointer":

__attribute__((noreturn,noinline)) void abrt (const char *fi, const char *fu)
{
  __builtin_abort ();
}

__attribute__((noinline)) int f (int k)
{
  return k;
}

__attribute__((noinline)) int g (int t, int k)
{
  int b;

  switch (t)
    {
    case 0:
      abrt (__FILE__, __FUNCTION__);

    case 1:
      b = f (k);
      break;

    case 2:
      b = f (k);
      break;

    case 3:
      b = f (k);
      break;

    case 4:
      b = f (k);
      break;

    default:
      abrt (__FILE__, __FUNCTION__);
    }

  return b;
}

int main (void)
{
  if (g (3, 1337) != 1337)
      abrt (__FILE__, __FUNCTION__);
  return 0;
}


// Fails only with -fomit-frame-pointer and with -march <= i586.


-- 


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


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

* [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (7 preceding siblings ...)
  2007-10-09 18:43 ` belyshev at depni dot sinp dot msu dot ru
@ 2007-10-09 18:47 ` hjl at lucon dot org
  2007-10-10  6:09 ` [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer belyshev at depni dot sinp dot msu dot ru
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: hjl at lucon dot org @ 2007-10-09 18:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from hjl at lucon dot org  2007-10-09 18:47 -------
Revision 128957 causes this regression.


-- 

hjl at lucon dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zadeck at naturalbridge dot
                   |                            |com
  BugsThisDependsOn|                            |33669


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (8 preceding siblings ...)
  2007-10-09 18:47 ` hjl at lucon dot org
@ 2007-10-10  6:09 ` belyshev at depni dot sinp dot msu dot ru
  2007-10-10  7:59 ` ubizjak at gmail dot com
                   ` (15 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2007-10-10  6:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from belyshev at depni dot sinp dot msu dot ru  2007-10-10 06:08 -------
This bug is not fixed by r129193


-- 

belyshev at depni dot sinp dot msu dot ru changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|bootstrap                   |rtl-optimization
   GCC host triplet|i386-unknown-freebsd5.4     |
 GCC target triplet|                            |i386-*-*
           Keywords|                            |build, wrong-code
   Last reconfirmed|2007-10-06 18:59:19         |2007-10-10 06:08:58
               date|                            |
            Summary|libgfortran bootstrap       |libgfortran bootstrap
                   |failure:                    |failure:
                   |selected_int_kind.f90:22:   |selected_int_kind.f90:22:
                   |Segmentation fault          |Segmentation fault, wrong
                   |                            |code with -fomit-frame-
                   |                            |pointer
   Target Milestone|---                         |4.3.0


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (9 preceding siblings ...)
  2007-10-10  6:09 ` [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer belyshev at depni dot sinp dot msu dot ru
@ 2007-10-10  7:59 ` ubizjak at gmail dot com
  2007-10-10 11:41 ` zadeck at naturalbridge dot com
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: ubizjak at gmail dot com @ 2007-10-10  7:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from ubizjak at gmail dot com  2007-10-10 07:59 -------
(In reply to comment #9)
> Revision 128957 causes this regression.

I can confirm that r128956 bootstraps OK when configured with
--build=i386-pc-linux-gnu. Also, r128956 compiles and runs testcase from
comment #8 without problems.


-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (10 preceding siblings ...)
  2007-10-10  7:59 ` ubizjak at gmail dot com
@ 2007-10-10 11:41 ` zadeck at naturalbridge dot com
  2007-10-10 12:43 ` zadeck at naturalbridge dot com
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: zadeck at naturalbridge dot com @ 2007-10-10 11:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from zadeck at naturalbridge dot com  2007-10-10 11:41 -------
I will look at it today.


-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (11 preceding siblings ...)
  2007-10-10 11:41 ` zadeck at naturalbridge dot com
@ 2007-10-10 12:43 ` zadeck at naturalbridge dot com
  2007-10-11 11:15 ` ebotcazou at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: zadeck at naturalbridge dot com @ 2007-10-10 12:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

zadeck at naturalbridge dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|33669                       |
         AssignedTo|unassigned at gcc dot gnu   |zadeck at naturalbridge dot
                   |dot org                     |com
             Status|NEW                         |ASSIGNED


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (12 preceding siblings ...)
  2007-10-10 12:43 ` zadeck at naturalbridge dot com
@ 2007-10-11 11:15 ` ebotcazou at gcc dot gnu dot org
  2007-10-11 11:43 ` zadeck at naturalbridge dot com
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-10-11 11:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from ebotcazou at gcc dot gnu dot org  2007-10-11 11:14 -------
> Revision 128957 causes this regression.

There is a suspect non-documented hunk in the commit:

        * reload1.c (compute_use_by_pseudos): Change DF_RA_LIVE
        usage to DF_LIVE usage.

--- trunk/gcc/reload1.c 2007/10/02 12:47:13     128956
+++ trunk/gcc/reload1.c 2007/10/02 13:10:07     128957
@@ -548,7 +548,7 @@
       if (r < 0)
        {
          /* reload_combine uses the information from
-            DF_RA_LIVE_IN (BASIC_BLOCK), which might still
+            DF_LIVE_IN (BASIC_BLOCK), which might still
             contain registers that have not actually been allocated
             since they have an equivalence.  */
          gcc_assert (reload_completed);
@@ -1158,10 +1158,7 @@

   if (! frame_pointer_needed)
     FOR_EACH_BB (bb)
-      {
-       bitmap_clear_bit (df_get_live_in (bb), HARD_FRAME_POINTER_REGNUM);
-       bitmap_clear_bit (df_get_live_top (bb), HARD_FRAME_POINTER_REGNUM);
-      }
+      bitmap_clear_bit (df_get_live_in (bb), HARD_FRAME_POINTER_REGNUM);

   /* Come here (with failure set nonzero) if we can't get enough spill
      regs.  */


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (13 preceding siblings ...)
  2007-10-11 11:15 ` ebotcazou at gcc dot gnu dot org
@ 2007-10-11 11:43 ` zadeck at naturalbridge dot com
  2007-10-11 12:24 ` ebotcazou at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: zadeck at naturalbridge dot com @ 2007-10-11 11:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from zadeck at naturalbridge dot com  2007-10-11 11:43 -------
Subject: Re:  libgfortran bootstrap failure: selected_int_kind.f90:22:
 Segmentation fault, wrong code with -fomit-frame-pointer

ebotcazou at gcc dot gnu dot org wrote:
> ------- Comment #13 from ebotcazou at gcc dot gnu dot org  2007-10-11 11:14 -------
>   
>> Revision 128957 causes this regression.
>>     
>
> There is a suspect non-documented hunk in the commit:
>
>         * reload1.c (compute_use_by_pseudos): Change DF_RA_LIVE
>         usage to DF_LIVE usage.
>
> --- trunk/gcc/reload1.c 2007/10/02 12:47:13     128956
> +++ trunk/gcc/reload1.c 2007/10/02 13:10:07     128957
> @@ -548,7 +548,7 @@
>        if (r < 0)
>         {
>           /* reload_combine uses the information from
> -            DF_RA_LIVE_IN (BASIC_BLOCK), which might still
> +            DF_LIVE_IN (BASIC_BLOCK), which might still
>              contain registers that have not actually been allocated
>              since they have an equivalence.  */
>           gcc_assert (reload_completed);
> @@ -1158,10 +1158,7 @@
>
>    if (! frame_pointer_needed)
>      FOR_EACH_BB (bb)
> -      {
> -       bitmap_clear_bit (df_get_live_in (bb), HARD_FRAME_POINTER_REGNUM);
> -       bitmap_clear_bit (df_get_live_top (bb), HARD_FRAME_POINTER_REGNUM);
> -      }
> +      bitmap_clear_bit (df_get_live_in (bb), HARD_FRAME_POINTER_REGNUM);
>
>    /* Come here (with failure set nonzero) if we can't get enough spill
>       regs.  */
>
>
>   

That is fine, there are no top sets anymore.

the problem is the code that builds the reload insn chain.  the new code
uses the cfg and does not add the label or the jump table that lives
between basic blocks to the chain.  I will post a patch as soon as my
tests finish.

kenny


-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (14 preceding siblings ...)
  2007-10-11 11:43 ` zadeck at naturalbridge dot com
@ 2007-10-11 12:24 ` ebotcazou at gcc dot gnu dot org
  2007-10-11 12:40 ` zadeck at naturalbridge dot com
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-10-11 12:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from ebotcazou at gcc dot gnu dot org  2007-10-11 12:24 -------
> That is fine, there are no top sets anymore.

Thanks for the explanation, please fix the ChangeLog though.

> the problem is the code that builds the reload insn chain.  the new code
> uses the cfg and does not add the label or the jump table that lives
> between basic blocks to the chain.  I will post a patch as soon as my
> tests finish.

OK.


-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (15 preceding siblings ...)
  2007-10-11 12:24 ` ebotcazou at gcc dot gnu dot org
@ 2007-10-11 12:40 ` zadeck at naturalbridge dot com
  2007-10-11 16:22 ` zadeck at naturalbridge dot com
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: zadeck at naturalbridge dot com @ 2007-10-11 12:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from zadeck at naturalbridge dot com  2007-10-11 12:40 -------
Subject: Re:  libgfortran bootstrap failure: selected_int_kind.f90:22:
 Segmentation fault, wrong code with -fomit-frame-pointer

ebotcazou at gcc dot gnu dot org wrote:
> ------- Comment #15 from ebotcazou at gcc dot gnu dot org  2007-10-11 12:24 -------
>   
>> That is fine, there are no top sets anymore.
>>     
>
> Thanks for the explanation, please fix the ChangeLog though.
>   
I will, sorry for the oversight.
>   
>> the problem is the code that builds the reload insn chain.  the new code
>> uses the cfg and does not add the label or the jump table that lives
>> between basic blocks to the chain.  I will post a patch as soon as my
>> tests finish.
>>     
>
> OK.
>
>
>   


-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (16 preceding siblings ...)
  2007-10-11 12:40 ` zadeck at naturalbridge dot com
@ 2007-10-11 16:22 ` zadeck at naturalbridge dot com
  2007-10-11 19:53 ` belyshev at depni dot sinp dot msu dot ru
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: zadeck at naturalbridge dot com @ 2007-10-11 16:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from zadeck at naturalbridge dot com  2007-10-11 16:21 -------
Subject: Re:  libgfortran bootstrap failure: selected_int_kind.f90:22:
 Segmentation fault, wrong code with -fomit-frame-pointer

2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>

    PR middle-end/33676
    * global.c (build_insn_chain): Include insn that occur between
    basic blocks.

2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>

    PR middle-end/33676
    * gcc.c-torture/gcc.dg/torture/pr33676.c: New.



When I rewrote this code to use backward scanning rather than forwards
scanning, I converted it to properly use the cfg, since it is generally
considered outmoded to just scan the insns.

However, the reload_insn_chain actually needs the insns that appear
between basic blocks, in particular the labels in front of branch
tables.  I added code here to check for insns that may be in front of a
basic block after scanning that block. 

There are a lot of ways that I could have done this, for instance, I
could have just written in terms of the PREV_INSN as the old code was. 
I think that in doing it the way that i have done it, it is obvious what
needs to be done if someone really does get rid of the branch tables
between the blocks.

This has been bootstrapped and regression tested on x86-{64,32} ppc-32,
and ia-64.  However it is not clear to me how many platforms use this
kind of table branch.  The bug appears to only be on the -march=i586, so
the reviewers may wish to comment on my choice of dg options on the test. 


Ok to commit?

Kenny
Index: testsuite/gcc.dg/torture/pr33676.c
===================================================================
--- testsuite/gcc.dg/torture/pr33676.c  (revision 0)
+++ testsuite/gcc.dg/torture/pr33676.c  (revision 0)
@@ -0,0 +1,53 @@
+/* { dg-do run } */ 
+/* { dg-options "-march=i586 -fomit-frame-pointer" { target { { i?86-*-*
x86_64-*-* } && ilp32 } } } */
+
+// Small testcase, compile with "-march=i586 -O0 -fomit-frame-pointer":
+
+__attribute__((noreturn,noinline)) void abrt (const char *fi, const char *fu)
+{
+  __builtin_abort ();
+}
+
+__attribute__((noinline)) int f (int k)
+{
+  return k;
+}
+
+__attribute__((noinline)) int g (int t, int k)
+{
+  int b;
+
+  switch (t)
+    {
+    case 0:
+      abrt (__FILE__, __FUNCTION__);
+
+    case 1:
+      b = f (k);
+      break;
+
+    case 2:
+      b = f (k);
+      break;
+
+    case 3:
+      b = f (k);
+      break;
+
+    case 4:
+      b = f (k);
+      break;
+
+    default:
+      abrt (__FILE__, __FUNCTION__);
+    }
+
+  return b;
+}
+
+int main (void)
+{
+  if (g (3, 1337) != 1337)
+      abrt (__FILE__, __FUNCTION__);
+  return 0;
+}
Index: global.c
===================================================================
--- global.c    (revision 129224)
+++ global.c    (working copy)
@@ -1575,6 +1575,37 @@ build_insn_chain (void)
                  }
            }
        }
+
+      /* FIXME!! The following code is a disaster.  Reload needs to see the
+        labels and jump tables that are just hanging out in between
+        the basic blocks.  See pr33676.  */
+
+      insn = BB_HEAD (bb);
+
+      /* Skip over the barriers and cruft.  */
+      while (insn && (BARRIER_P (insn) || NOTE_P (insn) || BLOCK_FOR_INSN
(insn) == bb))
+       insn = PREV_INSN (insn);
+       
+      /* Look for labels and jump tables.  */
+      while (insn)
+       {
+         if (!NOTE_P (insn) && !BARRIER_P (insn))
+           {
+             if (BLOCK_FOR_INSN (insn))
+               break;
+
+             c = new_insn_chain ();
+             c->next = next;
+             next = c;
+             *p = c;
+             p = &c->prev;
+             
+             c->insn = insn;
+             c->block = bb->index;
+             bitmap_copy (&c->live_throughout, live_relevant_regs);
+           }     
+         insn = PREV_INSN (insn);
+       }
     }

   for (i = 0; i < (unsigned int)max_regno; i++)


-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (17 preceding siblings ...)
  2007-10-11 16:22 ` zadeck at naturalbridge dot com
@ 2007-10-11 19:53 ` belyshev at depni dot sinp dot msu dot ru
  2007-10-11 22:32 ` zadeck at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2007-10-11 19:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from belyshev at depni dot sinp dot msu dot ru  2007-10-11 19:52 -------
Subject: Re:  libgfortran bootstrap failure: selected_int_kind.f90:22: 
Segmentation fault, wrong code with -fomit-frame-pointer

Kenneth Zadeck <zadeck@naturalbridge.com> writes:

> 2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>
>
>     PR middle-end/33676
>     * global.c (build_insn_chain): Include insn that occur between
>     basic blocks.
>
> 2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>
>
>     PR middle-end/33676
>     * gcc.c-torture/gcc.dg/torture/pr33676.c: New.
        ^^ typo, should be:

      * gcc.dg/torture/pr33676.c: New.

> Kenny
> Index: testsuite/gcc.dg/torture/pr33676.c
> ===================================================================
> --- testsuite/gcc.dg/torture/pr33676.c	(revision 0)
> +++ testsuite/gcc.dg/torture/pr33676.c	(revision 0)
> @@ -0,0 +1,53 @@
> +/* { dg-do run } */ 
> +/* { dg-options "-march=i586 -fomit-frame-pointer" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
                            ^ better use -march=i386 so testcase wont fail
                            with SIGILL on i486 machines in case (if ever)
                            anyone will try to test gcc there.

> +// Small testcase, compile with "-march=i586 -O0 -fomit-frame-pointer":
omit this comment to keep it cleaner and smaller. :)


-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (18 preceding siblings ...)
  2007-10-11 19:53 ` belyshev at depni dot sinp dot msu dot ru
@ 2007-10-11 22:32 ` zadeck at gcc dot gnu dot org
  2007-10-11 22:35 ` zadeck at naturalbridge dot com
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: zadeck at gcc dot gnu dot org @ 2007-10-11 22:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from zadeck at gcc dot gnu dot org  2007-10-11 22:32 -------
Subject: Bug 33676

Author: zadeck
Date: Thu Oct 11 22:31:55 2007
New Revision: 129244

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129244
Log:
2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>

        PR middle-end/33676
        * global.c (build_insn_chain): Include insn that occur between
        basic blocks.

2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>

        PR middle-end/33676
        * gcc.dg/torture/pr33676.c: New.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr33676.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/global.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (19 preceding siblings ...)
  2007-10-11 22:32 ` zadeck at gcc dot gnu dot org
@ 2007-10-11 22:35 ` zadeck at naturalbridge dot com
  2007-10-12  4:07 ` kargl at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: zadeck at naturalbridge dot com @ 2007-10-11 22:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from zadeck at naturalbridge dot com  2007-10-11 22:35 -------
Subject: Re:  libgfortran bootstrap failure: selected_int_kind.f90:22:
 Segmentation fault, wrong code with -fomit-frame-pointer

zadeck at naturalbridge dot com wrote:
> ------- Comment #17 from zadeck at naturalbridge dot com  2007-10-11 16:21 -------
> Subject: Re:  libgfortran bootstrap failure: selected_int_kind.f90:22:
>  Segmentation fault, wrong code with -fomit-frame-pointer
>
>
>
> When I rewrote this code to use backward scanning rather than forwards
> scanning, I converted it to properly use the cfg, since it is generally
> considered outmoded to just scan the insns.
>
> However, the reload_insn_chain actually needs the insns that appear
> between basic blocks, in particular the labels in front of branch
> tables.  I added code here to check for insns that may be in front of a
> basic block after scanning that block. 
>
> There are a lot of ways that I could have done this, for instance, I
> could have just written in terms of the PREV_INSN as the old code was. 
> I think that in doing it the way that i have done it, it is obvious what
> needs to be done if someone really does get rid of the branch tables
> between the blocks.
>
> This has been bootstrapped and regression tested on x86-{64,32} ppc-32,
> and ia-64.  However it is not clear to me how many platforms use this
> kind of table branch.  The bug appears to only be on the -march=i586, so
> the reviewers may wish to comment on my choice of dg options on the test. 
>
>   
2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>

    PR middle-end/33676
    * global.c (build_insn_chain): Include insn that occur between
    basic blocks.

2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>

    PR middle-end/33676
    * gcc.dg/torture/pr33676.c: New.

bootstrapped and regression tested on x86-32 x86-64, ppc-32 and ia-64.

committed as revision 129244.

Kenny
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 129243)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>
+
+       PR middle-end/33676
+       * global.c (build_insn_chain): Include insn that occur between
+       basic blocks.
+       
 2007-10-11  Tom Tromey  <tromey@redhat.com>

        * gengtype-yacc.y: Delete.
Index: testsuite/gcc.dg/torture/pr33676.c
===================================================================
--- testsuite/gcc.dg/torture/pr33676.c  (revision 0)
+++ testsuite/gcc.dg/torture/pr33676.c  (revision 0)
@@ -0,0 +1,51 @@
+/* { dg-do run } */ 
+/* { dg-options "-march=i586 -fomit-frame-pointer" { target { { i?86-*-*
x86_64-*-* } && ilp32 } } } */
+
+__attribute__((noreturn,noinline)) void abrt (const char *fi, const char *fu)
+{
+  __builtin_abort ();
+}
+
+__attribute__((noinline)) int f (int k)
+{
+  return k;
+}
+
+__attribute__((noinline)) int g (int t, int k)
+{
+  int b;
+
+  switch (t)
+    {
+    case 0:
+      abrt (__FILE__, __FUNCTION__);
+
+    case 1:
+      b = f (k);
+      break;
+
+    case 2:
+      b = f (k);
+      break;
+
+    case 3:
+      b = f (k);
+      break;
+
+    case 4:
+      b = f (k);
+      break;
+
+    default:
+      abrt (__FILE__, __FUNCTION__);
+    }
+
+  return b;
+}
+
+int main (void)
+{
+  if (g (3, 1337) != 1337)
+      abrt (__FILE__, __FUNCTION__);
+  return 0;
+}
Index: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog (revision 129243)
+++ testsuite/ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>
+
+       PR middle-end/33676
+       * gcc.dg/torture/pr33676.c: New.
+
 2007-10-11  Paolo Carlini  <pcarlini@suse.de>

        PR c++/31441
Index: global.c
===================================================================
--- global.c    (revision 129243)
+++ global.c    (working copy)
@@ -1575,6 +1575,41 @@ build_insn_chain (void)
                  }
            }
        }
+
+      /* FIXME!! The following code is a disaster.  Reload needs to see the
+        labels and jump tables that are just hanging out in between
+        the basic blocks.  See pr33676.  */
+
+      insn = BB_HEAD (bb);
+
+      /* Skip over the barriers and cruft.  */
+      while (insn && (BARRIER_P (insn) || NOTE_P (insn) || BLOCK_FOR_INSN
(insn) == bb))
+       insn = PREV_INSN (insn);
+       
+      /* While we add anything except barriers and notes, the focus is
+        to get the labels and jump tables into the
+        reload_insn_chain.  */
+      while (insn)
+       {
+         if (!NOTE_P (insn) && !BARRIER_P (insn))
+           {
+             if (BLOCK_FOR_INSN (insn))
+               break;
+
+             c = new_insn_chain ();
+             c->next = next;
+             next = c;
+             *p = c;
+             p = &c->prev;
+             
+             c->insn = insn;
+             /* The block makes no sense here, but it is what the old
+                code did.  */
+             c->block = bb->index;
+             bitmap_copy (&c->live_throughout, live_relevant_regs);
+           }     
+         insn = PREV_INSN (insn);
+       }
     }

   for (i = 0; i < (unsigned int)max_regno; i++)


-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (20 preceding siblings ...)
  2007-10-11 22:35 ` zadeck at naturalbridge dot com
@ 2007-10-12  4:07 ` kargl at gcc dot gnu dot org
  2007-10-12 11:59 ` zadeck at naturalbridge dot com
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-10-12  4:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from kargl at gcc dot gnu dot org  2007-10-12 04:07 -------
Kenny,

My build tonight's tree completed successfully.  I think this
PR can be close, but you may want to hear from Gerald first.


-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (21 preceding siblings ...)
  2007-10-12  4:07 ` kargl at gcc dot gnu dot org
@ 2007-10-12 11:59 ` zadeck at naturalbridge dot com
  2007-10-12 12:56 ` ebotcazou at libertysurf dot fr
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: zadeck at naturalbridge dot com @ 2007-10-12 11:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from zadeck at naturalbridge dot com  2007-10-12 11:59 -------
it seems to be clean now.


-- 

zadeck at naturalbridge dot com changed:

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


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (22 preceding siblings ...)
  2007-10-12 11:59 ` zadeck at naturalbridge dot com
@ 2007-10-12 12:56 ` ebotcazou at libertysurf dot fr
  2007-10-12 14:38 ` zadeck at naturalbridge dot com
  2007-10-12 15:40 ` gerald at pfeifer dot com
  25 siblings, 0 replies; 27+ messages in thread
From: ebotcazou at libertysurf dot fr @ 2007-10-12 12:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from ebotcazou at libertysurf dot fr  2007-10-12 12:56 -------
Subject: Re:  libgfortran bootstrap failure: selected_int_kind.f90:22: 
Segmentation fault, wrong code with -fomit-frame-pointer

> 2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>
>
>     PR middle-end/33676
>     * global.c (build_insn_chain): Include insn that occur between
>     basic blocks.

Who approved this patch?

> However, the reload_insn_chain actually needs the insns that appear
> between basic blocks, in particular the labels in front of branch
> tables.  I added code here to check for insns that may be in front of a
> basic block after scanning that block.
>
> There are a lot of ways that I could have done this, for instance, I
> could have just written in terms of the PREV_INSN as the old code was.
> I think that in doing it the way that i have done it, it is obvious what
> needs to be done if someone really does get rid of the branch tables
> between the blocks.

Sure, but the code in build_insn_chain is now more convoluted than in the 
original version (and twice as big).  And, please, fix the formatting.


-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (23 preceding siblings ...)
  2007-10-12 12:56 ` ebotcazou at libertysurf dot fr
@ 2007-10-12 14:38 ` zadeck at naturalbridge dot com
  2007-10-12 15:40 ` gerald at pfeifer dot com
  25 siblings, 0 replies; 27+ messages in thread
From: zadeck at naturalbridge dot com @ 2007-10-12 14:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #24 from zadeck at naturalbridge dot com  2007-10-12 14:38 -------
Subject: Re:  libgfortran bootstrap failure: selected_int_kind.f90:22:
  Segmentation fault, wrong code with -fomit-frame-pointer

Eric Botcazou wrote:
>> 2007-10-11  Kenneth Zadeck <zadeck@naturalbridge.com>
>>
>>     PR middle-end/33676
>>     * global.c (build_insn_chain): Include insn that occur between
>>     basic blocks.
>>     
>
> Who approved this patch?
>
>   
>> However, the reload_insn_chain actually needs the insns that appear
>> between basic blocks, in particular the labels in front of branch
>> tables.  I added code here to check for insns that may be in front of a
>> basic block after scanning that block.
>>
>> There are a lot of ways that I could have done this, for instance, I
>> could have just written in terms of the PREV_INSN as the old code was.
>> I think that in doing it the way that i have done it, it is obvious what
>> needs to be done if someone really does get rid of the branch tables
>> between the blocks.
>>     
>
> Sure, but the code in build_insn_chain is now more convoluted than in the 
> original version (and twice as big).  And, please, fix the formatting.
>
>   
it was approved by seonbae, a register allocation reviewer.    The
reason that it is longer is that it is more precise.  The code to
properly handle subregs, as well as properly dealing with registers live
thru insns,  accounts for most of the expansion over the old code.

formatting fixes committed as revision 129262.

kenny
Index: global.c
===================================================================
--- global.c    (revision 129260)
+++ global.c    (working copy)
@@ -1358,6 +1358,8 @@ mark_elimination (int from, int to)
     }
 }

+/* Print chain C to FILE.  */
+
 static void
 print_insn_chain (FILE *file, struct insn_chain *c)
 {
@@ -1366,6 +1368,9 @@ print_insn_chain (FILE *file, struct ins
   bitmap_print (file, &c->dead_or_set, "dead_or_set: ", "\n");
 }

+
+/* Print all reload_insn_chains to FILE.  */
+
 static void
 print_insn_chains (FILE *file)
 {
@@ -1373,8 +1378,11 @@ print_insn_chains (FILE *file)
   for (c = reload_insn_chain; c ; c = c->next)
     print_insn_chain (file, c);
 }
+
+
 /* Walk the insns of the current function and build reload_insn_chain,
    and record register life information.  */
+
 static void
 build_insn_chain (void)
 {
@@ -1450,7 +1458,7 @@ build_insn_chain (void)
                      {
                        if (regno < FIRST_PSEUDO_REGISTER)
                          {
-                           if (! fixed_regs[regno])
+                           if (!fixed_regs[regno])
                              bitmap_set_bit (&c->dead_or_set, regno);
                          }
                        else if (reg_renumber[regno] >= 0)
@@ -1461,16 +1469,20 @@ build_insn_chain (void)
                        && (!DF_REF_FLAGS_IS_SET (def, DF_REF_CONDITIONAL)))
                      {
                        rtx reg = DF_REF_REG (def);
+
                        /* We can model subregs, but not if they are
                           wrapped in ZERO_EXTRACTS.  */
                        if (GET_CODE (reg) == SUBREG
                            && !DF_REF_FLAGS_IS_SET (def, DF_REF_EXTRACT))
                          {
                            unsigned int start = SUBREG_BYTE (reg);
-                           unsigned int last = start + GET_MODE_SIZE (GET_MODE
(reg));
+                           unsigned int last = start 
+                             + GET_MODE_SIZE (GET_MODE (reg));

-                           ra_init_live_subregs (bitmap_bit_p
(live_relevant_regs, regno), 
-                                                 live_subregs,
live_subregs_used,
+                           ra_init_live_subregs (bitmap_bit_p
(live_relevant_regs, 
+                                                               regno), 
+                                                 live_subregs, 
+                                                 live_subregs_used,
                                                  regno, reg);
                            /* Ignore the paradoxical bits.  */
                            if ((int)last > live_subregs_used[regno])
@@ -1535,7 +1547,7 @@ build_insn_chain (void)
                      {
                        if (regno < FIRST_PSEUDO_REGISTER)
                          {
-                           if (! fixed_regs[regno])
+                           if (!fixed_regs[regno])
                              bitmap_set_bit (&c->dead_or_set, regno);
                          }
                        else if (reg_renumber[regno] >= 0)
@@ -1548,10 +1560,13 @@ build_insn_chain (void)
                            && !DF_REF_FLAGS_IS_SET (use, DF_REF_EXTRACT)) 
                          {
                            unsigned int start = SUBREG_BYTE (reg);
-                           unsigned int last = start + GET_MODE_SIZE (GET_MODE
(reg));
+                           unsigned int last = start 
+                             + GET_MODE_SIZE (GET_MODE (reg));

-                           ra_init_live_subregs (bitmap_bit_p
(live_relevant_regs, regno), 
-                                                 live_subregs,
live_subregs_used,
+                           ra_init_live_subregs (bitmap_bit_p
(live_relevant_regs, 
+                                                               regno), 
+                                                 live_subregs, 
+                                                 live_subregs_used,
                                                  regno, reg);

                            /* Ignore the paradoxical bits.  */
@@ -1579,13 +1594,13 @@ build_insn_chain (void)
       /* FIXME!! The following code is a disaster.  Reload needs to see the
         labels and jump tables that are just hanging out in between
         the basic blocks.  See pr33676.  */
-
       insn = BB_HEAD (bb);
-
+      
       /* Skip over the barriers and cruft.  */
-      while (insn && (BARRIER_P (insn) || NOTE_P (insn) || BLOCK_FOR_INSN
(insn) == bb))
+      while (insn && (BARRIER_P (insn) || NOTE_P (insn) 
+                     || BLOCK_FOR_INSN (insn) == bb))
        insn = PREV_INSN (insn);
-       
+      
       /* While we add anything except barriers and notes, the focus is
         to get the labels and jump tables into the
         reload_insn_chain.  */
@@ -1595,24 +1610,24 @@ build_insn_chain (void)
            {
              if (BLOCK_FOR_INSN (insn))
                break;
-
+             
              c = new_insn_chain ();
              c->next = next;
              next = c;
              *p = c;
              p = &c->prev;

-             c->insn = insn;
              /* The block makes no sense here, but it is what the old
                 code did.  */
              c->block = bb->index;
+             c->insn = insn;
              bitmap_copy (&c->live_throughout, live_relevant_regs);
            }     
          insn = PREV_INSN (insn);
        }
     }

-  for (i = 0; i < (unsigned int)max_regno; i++)
+  for (i = 0; i < (unsigned int) max_regno; i++)
     if (live_subregs[i])
       free (live_subregs[i]);



-- 


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


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

* [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer
  2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
                   ` (24 preceding siblings ...)
  2007-10-12 14:38 ` zadeck at naturalbridge dot com
@ 2007-10-12 15:40 ` gerald at pfeifer dot com
  25 siblings, 0 replies; 27+ messages in thread
From: gerald at pfeifer dot com @ 2007-10-12 15:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #25 from gerald at pfeifer dot com  2007-10-12 15:40 -------
Confirming as fixed on i386-unknown-freebsd54, the originally failing
platform.


-- 

gerald at pfeifer dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED


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


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

end of thread, other threads:[~2007-10-12 15:40 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-06 11:47 [Bug bootstrap/33676] New: selected_int_kind.f90:22: gerald at pfeifer dot com
2007-10-06 18:59 ` [Bug bootstrap/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault kargl at gcc dot gnu dot org
2007-10-07  3:20 ` kargl at gcc dot gnu dot org
2007-10-07 16:39 ` kargl at gcc dot gnu dot org
2007-10-09 14:25 ` fxcoudert at gcc dot gnu dot org
2007-10-09 16:14 ` giovannibajo at libero dot it
2007-10-09 16:15 ` giovannibajo at libero dot it
2007-10-09 17:06 ` hjl at lucon dot org
2007-10-09 18:43 ` belyshev at depni dot sinp dot msu dot ru
2007-10-09 18:47 ` hjl at lucon dot org
2007-10-10  6:09 ` [Bug rtl-optimization/33676] libgfortran bootstrap failure: selected_int_kind.f90:22: Segmentation fault, wrong code with -fomit-frame-pointer belyshev at depni dot sinp dot msu dot ru
2007-10-10  7:59 ` ubizjak at gmail dot com
2007-10-10 11:41 ` zadeck at naturalbridge dot com
2007-10-10 12:43 ` zadeck at naturalbridge dot com
2007-10-11 11:15 ` ebotcazou at gcc dot gnu dot org
2007-10-11 11:43 ` zadeck at naturalbridge dot com
2007-10-11 12:24 ` ebotcazou at gcc dot gnu dot org
2007-10-11 12:40 ` zadeck at naturalbridge dot com
2007-10-11 16:22 ` zadeck at naturalbridge dot com
2007-10-11 19:53 ` belyshev at depni dot sinp dot msu dot ru
2007-10-11 22:32 ` zadeck at gcc dot gnu dot org
2007-10-11 22:35 ` zadeck at naturalbridge dot com
2007-10-12  4:07 ` kargl at gcc dot gnu dot org
2007-10-12 11:59 ` zadeck at naturalbridge dot com
2007-10-12 12:56 ` ebotcazou at libertysurf dot fr
2007-10-12 14:38 ` zadeck at naturalbridge dot com
2007-10-12 15:40 ` gerald at pfeifer dot com

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).