Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-939

[aCC 3.63/HP-UX 11.11] SEGV when comparing pointers.



    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • External
    • None
    • HP-UX B.11.11 U
      aCC: HP ANSI C++ B3910B A.03.63

    • Incorrect Behavior


      $ cat t.cpp; aCC -g t.cpp; ./a.out
      typedef void user_proc_t (int);
      user_proc_t* const _sentinel_proc = (user_proc_t*)-2;
      void my_user_proc (int)
      int main ()
          return my_user_proc != _sentinel_proc;
      Segmentation fault (core dumped)
      [vitek@jenga tests]$ gdb a.out
      HP gdb 5.0 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00
      and target hppa1.1-hp-hpux11.00.
      Copyright 1986 - 2001 Free Software Foundation, Inc.
      Hewlett-Packard Wildebeest 5.0 (based on GDB) is covered by the
      GNU General Public License. Type "show copying" to see the conditions to
      change it and/or distribute copies. Type "show warranty" for warranty/support.
      (gdb) run
      Starting program: /build/vitek/4.2.2/12s/tests/a.out 
      Program received signal SIGSEGV, Segmentation fault
        si_code: 0 - SEGV_UNKNOWN - Unknown Error.
      0x2dac in main () at t.cpp:11
      11          return my_user_proc != _sentinel_proc;
      (gdb) where
      #0  0x2dac in main () at t.cpp:11
      (gdb) disassemble
      Dump of assembler code for function main:
      ;;; File: t.cpp
      ;;;  10 {
      0x2d54 <main>:  nop
      0x2d58 <main+0x4>:      stw %rp,-0x14(%sp)
      0x2d5c <main+0x8>:      ldo 0x40(%sp),%sp
      0x2d60 <main+0xc>:      call 0x2d44 <_main>
      0x2d64 <main+0x10>:     nop
      ;;;  11     return my_user_proc != _sentinel_proc;
      0x2d68 <main+0x14>:     addil L'-0x800,%dp,%r1
      0x2d6c <main+0x18>:     ldw 0x700(%r1),%r31
      0x2d70 <main+0x1c>:     addil L'-0x800,%dp,%r1
      0x2d74 <main+0x20>:     ldw 0x768(%r1),%r19
      0x2d78 <main+0x24>:     copy %r31,%r20
      0x2d7c <main+0x28>:     extrw,u %r31,31,2,%r21
      0x2d80 <main+0x2c>:     cmpib,<>,n 2,%r21,0x2d94 <main+0x40>
      0x2d84 <main+0x30>:     ldi 0x1000,%r22
      0x2d88 <main+0x34>:     cmpb,<<,n %r31,%r22,0x2d94 <main+0x40>
      0x2d8c <main+0x38>:     depw %r0,31,2,%r20
      0x2d90 <main+0x3c>:     ldw 0(%r20),%r20
      0x2d94 <main+0x40>:     copy %r19,%r1
      0x2d98 <main+0x44>:     extrw,u %r19,31,2,%r31
      0x2d9c <main+0x48>:     cmpib,<>,n 2,%r31,0x2db0 <main+0x5c>
      0x2da0 <main+0x4c>:     ldi 0x1000,%r21
      0x2da4 <main+0x50>:     cmpb,<<,n %r19,%r21,0x2db0 <main+0x5c>
      0x2da8 <main+0x54>:     depw %r0,31,2,%r1
      0x2dac <main+0x58>:     ldw 0(%r1),%r1
      0x2db0 <main+0x5c>:     cmpclr,= %r20,%r1,%r22
      0x2db4 <main+0x60>:     ldi 1,%r22
      0x2db8 <main+0x64>:     depw,z %r22,31,1,%ret0
      ;;;  12 }
      0x2dbc <main+0x68>:     copy %ret0,%ret0
      0x2dc0 <main+0x6c>:     ldw -0x54(%sp),%rp
      0x2dc4 <main+0x70>:     ret 
      0x2dc8 <main+0x74>:     ldo -0x40(%sp),%sp
      End of assembler dump.

      I've checked and I get the same failure with aCC 3.73 also, but not with aCC 6.16




            Unassigned Unassigned
            vitek Travis Vitek
            0 Vote for this issue
            0 Start watching this issue