This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] Radically simplify emission of balanced tree for switch statements.
- From: Martin Liška <mliska at suse dot cz>
- To: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>, gcc-patches at gcc dot gnu dot org, Richard Biener <richard dot guenther at gmail dot com>, Jeff Law <law at redhat dot com>
- Date: Mon, 21 May 2018 15:53:49 +0200
- Subject: Re: [PATCH][RFC] Radically simplify emission of balanced tree for switch statements.
- References: <4a6e1c28-6a18-0084-e602-57a0c259d676@suse.cz> <c0fc51df-4794-be1e-e139-578464623e57@redhat.com> <a385e3cb-4a33-55ea-5c3b-1d159a040cf0@suse.cz> <a6cb6f37-da62-5a8f-252a-e23adaab9757@redhat.com> <61dae28e-d66c-c9e0-5c6b-cb5729c5ce64@suse.cz> <9bf4bd49-2587-e6d9-dab3-64c86d936890@redhat.com> <CAFiYyc1vvmNxo0y=-y4eLg6Sz3rwzYsFaB85g2N8rt16iwgRMA@mail.gmail.com> <0a8e5ff4-9a1f-54d4-9a90-a0e27eb4c226@suse.cz> <FC7BE586-4336-48E9-8C2D-1807AD7F0014@gmail.com> <85598323-bc2a-ff4b-67cd-d02b37a4a814@suse.cz> <yddefi9ax1g.fsf@CeBiTec.Uni-Bielefeld.DE> <1b647b3f-bcb1-8ee3-20a6-f97ca261cd8b@suse.cz> <yddbmd92r5k.fsf@CeBiTec.Uni-Bielefeld.DE>
On 05/21/2018 01:18 PM, Rainer Orth wrote:
> Hi Martin,
>
>> On 05/18/2018 03:55 PM, Rainer Orth wrote:
>>> Hi Martin,
>>>
>>>> So the patch looks fine, only very very slightly binary is produced. I'm
>>>> going to install the patch so that
>>>> I can carry on more complex patches based on this one.
>>>
>>> it seems you didn't properly test the testsuite part: I see
>>>
>>> +UNRESOLVED: gcc.dg/tree-prof/update-loopch.c scan-tree-dump switchlower
>>> "Removing basic block"
>>> +UNRESOLVED: gcc.dg/tree-prof/update-loopch.c scan-tree-dump switchlower
>>> "loop depth 1, count 33333"
>>> +UNRESOLVED: gcc.dg/tree-prof/update-loopch.c scan-tree-dump-not
>>> switchlower "Invalid sum"
>>> +UNRESOLVED: gcc.dg/tree-prof/update-loopch.c scan-tree-dump-not
>>> switchlower "loop depth 1, count 33332"
>>>
>>> everywhere. The log has
>>>
>>> gcc.dg/tree-prof/update-loopch.c: dump file does not exist
>>>
>>> Obviously you forgot the adapt the dg-final* files for the dumpfile
>>> name. If I do, three of the failures go away, but
>>>
>>> FAIL: gcc.dg/tree-prof/update-loopch.c scan-tree-dump switchlower1
>>> "Removing basic block"
>>>
>>> remains (on 32 and 64-bit Linux/x86_64).
>>>
>>> Please fix.
>>>
>>> Rainer
>>>
>>
>> Thanks for opened eyes, following patch will fix that.
>> It's quite obvious, I'll install it right after tests will finish.
>
> unfortunately, it didn't fix either issue:
>
> * The switchlower -> switchlower1 renames in the dg-final* lines
> (attached) are still necessary to avoid the UNRESOLVED errors.
> Although obvious, I haven't installed them since ...
>
> * ... even so
>
> FAIL: gcc.dg/tree-prof/update-loopch.c scan-tree-dump switchlower1 "Removing basic block"
>
> remains.
>
> Rainer
Hi.
You are right, it's using -O2, thus your patch is right. Please install the patch
after testing. It's obvious fix.
Martin
>
>
>> From 7ae0c7d4a81166dbf5e9dff5d35e4c9d63b1c058 Mon Sep 17 00:00:00 2001
>> From: marxin <mliska@suse.cz>
>> Date: Fri, 18 May 2018 16:17:57 +0200
>> Subject: [PATCH] Remove redundand pass pass_lower_switch.
>>
>> gcc/ChangeLog:
>>
>> 2018-05-18 Martin Liska <mliska@suse.cz>
>>
>> * passes.def: Remove a redundant pass.
>> ---
>> gcc/passes.def | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/gcc/passes.def b/gcc/passes.def
>> index 050009464ea..055d354f959 100644
>> --- a/gcc/passes.def
>> +++ b/gcc/passes.def
>> @@ -399,9 +399,8 @@ along with GCC; see the file COPYING3. If not see
>> NEXT_PASS (pass_lower_vaarg);
>> NEXT_PASS (pass_lower_vector);
>> NEXT_PASS (pass_lower_complex_O0);
>> - NEXT_PASS (pass_lower_switch_O0);
>> NEXT_PASS (pass_sancov_O0);
>> - NEXT_PASS (pass_lower_switch);
>> + NEXT_PASS (pass_lower_switch_O0);
>> NEXT_PASS (pass_asan_O0);
>> NEXT_PASS (pass_tsan_O0);
>> NEXT_PASS (pass_sanopt);
>