diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-05 14:06:46 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-05 14:06:46 +0000 |
commit | 219a732782d13efc5f522254caee69563f3e08f1 (patch) | |
tree | 7b626e91f813aeaea1a249d43406dd0cb5930b3e /gcc/dojump.c | |
parent | f40d56d5b370fce44c30884cf5e8a0be393e9cc2 (diff) | |
download | gcc-219a732782d13efc5f522254caee69563f3e08f1.tar.gz |
* dojump.c (do_jump): If the expression being compared against
zero, is the subreg of a promoted variable, perform the comparison
in the promoted mode.
* simplify-rtx.c (simplify_unary_operation): Optimize sign and
zero-extensions of subregs of promoted variables where the
extension is identical to that used to promote the variable.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74332 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dojump.c')
-rw-r--r-- | gcc/dojump.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/dojump.c b/gcc/dojump.c index 2ed014bacf9..8887c498eca 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -584,7 +584,14 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) { /* The RTL optimizers prefer comparisons against pseudos. */ if (GET_CODE (temp) == SUBREG) - temp = copy_to_reg (temp); + { + /* Compare promoted variables in their promoted mode. */ + if (SUBREG_PROMOTED_VAR_P (temp) + && GET_CODE (XEXP (temp, 0)) == REG) + temp = XEXP (temp, 0); + else + temp = copy_to_reg (temp); + } do_compare_rtx_and_jump (temp, CONST0_RTX (GET_MODE (temp)), NE, TREE_UNSIGNED (TREE_TYPE (exp)), GET_MODE (temp), NULL_RTX, |