Bug 360519

Summary: none/tests/arm64/memory.vgtest might fail with newer gcc
Product: [Developer tools] valgrind Reporter: Mark Wielaard <mark>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 3.11 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Place nops around ldr literal test instruction and adjust expected output

Description Mark Wielaard 2016-03-14 12:57:43 UTC
The LDR (literal, int reg) testcase take a code label and compare the instructions around the label with known instructions in the code stream. The comment says:

// This is a bit tricky.  We load the value from just before and
// just after the actual instruction.  Because TESTINSN2_hide2 
// generates two fixed insns either side of the test insn, these 
// should be constant and hence "safe" to check.

However two fixed insns on either side of the checking instruction isn't enough given that offsets of +/-8 are used, instructions are only 4 wide and the values loaded are 64bit.

Newer gcc versions would generate different code around the label and cause the tests to fail,

The proposed solution is to add enough nops around the actual instruction to really give known expected constant values to check against.

Reproducible: Always
Comment 1 Mark Wielaard 2016-03-14 12:58:53 UTC
Created attachment 97892 [details]
Place nops around ldr literal test instruction and adjust expected output
Comment 2 Julian Seward 2016-03-15 13:34:38 UTC
(In reply to Mark Wielaard from comment #1)
> Place nops around ldr literal test instruction and adjust expected output

Looks good to me!
Comment 3 Mark Wielaard 2016-03-15 13:57:04 UTC
valgrind svn r15829