Commit d8086cbb by Roger Sayle Committed by Richard Henderson

re PR rtl-optimization/3640 (small lost optimization of "x==0 || x==1")

        PR opt/3640
        * fold-const.c (fold): Optimize unsigned comparisons against
        UINT_MAX (and similar unsigned constants).

From-SVN: r49096
parent 11303d15
2002-01-22 Roger Sayle <roger@eyesopen.com>
Richard Henderson <rth@redhat.com>
PR opt/3640
* fold-const.c (fold): Optimize unsigned comparisons against
UINT_MAX (and similar unsigned constants).
2002-01-22 Janis Johnson <janis187@us.ibm.com> 2002-01-22 Janis Johnson <janis187@us.ibm.com>
* Makefile.in (loop.o): Depend on OPTABS_H. * Makefile.in (loop.o): Depend on OPTABS_H.
* loop.c (expand_builtin_prefetch): Check the prefetch operand * loop.c (expand_builtin_prefetch): Check the prefetch operand
against the predicate. against the predicate.
PR target/5379 PR target/5379
* config/i386/i386.md (prefetch_sse): Specify "p" as a constraint * config/i386/i386.md (prefetch_sse): Specify "p" as a constraint
...@@ -25,18 +32,18 @@ ...@@ -25,18 +32,18 @@
2002-01-22 Aldy Hernandez <aldyh@redhat.com> 2002-01-22 Aldy Hernandez <aldyh@redhat.com>
* regrename.c (kill_value): Fix typo. * regrename.c (kill_value): Fix typo.
2002-01-22 Aldy Hernandez <aldyh@redhat.com> 2002-01-22 Aldy Hernandez <aldyh@redhat.com>
* doc/tm.texi: Remove STARTING_FRAME_PHASE. * doc/tm.texi: Remove STARTING_FRAME_PHASE.
* config/rs6000/rs6000.h: Same. * config/rs6000/rs6000.h: Same.
* function.c (instantiate_virtual_regs): Remove * function.c (instantiate_virtual_regs): Remove
STARTING_FRAME_PHASE. STARTING_FRAME_PHASE.
(assign_stack_local_1): Same. (assign_stack_local_1): Same.
Calculate frame phase. Calculate frame phase.
2002-01-22 Nick Clifton <nickc@redhat.com> 2002-01-22 Nick Clifton <nickc@redhat.com>
...@@ -276,15 +283,15 @@ Sun Jan 20 18:40:14 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -276,15 +283,15 @@ Sun Jan 20 18:40:14 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2002-01-18 Aldy Hernandez <aldyh@redhat.com> 2002-01-18 Aldy Hernandez <aldyh@redhat.com>
* doc/tm.texi (STARTING_FRAME_PHASE): Document. * doc/tm.texi (STARTING_FRAME_PHASE): Document.
* function.c (assign_stack_local_1): Adjust x_frame_offset with * function.c (assign_stack_local_1): Adjust x_frame_offset with
STARTING_FRAME_PHASE. STARTING_FRAME_PHASE.
(STARTING_FRAME_PHASE): New. (STARTING_FRAME_PHASE): New.
(instantiate_virtual_regs): Check saneness of (instantiate_virtual_regs): Check saneness of
STARTING_FRAME_PHASE. STARTING_FRAME_PHASE.
* config/rs6000/rs6000.h (STARTING_FRAME_PHASE): New. * config/rs6000/rs6000.h (STARTING_FRAME_PHASE): New.
2002-01-19 Alexandre Oliva <aoliva@redhat.com> 2002-01-19 Alexandre Oliva <aoliva@redhat.com>
...@@ -327,11 +334,11 @@ Thu Jan 17 15:28:26 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -327,11 +334,11 @@ Thu Jan 17 15:28:26 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2002-01-17 Aldy Hernandez <aldyh@redhat.com> 2002-01-17 Aldy Hernandez <aldyh@redhat.com>
* config.gcc (cpu_type): Include altivec.h in powerpc * config.gcc (cpu_type): Include altivec.h in powerpc
extra_headers. extra_headers.
Same for darwin. Same for darwin.
* config/rs6000/altivec.h: New. * config/rs6000/altivec.h: New.
2002-01-17 David Edelsohn <edelsohn@gnu.org> 2002-01-17 David Edelsohn <edelsohn@gnu.org>
...@@ -409,7 +416,7 @@ Thu Jan 17 15:28:26 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -409,7 +416,7 @@ Thu Jan 17 15:28:26 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2002-01-16 Jakub Jelinek <jakub@redhat.com> 2002-01-16 Jakub Jelinek <jakub@redhat.com>
PR target/5309: PR target/5309:
* config/sparc/sparc.c (ultrasparc_adjust_cost): Handle TYPE_IDIV the * config/sparc/sparc.c (ultrasparc_adjust_cost): Handle TYPE_IDIV the
same way as TYPE_IMUL. same way as TYPE_IMUL.
(ultrasparc_sched_reorder): Likewise. (ultrasparc_sched_reorder): Likewise.
* config/sparc/sparc.md (type): Add comment to update * config/sparc/sparc.md (type): Add comment to update
...@@ -505,27 +512,27 @@ Wed Jan 16 17:54:22 CET 2002 Jan Hubicka <jh@suse.cz> ...@@ -505,27 +512,27 @@ Wed Jan 16 17:54:22 CET 2002 Jan Hubicka <jh@suse.cz>
2002-01-15 Aldy Hernandez <aldyh@redhat.com> 2002-01-15 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.md (altivec_stvx): Add parallels to stvx. * config/rs6000/rs6000.md (altivec_stvx): Add parallels to stvx.
(altivec_lvsl): Change constraint to b. (altivec_lvsl): Change constraint to b.
(altivec_lvsr): Same. (altivec_lvsr): Same.
(altivec_lvebx): Same. (altivec_lvebx): Same.
(altivec_lvehx): Same. (altivec_lvehx): Same.
(altivec_lvewx): Same. (altivec_lvewx): Same.
(altivec_lvxl): Same. (altivec_lvxl): Same.
(altivec_lvx): Same. (altivec_lvx): Same.
(altivec_stvx): Add parallel. (altivec_stvx): Add parallel.
(altivec_stvxl): Same. (altivec_stvxl): Same.
(altivec_stvehx): Same. (altivec_stvehx): Same.
(altivec_stvebx): Same. (altivec_stvebx): Same.
(altivec_stvebx): Same. (altivec_stvebx): Same.
2002-01-15 Aldy Hernandez <aldyh@redhat.com> 2002-01-15 Aldy Hernandez <aldyh@redhat.com>
* config.gcc: Change altivec.h to altivec-defs.h. * config.gcc: Change altivec.h to altivec-defs.h.
* config/rs6000/altivec.h: Delete. * config/rs6000/altivec.h: Delete.
* config/rs6000/altivec-defs.h: Add. * config/rs6000/altivec-defs.h: Add.
2002-01-15 John David Anglin <dave@hiauly1.hia.nrc.ca> 2002-01-15 John David Anglin <dave@hiauly1.hia.nrc.ca>
...@@ -903,24 +910,24 @@ Fri Jan 11 09:25:05 2002 Nicola Pero <n.pero@mi.flashnet.it> ...@@ -903,24 +910,24 @@ Fri Jan 11 09:25:05 2002 Nicola Pero <n.pero@mi.flashnet.it>
2002-01-10 Aldy Hernandez <aldyh@redhat.com> 2002-01-10 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.c (altivec_init_builtins): Add support for * config/rs6000/rs6000.c (altivec_init_builtins): Add support for
lvebx, lvehx, lvewx, lvxl, lvx, stvx, stvebx, stvehx, stvewx, lvebx, lvehx, lvewx, lvxl, lvx, stvx, stvebx, stvehx, stvewx,
stvxl. stvxl.
(altivec_expand_builtin): Same. (altivec_expand_builtin): Same.
(altivec_expand_stv_builtin): New. (altivec_expand_stv_builtin): New.
* config/rs6000/rs6000.h (rs6000_builtins): Same. * config/rs6000/rs6000.h (rs6000_builtins): Same.
* config/rs6000/rs6000.md ("altivec_lvebx"): New. * config/rs6000/rs6000.md ("altivec_lvebx"): New.
("altivec_lvehx"): New. ("altivec_lvehx"): New.
("altivec_lvewx"): New. ("altivec_lvewx"): New.
("altivec_lvxl"): New. ("altivec_lvxl"): New.
("altivec_lvx"): New. ("altivec_lvx"): New.
("altivec_stvx"): New. ("altivec_stvx"): New.
("altivec_stvebx"): New. ("altivec_stvebx"): New.
("altivec_stvehx"): New. ("altivec_stvehx"): New.
("altivec_stvewx"): New. ("altivec_stvewx"): New.
("altivec_stvxl"): New. ("altivec_stvxl"): New.
2002-01-10 Richard Henderson <rth@redhat.com> 2002-01-10 Richard Henderson <rth@redhat.com>
......
/* Fold a constant sub-tree into a single node for C-compiler /* Fold a constant sub-tree into a single node for C-compiler
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001 Free Software Foundation, Inc. 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -6753,6 +6753,31 @@ fold (expr) ...@@ -6753,6 +6753,31 @@ fold (expr)
default: default:
break; break;
} }
else if (TREE_UNSIGNED (TREE_TYPE (arg1))
&& tree_int_cst_equal (TYPE_MAX_VALUE (TREE_TYPE (arg1)),
arg1))
switch (TREE_CODE (t))
{
case GT_EXPR:
return omit_one_operand (type,
convert (type, integer_zero_node),
arg0);
case GE_EXPR:
TREE_SET_CODE (t, EQ_EXPR);
break;
case LE_EXPR:
return omit_one_operand (type,
convert (type, integer_one_node),
arg0);
case LT_EXPR:
TREE_SET_CODE (t, NE_EXPR);
break;
default:
break;
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment