This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Prevent LTO section collision for a symbol name starting with '*'.
- From: Martin Liška <mliska at suse dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 11 Sep 2019 13:38:21 +0200
- Subject: Re: [PATCH] Prevent LTO section collision for a symbol name starting with '*'.
- References: <20190815143341.m4t76ewfi4zn3ayl@kam.mff.cuni.cz> <7c27efd6-e9dd-ac4f-ebaf-6626a226bb61@suse.cz> <1d1856dc-6e42-89ad-85ee-519b1a691afd@suse.cz> <20190823143728.favozczljnminl4d@kam.mff.cuni.cz> <bbc38fef-89ce-c433-209c-3dcd722d6ea5@suse.cz> <20190823150502.l4dnv3fxzsfhro4g@kam.mff.cuni.cz> <b00ee4a3-2246-b146-d489-09535203b557@suse.cz> <20190823223622.yq2upqnvpm574qws@kam.mff.cuni.cz> <68650f0d-1472-ba6a-0530-19ed3a011321@suse.cz> <289c7087-008d-1921-fe78-80a3e1abd986@suse.cz> <20190909143343.2tf2tc3mvnhwcqur@kam.mff.cuni.cz>
On 9/9/19 4:33 PM, Jan Hubicka wrote:
>> PING^1
>>
>> On 8/26/19 12:04 PM, Martin Liška wrote:
>>> Ok. I have a semi-working patch that has issues for inline clones.
>>> When we call cgraph_node::get_untransformed_body for an inline clone,
>>> then one needs to use clone_of->order to find proper LTO stream.
>
> This seems OK to me - when using inline clone we really look for a body
> of its master, so that seems OK.
Ok!
>>>
>>> What's more problematic is that such clone can be expanded:
>>>
>>> f/12 (f) @0x7ffff769f708
>>> Type: function definition analyzed
>>> Visibility: external public
>>> References: mumble.lto_priv.0/8 (write)
>>> Referring:
>>> Read from file: /tmp/cciAkXHp.ltrans1.o
>>> Function f/12 is inline copy in main/0
>>> Availability: local
>>> Function flags: count:1073741824 (estimated locally) local nonfreeing_fn executed_once
>>> Called by: main/0 (inlined) (1073741824 (estimated locally),1.00 per call)
>>> Calls:
>>>
>>> and lost. So we end up with an orphan and we ICE with:
>
> We do some work on removing unnecesary master clone when function is
> fully inlined and I guess in that case you lose the order info.
> One option would be to copy order into all inline clones (it does not
> have very good meaning there) or do that when reshaping the tree.
What do you mean by "reshaping the tree"?
> This is done in cgraph_node::remove at the place clone_of is
> manipulated.
The inline_clone manipulation happens in cgraph_node::find_replacement where
we manipulate the clone_of.
Martin
> This is probably bit cleaner.
>>>
>>> /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/lto/20081112_0.c: In function ‘main’:
>>> /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/lto/20081112_0.c:10:3: fatal error: /tmp/cciAkXHp.ltrans1.o: section f is missing
>>>
>>> So usage of symtab_node::order seems awkward to me :/
>>>
>>> Martin
>>>
>>