[Bug gdb/24090] New: Incorrect value of zmm register

krizha at mail dot ru sourceware-bugzilla@sourceware.org
Sat Jan 12 19:04:00 GMT 2019


https://sourceware.org/bugzilla/show_bug.cgi?id=24090

            Bug ID: 24090
           Summary: Incorrect value of zmm register
           Product: gdb
           Version: 8.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: krizha at mail dot ru
  Target Milestone: ---

Created attachment 11536
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11536&action=edit
source1

GDB incorrectly shows values of upper halves(upper 32 bytes) of ZMM registers -
it always are zero.

Program consists of 2 files:
////1st file "foo.asm" :
.intel_syntax noprefix

.text

.global foo

foo:
    vmovdqu64 zmm0, zmmword ptr[ rsi ]
    vmovdqu64 zmmword ptr[ rdi ], zmm0
    ret

////2nd file "main.c" :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void foo( unsigned char* p1, const unsigned char* p2 );

int main( int argc, char** argv )
{
    unsigned char chbuf1[ 1000 ], chbuf2[ 1000 ];
    size_t len;

    memset( chbuf1, 0, sizeof( chbuf1 ) );
    for( len = 0; len < sizeof( chbuf2 ); ++len )
        chbuf2[ len ] = ( unsigned char )len;
    foo( chbuf1, chbuf2 );
    return 0;
}

////
build this program:
$ as -g foo.asm -o foo.o
$ gcc -g main.c -c -std=c89 -o main.o
$ gcc -g -o main main.o foo.o

////
debug it with GDB:
$ gdb main

(gdb) b foo.asm:9
Breakpoint 1 at 0x762: file foo.asm, line 9.

(gdb) r
Starting program: /home/serg/.../main 

Breakpoint 1, foo () at foo.asm:9
9           vmovdqu64 zmmword ptr[ rsi ], zmm0

(gdb) info registers zmm0
zmm0           {v16_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_double = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0}, v64_int8 = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb,
0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x0 <repeats 32 times>}, v32_int16 =
{0x100, 0x302, 0x504, 0x706, 0x908, 0xb0a, 0xd0c, 0xf0e, 0x1110, 0x1312,
0x1514, 0x1716, 0x1918, 0x1b1a, 0x1d1c, 0x1f1e, 0x0 <repeats 16 times>},
v16_int32 = {0x3020100, 0x7060504, 0xb0a0908, 0xf0e0d0c, 0x13121110,
0x17161514, 0x1b1a1918, 0x1f1e1d1c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
v8_int64 = {0x706050403020100, 0xf0e0d0c0b0a0908, 0x1716151413121110,
0x1f1e1d1c1b1a1918, 0x0, 0x0, 0x0, 0x0}, v4_int128 =
{0xf0e0d0c0b0a09080706050403020100, 0x1f1e1d1c1b1a19181716151413121110, 0x0,
0x0}}

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list