This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR middle-end/20739] lvalue cond-expr gimplification maycrash on cv-qual diffs
- From: Jeffrey A Law <law at redhat dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 04 Apr 2005 11:28:55 -0600
- Subject: Re: [PR middle-end/20739] lvalue cond-expr gimplification maycrash on cv-qual diffs
- Organization: Red Hat, Inc
- References: <orekdqlqcz.fsf@livre.redhat.lsd.ic.unicamp.br>
- Reply-to: law at redhat dot com
On Mon, 2005-04-04 at 08:43 -0300, Alexandre Oliva wrote:
> If the operands of a cond-expr used as an lvalue differ in cv
> qualification, the front-end adds nop_exprs to add cv qualifiers that
> the gimplifier drops when simplifying &(T const)*v. The `&' was added
> by gimplify_cond_expr.
>
> The problem is that gimplify_addr_expr gimplifies its operand in such
> a way that the nop_expr is dropped, and nothing puts it back in, so
> when we test that, in the indirect_ref case in gimplify_addr_expr, the
> types are compatible, the test fails because of the missing
> cv-qualifier in the pointed-to type. This patch fixes this.
>
> Ok to install if bootstrap and regtest on amd64-linux-gnu pass?
I don't know about others, but I'd really prefer to see patches _after_
they have passed bootstrap and regression testing. Please repost when
testing has completed.
jeff