This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap 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 translator/11091] New: vta-test.exp failure loc2c u_const declaration duplication with multiple pieces


With latest gcc (GCC) 4.4.2 20091027 (Red Hat 4.4.2-7) on Fedora 12 with i386
vta-test.exp started failing with:

$ stap -k /home/mark/src/systemtap/testsuite/systemtap.base/vta-test.stp -c
./vta-test.exe
/tmp/stap0GRdMF/stap_8812.c: In function ?function__dwarf_tvar_get_i_0?:
/tmp/stap0GRdMF/stap_8812.c:161: error: conflicting types for ?u_const?
/tmp/stap0GRdMF/stap_8812.c:157: note: previous declaration of ?u_const? was here
make[1]: *** [/tmp/stap0GRdMF/stap_8812.o] Error 1
make: *** [_module_/tmp/stap0GRdMF] Error 2
Pass 4: compilation failed.  Try again with another '--vp 0001' option.
Keeping temporary directory "/tmp/stap0GRdMF"

The problem is:

  {
    union {
      char bytes[8];
      struct {
        uint32_t p0;
        uint32_t p4;
      } pieces __attribute__ ((packed));
      uint64_t whole;
    } u_pieces;
    union {
      char bytes[4];
      uint32_t whole;
    } u_const;
    union {
      char bytes[4];
      uint32_t whole;
    } u_const;
    u_const.bytes[0] = 0x21;
    u_const.bytes[1] = 0x43;
    u_const.bytes[2] = 0x65;
    u_const.bytes[3] = 0x87;
    u_pieces.pieces.p0 = u_const.whole;
    u_const.bytes[0] = 0xef;
    u_const.bytes[1] = 0xbe;
    u_const.bytes[2] = 0xad;
    u_const.bytes[3] = 0xde;
    u_pieces.pieces.p4 = u_const.whole;
    THIS->__retvalue = u_pieces.whole;
  }

Which is generated from loc2c.c (declare_noncontig_union). Which currently only
takes into account that a loc_noncontiguous and a loc_constant could be in the
same scope:

  // Different loc types could be in the same syntactical scope, so
  // should be named differently.
  const char *uname;
  if (loc->type == loc_noncontiguous)
    uname = "u_pieces";
  else if (loc->type == loc_constant)
    uname = "u_const";

This should probably be extended to have a "count" added for the nesting level.

-- 
           Summary: vta-test.exp failure loc2c u_const declaration
                    duplication with multiple pieces
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: mjw at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11091

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


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