This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Fix PR middle-end/59049
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Joern Rennecke <joern dot rennecke at embecosm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 8 Nov 2013 16:50:06 +0100
- Subject: Re: RFA: Fix PR middle-end/59049
- Authentication-results: sourceware.org; auth=none
- References: <CAMqJFCqWDNTjmJ11p-LGE4vBPQ7gBSLWY3prXFNv7+QUoL_ipw at mail dot gmail dot com> <CABu31nOfNL0ysg-zCTO=txx_SYv_n5XU3M2hFB-NxsgRW2hwGg at mail dot gmail dot com> <CAMqJFCrtSXDvCZE=E2VP1xsTf7o6OdCn=KsQ9hV0LO6BO=BD+w at mail dot gmail dot com> <CABu31nP7N8=3AU-3Nwc8rGT-VePL3eHx+u_eAPoCBz+Cse1vWg at mail dot gmail dot com> <20131108154149 dot GQ27813 at tucnak dot zalov dot cz>
On Fri, Nov 8, 2013 at 4:41 PM, Jakub Jelinek wrote:
> On Fri, Nov 08, 2013 at 04:32:09PM +0100, Steven Bosscher wrote:
>> On Fri, Nov 8, 2013 at 4:18 PM, Joern Rennecke wrote:
>> > On 8 November 2013 14:45, Steven Bosscher wrote:
>> >> This is IMHO not OK without at least an explanation of why the
>> >> comparison of two const_ints is not folded. Better yet would be to fix
>> >> that underlying problem. We should not present such non-sense to the
>> >> RTL parts of the middle end.
>> >
>> > Which part would be responsible to folding the comparison at -O1 ?
>> > FWIW, as I just commented in the PR, one of the operands is an ssa_name
>> > with a known value.
>>
>> This usually is taken care of by one of the many propagation passes
>> (CCP, VRP, forwprop, DOM, even FRE/PRE). The only cases I've
>> previously encountered, where a known value ends up not being
>> propagated, is when the propagation is somehow overlooked and the
>> known value is only replaced at out-of-ssa time, i.e. TER.
>>
>> The only way to find out where the propagation should have happened,
>> is by looking at the gimple dumps.
>
> Well, most of the passes you've mentioned can be disabled with -fno-tree-*
> but still we shouldn't ICE on it, so the expander can't assume that
> it will never see something like that, only doesn't have to try too hard
> to optimize that unlikely case. Of course, it is nice to know why it hasn't
> been optimized in the particular case.
Even with the gimple opts disabled, a const-const comparison would
normally be folded by the RTL expanders.
Ciao!
Steven