This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix nrv-1.c false failure on aarch64.
- From: Jeff Law <law at redhat dot com>
- To: Egeyar Bagcioglu <egeyar dot bagcioglu at oracle dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 26 Oct 2017 09:03:21 -0600
- Subject: Re: [PATCH] Fix nrv-1.c false failure on aarch64.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=law at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4DB67C0587CD
- References: <583990e4-7340-f9ac-686d-ccc5b4fb7a7d@oracle.com>
On 10/18/2017 10:59 AM, Egeyar Bagcioglu wrote:
> Hello,
>
> Test case "guality.exp=nrv-1.c" fails on aarch64. Optimizations reorder
> the instructions and cause the value of a variable to be checked before
> its first assignment. The following patch is moving the
> break point to the end of the function. Therefore, it ensures that the
> break point is reached after the assignment instruction is executed.
>
> Please review the patch and apply if legitimate.
This seems wrong.
If I understand the test correctly, we want to break on the line with
the assignment to a2.i[4] = 7 and verify that before that line executes
that a2.i[0] == 42.
Moving the test point to the end of the function seems to defeat the
purpose of the test. A breakpoint at the end of the function to test
state is pointless as it doesn't reflect what a user is likely to want
to do.
I'm guessing based on your description that optimization has sunk the
assignment to a2.i[0] down past the assignment to a2.i[4]? What
optimization did this and what do the dwarf records look like?
Jeff