This is the mail archive of the gcc-bugs@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]

[Bug 10907] New: gcc violates the ia64 ABI


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10907

           Summary: gcc violates the ia64 ABI
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: major
          Priority: P2
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl@lucon.org
                CC: gcc-bugs@gcc.gnu.org

On page 5-2 in Itanium Software Conventions and Runtime Architecture
Guide, there are

...
a. On entry to a procedure, gp is guaranteed valide for that procedure.
b. At any direct procedure call, gp must be valid (for the caller). This
guarantees that an import stub (see Section 8.4.1) can access the linkage
table.
c. Any procedure call (indirect or direct) may modify gp - unless the call
is known to be local to the load module.
d. At procedure return, gp must be valid (for the returning prodecure).
This allows the compiler to optimize calls known to be local (i.e., the
exceptions to Rule 'c').

The effect of the rules is that gp must be treated as scratch register
at the point of call (i.e., it must be saved by the caller), and it must
be preserved from entry to exit.

For

extern void foo ();

void
bar (void)
{
  foo ();
}

With "gcc -S -O2 x.c", I got

	.file	"x.c"
	.pred.safe_across_calls p1-p5,p16-p63
	.text
	.align 16
	.global bar#
	.proc bar#
bar:
	.prologue
	.body
	.bbb
	nop 0
	nop 0
	br.sptk.many foo#
	;;
	break.f 0
	;;
	.endp bar#

gp is not preserved.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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