optimization/10076: Use of function call return value
Gábor Lóki
alga@rgai.hu
Mon Mar 17 13:56:00 GMT 2003
The following reply was made to PR optimization/10076; it has been noted by GNATS.
From: =?ISO-8859-2?Q?G=E1bor_L=F3ki?= <alga@rgai.hu>
To: rth@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: optimization/10076: Use of function call return value
Date: Mon, 17 Mar 2003 14:54:05 +0100
rth@gcc.gnu.org wrote:
>Synopsis: Use of function call return value
>
>State-Changed-From-To: open->closed
>State-Changed-By: rth
>State-Changed-When: Sun Mar 16 09:29:48 2003
>State-Changed-Why:
> Not really a bug. You failed to return a value from foo1.
> Fix that, as you did in foo2, and everything clears up.
>
>http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10076
>
>
>
>
Ok, the source code was not correct, but the problem still remains.
It doesn't matter if a retrun is put at the end of foo1 or not, gcc
produces the same problem.
( I subbmited a new PR:
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10122
)
In example_1 there is an unnecessary "mov r2,r0" as I descibed
in PR.
There is only one problem with this example. An opimization
algorithm changed the
order of instructions. So the unnecessary "mov r0,#35" is placed
earlier than
"str r2,[r3,#0]" (because of unnecessary "mov r2,r0", where r0
is dead).
In example_2 there is another unnecessary "mov r3,r0". I don't
know the reason of this.
I hope these examples will help what the problem is!
Regards,
Gábor Lóki
More information about the Gcc-prs
mailing list