This is the mail archive of the gcc-bugs@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]

[Bug bootstrap/50146] New: [4.7 regression] unused variable saved_nregs in ira-color.c broke arm-linux-gnueabi bootstrap


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

             Bug #: 50146
           Summary: [4.7 regression] unused variable saved_nregs in
                    ira-color.c broke arm-linux-gnueabi bootstrap
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mikpe@it.uu.se


gcc-4.7-20110820 fails to bootstrap on arm-linux-gnueabi with:

/mnt/scratch/objdir47/./prev-gcc/xgcc -B/mnt/scratch/objdir47/./prev-gcc/
-B/mnt/scratch/install47/armv5tel-brewer-linux-gnueabi/bin/
-B/mnt/scratch/install47/armv5tel-brewer-linux-gnueabi/bin/
-B/mnt/scratch/install47/armv5tel-brewer-linux-gnueabi/lib/ -isystem
/mnt/scratch/install47/armv5tel-brewer-linux-gnueabi/include -isystem
/mnt/scratch/install47/armv5tel-brewer-linux-gnueabi/sys-include    -c   -g -O2
-gtoggle -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition
-Wc++-compat   -DHAVE_CONFIG_H -I. -I. -I/mnt/scratch/gcc-4.7-20110820/gcc
-I/mnt/scratch/gcc-4.7-20110820/gcc/.
-I/mnt/scratch/gcc-4.7-20110820/gcc/../include
-I/mnt/scratch/gcc-4.7-20110820/gcc/../libcpp/include
-I/home/mikpe/pkgs/linux-armv5l/gmp-4.3.2/include
-I/home/mikpe/pkgs/linux-armv5l/mpfr-2.4.2/include
-I/home/mikpe/pkgs/linux-armv5l/mpc-0.8.2/include 
-I/mnt/scratch/gcc-4.7-20110820/gcc/../libdecnumber
-I/mnt/scratch/gcc-4.7-20110820/gcc/../libdecnumber/dpd -I../libdecnumber   
/mnt/scratch/gcc-4.7-20110820/gcc/ira-color.c -o ira-color.o
/mnt/scratch/gcc-4.7-20110820/gcc/ira-color.c: In function 'assign_hard_reg':
/mnt/scratch/gcc-4.7-20110820/gcc/ira-color.c:1570:54: error: unused variable
'saved_nregs' [-Werror=unused-variable]
cc1: all warnings being treated as errors

make[3]: *** [ira-color.o] Error 1
make[3]: Leaving directory `/mnt/scratch/objdir47/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/mnt/scratch/objdir47'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/mnt/scratch/objdir47'
make: *** [bootstrap] Error 2

The previous weekly snapshot, gcc-4.7-20110813, bootstrapped fine.

The issue is that saved_nregs is declared unconditionally but used #ifndef
HONOR_REG_ALLOC_ORDER.  The ARM backend does define HONOR_REG_ALLOC_ORDER, so
the warning is expected.

I'm testing the following fix:

--- gcc-4.7-20110820/gcc/ira-color.c.~1~        2011-08-18 16:56:36.000000000
+0200
+++ gcc-4.7-20110820/gcc/ira-color.c    2011-08-21 19:11:00.000000000 +0200
@@ -1567,13 +1567,14 @@ static bool
 assign_hard_reg (ira_allocno_t a, bool retry_p)
 {
   HARD_REG_SET conflicting_regs[2], profitable_hard_regs[2];
-  int i, j, hard_regno, best_hard_regno, class_size, saved_nregs;
+  int i, j, hard_regno, best_hard_regno, class_size;
   int cost, mem_cost, min_cost, full_cost, min_full_cost, nwords, word;
   int *a_costs;
   enum reg_class aclass;
   enum machine_mode mode;
   static int costs[FIRST_PSEUDO_REGISTER], full_costs[FIRST_PSEUDO_REGISTER];
 #ifndef HONOR_REG_ALLOC_ORDER
+  int saved_nregs;
   enum reg_class rclass;
   int add_cost;
 #endif


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