This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix constant libcalls
- From: Richard Henderson <rth at redhat dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, gcc-pdo at atrey dot karlin dot mff dot cuni dot cz
- Date: Thu, 20 Dec 2001 17:30:43 -0800
- Subject: Re: Fix constant libcalls
- References: <20011108205046.B5111@atrey.karlin.mff.cuni.cz> <20011108130340.C5515@redhat.com> <20011109124338.A20827@atrey.karlin.mff.cuni.cz> <20011109101258.C6186@redhat.com> <20011111011251.C28385@atrey.karlin.mff.cuni.cz>
On Sun, Nov 11, 2001 at 01:12:51AM +0100, Jan Hubicka wrote:
> *************** initialize_argument_information (num_act
> *** 1240,1246 ****
> copy = assign_temp (type, 0, 1, 0);
>
> store_expr (args[i].tree_value, copy, 0);
> - *ecf_flags &= ~(ECF_CONST | ECF_PURE);
> + if (*ecf_flags & ECF_CONST)
> + *ecf_flags |= ECF_PURE;
> + *ecf_flags &= ~(ECF_CONST | ECF_LIBCALL_BLOCK);
The callee is allowed to clobber its arguments. This change
is ok iff we add a clobber of that memory to the function
usage, which I don't recall that we do.
> ! if ((flags & (ECF_LIBCALL_BLOCK))
Extra parens.
> {
> flags |= ECF_SP_DEPRESSED;
> - flags &= ~(ECF_PURE | ECF_CONST);
> + flags &= ~ECF_LIBCALL_BLOCK;
This doesn't look safe to me. I'd turn off all three here.
> + if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
> + flags &= ~ECF_LIBCALL_BLOCK;
> +
[...]
> if (pass
> - && (flags & (ECF_CONST | ECF_PURE))
> + && (flags & ECF_LIBCALL_BLOCK)
> && valreg != 0 && GET_CODE (valreg) != PARALLEL)
Looks to be some redundancy here?
r~