public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "raksit at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/37489] In cse.c:fold_rtx(), "true" is represented in floating-point modes as const_true_rtx, if FLOAT_STORE_FLAG_VALUE is undefined.
Date: Fri, 12 Sep 2008 18:55:00 -0000	[thread overview]
Message-ID: <20080912185426.4860.qmail@sourceware.org> (raw)
In-Reply-To: <bug-37489-15599@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from raksit at gcc dot gnu dot org  2008-09-12 18:54 -------
(In reply to comment #4)
> We can't define FLOAT_STORE_FLAG_VALUE for SSE since we can't
> represent 0xfffffff as a valid FP value. This patch makes
> fold_rtx to match simplify_relational_operation:
> 
> --- ./cse.c.foo 2008-09-08 10:46:09.000000000 -0700
> +++ ./cse.c     2008-09-12 10:46:18.000000000 -0700
> @@ -3217,14 +3217,16 @@ fold_rtx (rtx x, rtx insn)
>           rtx true_rtx = const_true_rtx, false_rtx = const0_rtx;
>           enum machine_mode mode_arg1;
> 
> -#ifdef FLOAT_STORE_FLAG_VALUE
>           if (SCALAR_FLOAT_MODE_P (mode))
>             {
> +#ifdef FLOAT_STORE_FLAG_VALUE
>               true_rtx = (CONST_DOUBLE_FROM_REAL_VALUE
>                           (FLOAT_STORE_FLAG_VALUE (mode), mode));
> +#else
> +             true_rtx = NULL_RTX;
> +#endif
>               false_rtx = CONST0_RTX (mode);
>             }
> -#endif
> 
>           code = find_comparison_args (code, &folded_arg0, &folded_arg1,
>                                        &mode_arg0, &mode_arg1);
> @@ -3332,8 +3334,17 @@ fold_rtx (rtx x, rtx insn)
>                                                   const_arg1))
>                               || (REG_P (folded_arg1)
>                                   && (REG_QTY (REGNO (folded_arg1)) ==
> ent->comparison_qty))))
> -                       return (comparison_dominates_p (ent->comparison_code,
> code)
> -                               ? true_rtx : false_rtx);
> +                       {
> +                         if (comparison_dominates_p (ent->comparison_code,
> code))
> +                           {
> +                             if (true_rtx)
> +                               return true_rtx;
> +                             else
> +                               break;
> +                           }
> +                         else
> +                           return false_rtx;
> +                       }
>                     }
>                 }
>             }
> 

I had a similar patch in mind. In case it helps, I have attached a testcase
that you can use for the submission. You might also want to fix the gcc-4.3
branch.

-raksit


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37489


  parent reply	other threads:[~2008-09-12 18:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-11 23:36 [Bug rtl-optimization/37489] New: " raksit at gcc dot gnu dot org
2008-09-11 23:54 ` [Bug target/37489] " pinskia at gcc dot gnu dot org
2008-09-12  0:47 ` hjl dot tools at gmail dot com
2008-09-12  1:09 ` raksit at gcc dot gnu dot org
2008-09-12 17:54 ` hjl dot tools at gmail dot com
2008-09-12 18:53 ` raksit at gcc dot gnu dot org
2008-09-12 18:55 ` raksit at gcc dot gnu dot org [this message]
2008-09-12 19:42 ` [Bug middle-end/37489] const_true_rtx returned for float compare hjl dot tools at gmail dot com
2008-09-13 15:50 ` hjl at gcc dot gnu dot org
2008-09-13 16:01 ` [Bug rtl-optimization/37489] " hjl dot tools at gmail dot com
2008-11-06 14:05 ` rguenth at gcc dot gnu dot org
2008-11-06 15:08 ` rguenth at gcc dot gnu dot org

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=20080912185426.4860.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).