target/9893: HP PA-RISC "bl" offsets out of range in large modules

brad.daniels@netiq.com brad.daniels@netiq.com
Fri Feb 28 21:56:00 GMT 2003


>Number:         9893
>Category:       target
>Synopsis:       HP PA-RISC "bl" offsets out of range in large modules
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 28 21:56:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Brad Daniels
>Release:        3.2.1
>Organization:
>Environment:
hppa2.0w-hp-hpux11.00
g++ -dumpspecs
*asm:
--traditional-format 

*asm_debug:


*asm_final:


*asm_options:
%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}

*invoke_as:
%{!S:-o %{|!pipe:%g.s} |
 as %(asm_options) %{!pipe:%g.s} %A }

*cpp:
%{mpa-risc-1-0:%(cpp_pa10)} %{mpa-risc-1-1:%(cpp_pa11)} %{msnake:%(cpp_pa11)} %{mpa-risc-2-0:%(cpp_pa20)} %{!mpa-risc-1-0:%{!mpa-risc-1-1:%{!mpa-risc-2-0:%{!msnake:%(cpp_cpu_default)}}}} %{m64bit:%(cpp_64bit)} %{!m64bit:%(cpp_64bit_default)} %{!ansi: -D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_EXT__ -D_INCLUDE_LONGLONG} %{threads: -D_REENTRANT -D_DCE_THREADS}

*cpp_options:
%(cpp_unique_options) %{std*} %{d*} %{W*} %{w} %{pedantic*} %{fshow-column} %{fno-show-column} %{fsigned-char&funsigned-char} %{fleading-underscore} %{fno-leading-underscore} %{fno-operator-names} %{ftabstop=*}

*cpp_unique_options:
%{C:%{!E:%eGNU C does not support -C without using -E}} %{nostdinc*} %{C} %{v} %{I*} %{P} %{$} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3 -D__GXX_ABI_VERSION=102} %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs} %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{fno-inline|O0|!O*:-D__NO_INLINE__} %{ffast-math:-D__FAST_MATH__} %{fshort-wchar:-U__WCHAR_TYPE__ -D__WCHAR_TYPE__=short\ unsigned\ int} %{ffreestanding:-D__STDC_HOSTED__=0} %{fno-hosted:-D__STDC_HOSTED__=0} %{!ffreestanding:%{!fno-hosted:-D__STDC_HOSTED__=1}} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}

*trad_capable_cpp:
%{traditional|ftraditional|traditional-cpp:trad}cpp0

*cc1:
%{pg:} %{p:}

*cc1_options:
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{g*} %{O*} %{W*} %{w} %{pedantic*} %{std*} %{ansi} %{traditional} %{v:-version} %{pg:-p} %{p} %{f*} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*}

*cc1plus:


*link_gcc_c_sequence:
%G %L %G

*endfile:


*link:
%{!mpa-risc-1-0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }} -z %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-b}

*lib:
%{!shared:     %{!p:%{!pg:       %{!threads:-lc}       %{threads:-lcma -lc_r}}}     %{p: -L/lib/libp/ -lc}     %{pg: -L/lib/libp/ -lc}}

*libgcc:
%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M -lgcc}}%{shared:-lgcc_s%M}}}

*startfile:
%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}

*switches_need_spaces:


*predefines:
-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -Asystem=unix -Asystem=hpux -Acpu=hppa -Amachine=hppa

*cross_compile:
0

*version:
3.2.1

*multilib:
. ;

*multilib_defaults:


*multilib_extra:


*multilib_matches:


*multilib_exclusions:


*multilib_options:


*linker:
collect2

*link_libgcc:
%D

*md_exec_prefix:
/usr/ccs/bin/

*md_startfile_prefix:
/usr/ccs/lib/

*md_startfile_prefix_1:
/opt/langtools/lib/

*cpp_pa10:


*cpp_pa11:
-D_PA_RISC1_1 -D__hp9000s700

*cpp_pa20:
-D_PA_RISC2_0 -D__hp9000s800

*cpp_64bit:
-D__LP64__ -D__LONG_MAX__=9223372036854775807L

*cpp_cpu_default:
%(cpp_pa11)

*cpp_64bit_default:


*link_command:
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
>Description:
Apparently, the PA-RISC code generator always uses "bl" for invoking functions defined in the module where they're used.  I have a module with some classes with lots of members (and therefore large generated dtors and copy ctors) that cause the generated code to exceed the 19-bit offset limit of the b,l instruction.  The compiler needs to either compute the size and use b,l,r if it's too large, or provide a target-specific option to always use b,l,r for local functions.

I have an extremely large file that demonstrates the problem, if you need it, though I'd prefer not to attach it if the above description is sufficient.

Here's a typical fragment of the generated .s file:

ua_config.s:1467: Error: Field out of range [-262144..262143] (266296).

ua_config.s:
...
  1460          nop
  1461          ldw 76(%r3),%r19
  1462          ldi 26,%r20
  1463          stw %r20,36(%r3)
  1464          ldw -36(%r3),%r26
  1465          ldw -40(%r3),%r25
  1466          .CALL ARGW0=GR,ARGW1=GR
  1467          bl _ZN8UAConfig10BaseConfigC2ERKS0_,%r2
  1468          nop
  1469          ldw 76(%r3),%r19
  1470          ldw -36(%r3),%r20
  1471          ldo 204(%r20),%r21
>How-To-Repeat:
If the above is not sufficient, please e-mail me for the 1.5MB file that will allow you to reproduce the problem.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list