Bug 376729

Summary: PPC64, remove R2 from the clobber list
Product: [Developer tools] valgrind Reporter: Carl Love <cel>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: will_schmidt
Priority: NOR    
Version: 3.12 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: On ppc64*, the TOC ptr should not be considered a scratch register

Description Carl Love 2017-02-20 18:51:38 UTC
Mark Wielaard reported the following issue

"GCC now diagnoses inline assembly that clobbers register r2. This has always been invalid code, and is no longer quietly tolerated."

in redhat bug:  https://bugzilla.redhat.com/show_bug.cgi?id=1424367
Comment 1 Carl Love 2017-02-20 18:56:21 UTC
Created attachment 104133 [details]
On ppc64*, the TOC ptr should not be considered a scratch register

Will Schmidt created the attached patch to address the issue.  His fix description is as follows:


"On ppc64*, the TOC ptr should not be considered a scratch
register, and should not be in the clobber list.
This is called out in newer GCC (i.e. gcc7) and triggers an error.

Thusly, remove R2 from the clobber list."
Comment 2 Carl Love 2017-02-20 19:00:03 UTC
Mark Wielaard tested the patch, as reported on the RH bugzilla:

That patch fixes things. All arches build now.
Comment 3 Carl Love 2017-02-20 19:05:51 UTC
I tested and applied Will's patch to Valgrind mainline

valgrind commit 16254.
Comment 4 Julian Seward 2017-03-06 14:11:43 UTC
*** Bug 371668 has been marked as a duplicate of this bug. ***