Bug 9810 - ia64 REG_IP() cannot be used as a lvalue
Summary: ia64 REG_IP() cannot be used as a lvalue
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Frank Ch. Eigler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-03 19:42 UTC by William Cohen
Modified: 2009-02-03 21:54 UTC (History)
0 users

See Also:
Host: ia64
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Cohen 2009-02-03 19:42:22 UTC
The ia64 REG_IP() for the ia64 takes a couple register values to synthesize a
value for the instruction pointer in runtime/regs.h:

#define REG_IP(regs)    ((regs)->cr_iip +ia64_psr(regs)->ri)

However, the translator generates code like the following that uses REG_IP as an
lvalue for begin and end probes:


  #ifdef STP_NEED_UNWIND_DATA
  memset (& c->regs_buffer, 0, sizeof (c->regs_buffer));
  REG_IP((& c->regs_buffer)) = (unsigned long)__builtin_return_address (0);
  REG_SP((& c->regs_buffer)) = (unsigned long)& c;
  c->regs = & c->regs_buffer;
  #endif

This causes the following tests to fail on ia64:

systemtap.examples/interrupt/scf
systemtap.examples/io/io_submit
buildok/context_test.stp

The ri (restart instruction) points to which instruction in a bundle to restart
execution at. The ri field is part of the program status register (psr).
Comment 1 Frank Ch. Eigler 2009-02-03 20:31:43 UTC
I will revert this code, which is being mooted for bug #6961 anyway.
Comment 2 Frank Ch. Eigler 2009-02-03 21:25:54 UTC
see commit 22f8b40
Comment 3 William Cohen 2009-02-03 21:54:08 UTC
Tested on the ia64 machine and the change fixed the issue.