]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/48973 (Inliner bug with one-bit (1-bit) bitfield)
authorJakub Jelinek <jakub@redhat.com>
Thu, 21 Jul 2011 09:39:16 +0000 (11:39 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 21 Jul 2011 09:39:16 +0000 (11:39 +0200)
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.

From-SVN: r176555

gcc/ChangeLog
gcc/expr.c

index 6daa8468653506349b9c81b37d33736c4b1bb8ea..b4feffa5a6c86bd32dc838dca9614078197eb21a 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
 2011-07-19  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
index 0d96eb334417328b66189778b35f0293da08bb24..8cc28fb88703d7b25f3ce6ad91ec692ddff61eb9 100644 (file)
@@ -9166,7 +9166,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
       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;