[PATCH] Convert character arrays to string csts

Richard Biener richard.guenther@gmail.com
Mon Aug 14 13:07:00 GMT 2017


On Mon, Aug 14, 2017 at 1:25 PM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Mon, Aug 14, 2017 at 1:23 PM, Richard Biener
> <richard.guenther@gmail.com> wrote:
>> On Wed, Aug 9, 2017 at 1:39 PM, Martin Liška <mliska@suse.cz> wrote:
>>> On 08/09/2017 11:43 AM, Richard Biener wrote:
>>>> I only have the patch I sent you so I can't re-diff.
>>>>
>>>> Richard.
>>>
>>> Hi.
>>>
>>> I'm sending rebased version of the patch. However the patch
>>> eats all my memory when e.g. building ../../../libgcc/libgcov-merge.c.
>>> If you have time, please try to make it working for &STRING_CST. I can continue
>>> then.
>>
>> Note I didn't send the patch to make you use it -- it changes too much and I
>> never fixed all the fall out.  It was meant as an exercise on how to
>> use a CONST_DECL.
>
> Btw. the
>
> @@ -732,7 +730,7 @@ is_gimple_reg (tree t)
>    if (virtual_operand_p (t))
>      return false;
>
> -  if (TREE_CODE (t) == SSA_NAME)
> +  if (TREE_CODE (t) == SSA_NAME || TREE_CODE (t) == CONST_DECL)
>      return true;
>
>    if (!is_gimple_variable (t))
>
> hunk looks wrong.

Oh, and the gimplifier.c hunk was misapplied - the gimplification to CONST_DECL
is supposed to only happen for STRING_CSTs, not arbitrary constants.

Updated patch attached.

Richard.

>
> Richard.
>
>> Richard.
>>
>>> Thanks,
>>> Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-pr50199
Type: application/octet-stream
Size: 3605 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170814/43b8739c/attachment.obj>


More information about the Gcc-patches mailing list