This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, middle_end] Fix PR middle_end/40505
- From: Ian Lance Taylor <iant at google dot com>
- To: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 07 Jul 2009 11:10:37 -0700
- Subject: Re: [PATCH, middle_end] Fix PR middle_end/40505
- References: <20090701183314.334C44FC4@hiauly1.hia.nrc.ca>
"John David Anglin" <dave@hiauly1.hia.nrc.ca> writes:
> The attached patch fixes PR middle_end/40505. The PA is a callee copies
> target. We were getting an ICE in expand_expr_addr_expr_1 in certain
> C++ code because arguments passed by reference from thunks were not
> being copied.
>
> Regression tested on hppa-unknown-linux-gnu, hppa2.0w-hp-hpux11.11 and
> hppa64-hp-hpux11.11.
>
> Ok for trunk?
This needs a test case.
The patch looks wrong to me. In order for the thunk to work correctly,
the reference to the class object itself must be passed by reference.
It would be incorrect to make a copy. It seems that your patch might in
some cases lead gcc to make a copy when it must not. Can you see a
reason why that could not happen?
How hard would it be to modify pa_asm_output_mi_thunk to handle the case
where vcall_offset is not 0? It seems that that would avoid the
problem, and be more efficient to boot.
If that is impossible, then I think this code needs to use a different
test. It would be OK to check specifically for the case of CONCAT, for
example.
Ian