From: Richard Guenther <richard.guenther@gmail.com>
To: Kai Tietz <ktietz70@googlemail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch tree-optimization]: [2 of 3]: Boolify compares & more
Date: Wed, 20 Jul 2011 14:29:00 -0000 [thread overview]
Message-ID: <CAFiYyc3i9FAuujMUJQAeeUsMS7hooCVZqSxXPH=0nixraFDKtg@mail.gmail.com> (raw)
In-Reply-To: <CAEwic4ZyD2nU_RvDyMPyMbzzb1nb-Qqe1U7KQCqi8=6rOzq9XA@mail.gmail.com>
On Wed, Jul 20, 2011 at 3:31 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
> 2011/7/20 Richard Guenther <richard.guenther@gmail.com>:
>> On Wed, Jul 20, 2011 at 3:05 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
>>> Hello,
>>>
>>> this is the revised version of the partial pre-approved patch for preserving
>>> type-casts from/to boolean-types. It fixes additionally the regression in
>>> tree-ssa/builtin-expect-5.c testcase, which was caused by fold_builtin_expect.
>>> Additionally there was a regression in gcc.dg/pr28685-1.c, which is fixed by
>>> the change in tree-ssa-forwprop.c's function simplify_bitwise_binary. This
>>> is just temporary necessary. As soon as we are boolifying comparisons in
>>> gimplifier, the pattern-matching in tree-ssa-reassoc will match for 2
>>> branched cases
>>> again and we can remove the hunk from forward-propagation again.
>>
>> Hm, if we can't apply this pieces without regressions we shouldn't. They
>> can then wait for the boolification patch.
>>
>> Can you explain the fold_builtin_expect change? I'm lost in the maze
>> of inner/inner_arg0/arg0 renaming game. It looks as if the patch only
>> moves stuff - but that can't possibly be the case. So, what's going on
>> there?
>
> Well, the issue is here that fold_builtin_expect checks here for a
> comparison. If this comparison was created initially with a
> boolean-type, the cast to 'long' will be in tree arg0 = (long)
> CMP-with-boolean-type, as we are preserving here casts from
> boolean-types (see the fold-const change). So we need to see through
> this casts to match the compare and call cases. So I moved this "see
> through" part before first pattern-match and introduced here a
> helper-variable inner_arg0 to avoid double while-loop. The "inner"
> variable might get invalid
> ...
> if (COMPARISON_CLASS_P (inner)
> && TREE_CODE (TREE_OPERAND (inner, 1)) == INTEGER_CST)
> inner = TREE_OPERAND (inner, 0);
> ...
>
> These are those "prefixed casts" you were asking in the other patch about.
I see. So, if the builtin.c parts bootstrap & test ok then they are ok
to commit separately.
Thanks,
Richard.
> Regards,
> Kai
>
next prev parent reply other threads:[~2011-07-20 14:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-07 16:08 Kai Tietz
2011-07-08 9:28 ` Richard Guenther
2011-07-08 11:35 ` Kai Tietz
2011-07-08 12:03 ` Richard Guenther
2011-07-11 15:57 ` Kai Tietz
2011-07-12 9:29 ` Richard Guenther
2011-07-12 10:00 ` Kai Tietz
2011-07-12 10:34 ` Richard Guenther
2011-07-12 12:25 ` Kai Tietz
2011-07-12 14:38 ` Richard Guenther
2011-07-19 12:08 ` Kai Tietz
2011-07-19 12:16 ` Richard Guenther
2011-07-19 22:24 ` Kai Tietz
2011-07-20 13:32 ` Kai Tietz
2011-07-20 13:41 ` Richard Guenther
2011-07-20 14:07 ` Kai Tietz
2011-07-20 14:29 ` Richard Guenther [this message]
2011-07-20 17:43 ` Kai Tietz
2011-07-21 11:34 ` Kai Tietz
2011-07-21 12:13 ` Richard Guenther
2011-07-21 12:48 ` Kai Tietz
2011-07-21 15:49 ` H.J. Lu
2011-07-21 15:52 ` H.J. Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFiYyc3i9FAuujMUJQAeeUsMS7hooCVZqSxXPH=0nixraFDKtg@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=ktietz70@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).