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, alpha]: Fix PR 46533. bootstrap failure


Hello!

Currently, alpha bootstrap fails with:

/home/uros/gcc-build/./prev-gcc/xgcc -B/home/uros/gcc-build/./prev-gcc/
-B/usr/local/alphaev68-unknown-linux-gnu/bin/
-B/usr/local/alphaev68-unknown-linux-gnu/bin/
-B/usr/local/alphaev68-unknown-linux-gnu/lib/ -isystem
/usr/local/alphaev68-unknown-linux-gnu/include -isystem
/usr/local/alphaev68-unknown-linux-gnu/sys-include      -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 -fno-common  -DHAVE_CONFIG_H  -o cc1plus \
          cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/decl.o cp/expr.o
cp/pt.o cp/typeck2.o cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parser.o
cp/ptree.o cp/rtti.o cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o
cp/method.o cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o
cp/optimize.o cp/mangle.o cp/cp-objcp-common.o cp/name-lookup.o
cp/cxx-pretty-print.o cp/cp-gimplify.o tree-mudflap.o attribs.o incpath.o
prefix.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o
c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o
c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o
c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o
cc1plus-checksum.o main.o tree-browser.o libbackend.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a ../libcpp/libcpp.a   ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a  -lcloog -lppl_c -lppl -lgmpxx -lmpc -lmpfr
-lgmp -rdynamic -ldl  -L../zlib -lz
libbackend.a(gimple.o): In function `gimple_types_compatible_p_1':
(.text+0xe7ac): relocation truncated to fit: BRADDR against `.text.unlikely'
libbackend.a(gimple.o): In function `gimple_types_compatible_p_1':
(.text+0xeb28): relocation truncated to fit: BRADDR against `.text.unlikely'
libbackend.a(gimple.o): In function `gimple_types_compatible_p_1':
(.text+0xeb6c): relocation truncated to fit: BRADDR against `.text.unlikely'
libbackend.a(gimple.o): In function `gimple_types_compatible_p_1':
(.text+0xeca4): relocation truncated to fit: BRADDR against `.text.unlikely'
libbackend.a(gimple.o): In function `gimple_types_compatible_p_1':
(.text+0xecf0): relocation truncated to fit: BRADDR against `.text.unlikely'
libbackend.a(gimple.o): In function `gimple_types_compatible_p_1':
(.text+0xed5c): relocation truncated to fit: BRADDR against `.text.unlikely'
libbackend.a(gimple.o): In function `gimple_types_compatible_p_1':
(.text+0xf238): relocation truncated to fit: BRADDR against `.text.unlikely'
collect2: ld returned 1 exit status

The problem is, that gcc assumes that all function, defined in the
same section can be reached by a "near" calls (direct call with 20bit
signed offset). However, various functions, otherwise in the same
section, can be emitted into hot and cold sub-sections, so direct
calls that cross sections can violate this assumption.

Attached patch removes the assumption from gcc, so "far" calls are
always emitted instead. In effect, gcc leaves the job of relaxing
calls (that obviously is not up to) to the linker. In my testing,
linker does its magic quite well and relaxes "far" calls back to
"near" call when hot and cold sections are merged.

2010-11-20  Uros Bizjak  <ubizjak@gmail.com>

	PR target/46533
	* config/alpha/predicates.md (direct_call_operand): Return false
	for !TARGET_SMALL_TEXT targets.

Patch was tested on alphaev68-pc-linux-gnu.

OK for mainline?

Uros.

Attachment: a.diff.txt
Description: Text document


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