Bug 45321 - [4.6 regression] ARM bootstrap failure due to stdarg_p change
Summary: [4.6 regression] ARM bootstrap failure due to stdarg_p change
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-18 15:33 UTC by Mikael Pettersson
Modified: 2010-09-01 12:03 UTC (History)
2 users (show)

See Also:
Host: armv5tel-unknown-linux-gnueabi
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-08-19 10:40:03


Attachments
proposed fix (755 bytes, patch)
2010-08-18 15:43 UTC, Mikael Pettersson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Pettersson 2010-08-18 15:33:06 UTC
Attempting to bootstrap gcc-4.6-20100814 (r163252) on arm-linux-gnueabi fails due to a warning in stage2 and the default use of -Werror there:

/home/mikpe/gcc-4.6-20100814/gcc/config/arm/arm.c: In function 'arm_get_pcs_model':
/home/mikpe/gcc-4.6-20100814/gcc/config/arm/arm.c:3720:7: error: passing argument 1 of 'stdarg_p' discards 'const' qualifier from pointer target type [-Werror]
/home/mikpe/gcc-4.6-20100814/gcc/tree.h:4829:13: note: expected 'tree' but argument is of type 'const_tree'
cc1: all warnings being treated as errors

make[3]: *** [arm.o] Error 1
make[3]: Leaving directory `/home/mikpe/objdir46/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/home/mikpe/objdir46'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/home/mikpe/objdir46'
make: *** [bootstrap] Error 2

Presumably caused by r163033:
http://gcc.gnu.org/ml/gcc-cvs/2010-08/msg00244.html
Comment 1 Mikael Pettersson 2010-08-18 15:43:19 UTC
Created attachment 21511 [details]
proposed fix

The issue is that stdarg_p has a non-const parameter but the call site in the ARM backend has a const value it wants to pass.  The right solution seems to be to make stdarg_p accept a const parameter, but then the problem is that the parameter is stored in the iterator's fntype field.  Nothing uses that field, so removing it and then making the parameter const fixes the issue.

ARM bootstrap still fails for me with comparison failures, however.

(I'm in an email black hole at the moment so can't easily submit this to gcc-patches.)
Comment 2 Ramana Radhakrishnan 2010-09-01 11:53:07 UTC
Subject: Bug 45321

Author: ramana
Date: Wed Sep  1 11:52:55 2010
New Revision: 163726

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163726
Log:
2010-09-01  Mikael Pettersson  <mikpe@it.uu.se>

       PR bootstrap/45321
       * tree.c (stdarg_p): Make fntype parameter const.
       * tree.h (stdarg_p): Likewise.
       (function_args_iterator): Remove unused fntype field.
       (function_args_iter_init): Do not initialize fntype
       field.  Make fntype parameter const. 

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree.c
    trunk/gcc/tree.h

Comment 3 Ramana Radhakrishnan 2010-09-01 12:03:39 UTC
Fixed.