target/3920: wrong register number for CTR in stabs

mattias@virtutech.se mattias@virtutech.se
Fri Aug 3 04:46:00 GMT 2001


>Number:         3920
>Category:       target
>Synopsis:       wrong register number for CTR in stabs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 03 04:46:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     mattias@virtutech.se
>Release:        gcc version 3.0.1 20010729 (prerelease) (powerpc-unknown-linux-gnu)
>Organization:
>Environment:
gnu/linux for PowerPC (Yellow Dog 1.2.1)
>Description:
When a variable is placed in the CTR register, the RSYM
stab emitted contains the wrong register number.
In gcc 3.0.1 it emits RSYM with an integer register
(r3, in this case); in the distribution-supplied
gcc 2.95.2 19991024 (release/franzo), the bogus register
number 66 is emitted.

66 is gcc's internal number for CTR, but gdb expects it to
be 68 (and, to add to the confusion, the SVR ABI claims the
DWARF number for CTR is 109 --- which should be relevant
as gcc seems to use the same numbering for stabs and DWARF).

Other oddball registers like LR and CR also have different
numbers in gcc, gdb and DWARF.
DBX_REGISTER_NUMBER is defined as the identity function
in rs6000.h and that is perhaps incorrect.
>How-To-Repeat:
Compile the following with -O2 -g, and look at the stabs:

int sum(int n)
{
	int i, s = 0;
	for(i = n; i != 0; i--)
		s += i;
	return s;
}
>Fix:

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



More information about the Gcc-prs mailing list