This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH to global.c [3.3] (was Re: Gabriel Dos Reis will be RM for the 3.2.2 release)


Benjamin Kosnik <bkoz@redhat.com> writes:

| >    o I would like to make a pre-release tarball on 2003-01-29.
| > 
| >    o We will have one week testing, i.e. from 2003-01-29 til 2003-02-04.
| > 
| >    o If no critical regression shows up, then we can do a release on
| >       2003-02-05.
| 
| Dude, this sounds like a fine plan. 
| 
| Because you are now RM, you get to apply patches as you see fit. 
| 
| This patch seems obvious:
| http://gcc.gnu.org/ml/gcc/2003-01/msg00689.html

I applied that patch to 3_2-branch in the form appended below
(testcase added).

The versions of global.c on 3_3-branch and mainline appear to be
different from that on 3_2-branch so I didn't apply the patch there.
I guess someone would have to rework the patch for those branches.

Boostrapped and tested on an i686-pc-linux-gnu.

-- Gaby

2003-01-25  Jan Hubicka  <jh@suse.cz>

	PR fortran/9258
        * global.c (struct allocno): Add no_stack_reg. 
        (global_conflicts): Set no_stack_reg.
        (find_reg): Use it.
	
Index: global.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/global.c,v
retrieving revision 1.77
diff -p -r1.77 global.c
*** global.c	12 Jan 2002 01:43:51 -0000	1.77
--- global.c	25 Jan 2003 14:41:15 -0000
*************** struct allocno
*** 130,135 ****
--- 130,140 ----
    /* Set of hard registers that some later allocno has a preference for.  */
  
    HARD_REG_SET regs_someone_prefers;
+ 
+ #ifdef STACK_REGS
+   /* Set to true if allocno can't be allocated in the stack register.  */
+   bool no_stack_reg;
+ #endif
  };
  
  static struct allocno *allocno;
*************** global_conflicts ()
*** 717,724 ****
  	    if (e->flags & EDGE_ABNORMAL)
  	      break;
  	  if (e != NULL)
! 	    for (ax = FIRST_STACK_REG; ax <= LAST_STACK_REG; ax++)
! 	      record_one_conflict (ax);
  	}
  #endif
        }
--- 722,735 ----
  	    if (e->flags & EDGE_ABNORMAL)
  	      break;
  	  if (e != NULL)
!             {
!               EXECUTE_IF_SET_IN_ALLOCNO_SET (allocnos_live, ax,
!                 {
!                   allocno[ax].no_stack_reg = 1;
!                 });
!               for (ax = FIRST_STACK_REG; ax <= LAST_STACK_REG; ax++)
!                 record_one_conflict (ax);
!             }
  	}
  #endif
        }
*************** find_reg (num, losers, alt_regs_p, accep
*** 1216,1221 ****
--- 1227,1236 ----
  		    && (TEST_HARD_REG_BIT
  			(reg_class_contents[(int) CLASS_CANNOT_CHANGE_MODE],
  			 regno)))
+ #endif
+ #ifdef STACK_REGS
+               && (!allocno[num].no_stack_reg
+                   || regno < FIRST_STACK_REG || regno > LAST_STACK_REG)
  #endif
  	      )
  	    {
Index: testsuite/g77.dg/pr9258.f
===================================================================
RCS file: testsuite/g77.dg/pr9258.f
diff -N testsuite/g77.dg/pr9258.f
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/g77.dg/pr9258.f	25 Jan 2003 14:41:19 -0000
***************
*** 0 ****
--- 1,18 ----
+ C Test case for PR fortran/9258
+ C Origin: kmccarty@Princeton.EDU
+ C
+ C { dg-do compile }
+       SUBROUTINE FOO (B)
+ 
+  10   CALL BAR(A)
+       ASSIGN 20 TO M
+       IF(100.LT.A) GOTO 10
+       GOTO 40
+ C
+  20   IF(B.LT.ABS(A)) GOTO 10
+       ASSIGN 30 TO M
+       GOTO 40
+ C
+  30   ASSIGN 10 TO M
+  40   GOTO M,(10,20,30)
+       END


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]