public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [4.4 PATCH] Fix another signed 1 bit comparison issue (PR middle-end/48973)
@ 2011-07-21  8:40 Jakub Jelinek
  2011-07-21 10:00 ` Richard Guenther
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2011-07-21  8:40 UTC (permalink / raw)
  To: gcc-patches

Hi!

The 4.4 expr.c is significantly different from 4.5 that the PR48973
backport wasn't trivial, and apparently I've missed another place
- on the 4.4 branch the new pr48973-{1,2}.c tests fail on s390{,x}-linux.

The following patch fixes it, ok for 4.4 branch?

2011-07-21  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/48973
	* expr.c (expand_expr_real_1) <case TRUTH_ANDIF_EXPR:>: If
	the comparison has a single bit signed type, use
	constm1_rtx instead of const1_rtx for true value.

--- gcc/expr.c	(revision 176517)
+++ gcc/expr.c	(working copy)
@@ -9171,7 +9171,9 @@ expand_expr_real_1 (tree exp, rtx target
       jumpifnot (exp, op1, -1);
 
       if (target)
-	emit_move_insn (target, const1_rtx);
+	emit_move_insn (target,
+			TYPE_PRECISION (type) == 1 && !TYPE_UNSIGNED (type)
+			? constm1_rtx : const1_rtx);
 
       emit_label (op1);
       return ignore ? const0_rtx : target;

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [4.4 PATCH] Fix another signed 1 bit comparison issue (PR middle-end/48973)
  2011-07-21  8:40 [4.4 PATCH] Fix another signed 1 bit comparison issue (PR middle-end/48973) Jakub Jelinek
@ 2011-07-21 10:00 ` Richard Guenther
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Guenther @ 2011-07-21 10:00 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Thu, Jul 21, 2011 at 9:39 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> The 4.4 expr.c is significantly different from 4.5 that the PR48973
> backport wasn't trivial, and apparently I've missed another place
> - on the 4.4 branch the new pr48973-{1,2}.c tests fail on s390{,x}-linux.
>
> The following patch fixes it, ok for 4.4 branch?

Ok.

THanks,
Richard.

> 2011-07-21  Jakub Jelinek  <jakub@redhat.com>
>
>        PR middle-end/48973
>        * expr.c (expand_expr_real_1) <case TRUTH_ANDIF_EXPR:>: If
>        the comparison has a single bit signed type, use
>        constm1_rtx instead of const1_rtx for true value.
>
> --- gcc/expr.c  (revision 176517)
> +++ gcc/expr.c  (working copy)
> @@ -9171,7 +9171,9 @@ expand_expr_real_1 (tree exp, rtx target
>       jumpifnot (exp, op1, -1);
>
>       if (target)
> -       emit_move_insn (target, const1_rtx);
> +       emit_move_insn (target,
> +                       TYPE_PRECISION (type) == 1 && !TYPE_UNSIGNED (type)
> +                       ? constm1_rtx : const1_rtx);
>
>       emit_label (op1);
>       return ignore ? const0_rtx : target;
>
>        Jakub
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-21  9:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-21  8:40 [4.4 PATCH] Fix another signed 1 bit comparison issue (PR middle-end/48973) Jakub Jelinek
2011-07-21 10:00 ` Richard Guenther

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).