patches/gcc/4.0.0/130-pr20973-fix.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Sep 04 17:27:16 2009 +0200 (2009-09-04)
changeset 1512 439a6b292917
permissions -rw-r--r--
TODO: update

Add TODO list for m4, autoconf, automake and libtool.
Building our own versions would remove burden from the users
who have older versions on their distributions, and are not
ready/able/allowed to upgrade.
     1 http://gcc.gnu.org/PR20973
     2 
     3 "gcc 4 (about RC1) miscompiles khtml, in fact something in CSS, which basically 
     4 leads to all websites being misrendered.  I can't easily reduce the testcase, 
     5 but have applied the whole preprocessed source of css/cssstyleselector.ii. 
     6  
     7 It is to be compiled with g++ -O2 -fPIC -march=i586 -mtune=i686 
     8 -fno-exceptions.  A more detailed analysis will follow, as we've found out 
     9 some things already."
    10 
    11 ---
    12 
    13 Subject: Bug 20973
    14 
    15 CVSROOT:	/cvs/gcc
    16 Module name:	gcc
    17 Branch: 	gcc-4_0-branch
    18 Changes by:	matz@gcc.gnu.org	2005-04-22 17:30:21
    19 
    20 Modified files:
    21 	gcc            : ChangeLog reload.c 
    22 
    23 Log message:
    24 	PR middle-end/20973
    25 	* reload.c (push_reload, find_dummy_reload): Check for uninitialized
    26 	pseudos.
    27 
    28 Patches:
    29 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.177&r2=2.7592.2.178
    30 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reload.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.268&r2=1.268.2.1
    31 
    32 ---
    33 
    34 ===================================================================
    35 RCS file: /cvs/gcc/gcc/gcc/reload.c,v
    36 retrieving revision 1.268
    37 retrieving revision 1.268.2.1
    38 diff -u -r1.268 -r1.268.2.1
    39 --- gcc/gcc/reload.c	2005/02/24 22:06:06	1.268
    40 +++ gcc/gcc/reload.c	2005/04/22 17:30:15	1.268.2.1
    41 @@ -1520,7 +1520,7 @@
    42       But if there is no spilling in this block, that is OK.
    43       An explicitly used hard reg cannot be a spill reg.  */
    44  
    45 -  if (rld[i].reg_rtx == 0 && in != 0)
    46 +  if (rld[i].reg_rtx == 0 && in != 0 && hard_regs_live_known)
    47      {
    48        rtx note;
    49        int regno;
    50 @@ -1534,6 +1534,11 @@
    51  	    && REG_P (XEXP (note, 0))
    52  	    && (regno = REGNO (XEXP (note, 0))) < FIRST_PSEUDO_REGISTER
    53  	    && reg_mentioned_p (XEXP (note, 0), in)
    54 +	    /* Check that we don't use a hardreg for an uninitialized
    55 +	       pseudo.  See also find_dummy_reload().  */
    56 +	    && (ORIGINAL_REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER
    57 +		|| ! bitmap_bit_p (ENTRY_BLOCK_PTR->global_live_at_end,
    58 +				   ORIGINAL_REGNO (XEXP (note, 0))))
    59  	    && ! refers_to_regno_for_reload_p (regno,
    60  					       (regno
    61  						+ hard_regno_nregs[regno]
    62 @@ -1997,7 +2002,17 @@
    63  				is a subreg, and in that case, out
    64  				has a real mode.  */
    65  			     (GET_MODE (out) != VOIDmode
    66 -			      ? GET_MODE (out) : outmode)))
    67 +			      ? GET_MODE (out) : outmode))
    68 +        /* But only do all this if we can be sure, that this input
    69 +           operand doesn't correspond with an uninitialized pseudoreg.
    70 +           global can assign some hardreg to it, which is the same as
    71 +	   a different pseudo also currently live (as it can ignore the
    72 +	   conflict).  So we never must introduce writes to such hardregs,
    73 +	   as they would clobber the other live pseudo using the same.
    74 +	   See also PR20973.  */
    75 +      && (ORIGINAL_REGNO (in) < FIRST_PSEUDO_REGISTER
    76 +          || ! bitmap_bit_p (ENTRY_BLOCK_PTR->global_live_at_end,
    77 +			     ORIGINAL_REGNO (in))))
    78      {
    79        unsigned int regno = REGNO (in) + in_offset;
    80        unsigned int nwords = hard_regno_nregs[regno][inmode];