Bug 17735 - [4.0 Regression] make stops with "initializer for integer value is too complicated" while building an avr-cross compiler
Summary: [4.0 Regression] make stops with "initializer for integer value is too compli...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build, patch, rejects-valid
Depends on:
Blocks:
 
Reported: 2004-09-29 18:46 UTC by berndtrog
Modified: 2004-11-19 13:13 UTC (History)
4 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: avr
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-11-17 00:54:25


Attachments
libgcc2.i (1.57 KB, text/plain)
2004-09-30 17:53 UTC, berndtrog
Details

Note You need to log in before you can comment on or make changes to this bug.
Description berndtrog 2004-09-29 18:46:52 UTC
$ /src/gcc/configure --target=avr --enable-languages=c --disable-nls
--with-as=/usr/local/bin/avr-as --with-ld=/usr/local/bin/avr-ld 
[..]
$ make
[..]
/src/obj/gcc/xgcc -B/src/obj/gcc/ -B/usr/local/avr/bin/ -B/usr/local/avr/lib/
-isystem /usr/local/avr/include -isystem /usr/local/avr/sys-include -O2 
-DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include  -DDF=SF
-Dinhibit_libc -mcall-prologues -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
-Dinhibit_libc -I. -I -I/src/gcc/gcc -I/src/gcc/gcc/ -I/src/gcc/gcc/../include
-I/src/gcc/gcc/../libcpp/include  -DL__main -c /src/gcc/gcc/libgcc2.c -o
libgcc/./__main.o
/src/gcc/gcc/libgcc2.c: In function '__do_global_dtors':
/src/gcc/gcc/libgcc2.c:1576: error: initializer for integer value is too complicated
make[2]: *** [libgcc/./__main.o] Error 1
make[2]: Leaving directory `/src/obj/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory `/src/obj/gcc'
make: *** [all-gcc] Error 2
Comment 1 Andrew Pinski 2004-09-29 22:38:53 UTC
Could attach the preprocessed source?
Comment 2 Wolfgang Bangerth 2004-09-29 23:58:43 UTC
Can you also state the version number of libgcc2.c? I'd like to look 
at the actual line, the error message strikes me as rather badly 
worded... 
 
W. 
Comment 3 berndtrog 2004-09-30 17:53:53 UTC
Created attachment 7247 [details]
libgcc2.i
Comment 4 berndtrog 2004-09-30 18:00:02 UTC
> Can you also state the version number of libgcc2.c?

Its the version from gcc-HEAD (gcc version 4.0.0 20040928)
The error-text seems to come from varasm.c :-/
Comment 5 Wolfgang Bangerth 2004-09-30 18:50:43 UTC
I can't reproduce this error message on x86 linux with your .i file 
and a CVS snapshot of an hour ago :-( 
 
W. 
Comment 6 Andrew Pinski 2004-09-30 18:54:57 UTC
Confirmed:

The problem comes from:
2011      /* Avoid GAS bugs for values > word size.  */
2012      if (size > UNITS_PER_WORD)
2013        return false;

Caused by:
2004-09-21  Paul Brook  <paul@codesourcery.com>
        
        * varasm.c (default_assemble_integer): Return false for values wider
        than the target word size.  Works around GAS bug.


Reduced testcase:
typedef void (*func_ptr) (void);
extern func_ptr __DTOR_LIST__[];
func_ptr *p = __DTOR_LIST__ + 1;
Comment 7 Bernardo Innocenti 2004-11-17 00:54:24 UTC
Still present on mainline.  Prevents bootstrap on avr. 
 
Comment 8 Paul Brook 2004-11-18 00:21:56 UTC
Patch Here. 
http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01437.html 
Comment 9 Bernardo Innocenti 2004-11-18 18:41:10 UTC
Works for me, thanks!
Patch still waiting for review in gcc-patches.
Comment 10 GCC Commits 2004-11-19 13:12:56 UTC
Subject: Bug 17735

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pbrook@gcc.gnu.org	2004-11-19 13:12:45

Modified files:
	gcc            : ChangeLog varasm.c 

Log message:
	PR target/17735
	* varasm.c (default_assemble_integer): Allow pointer-sized values.
	Expand comment.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6413&r2=2.6414
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&r1=1.460&r2=1.461

Comment 11 Paul Brook 2004-11-19 13:13:59 UTC
Fixed.