aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-12-14 18:59:36 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2004-12-14 18:59:36 +0100
commit2a1a3cd51f8bb928fe7291d8dcb84492bc49f6ed (patch)
tree2ceb8f670d9c363199f950dbe87fb725e1b5083c /gcc/fold-const.c
parent0a96f3c694d88ed9f0c97135ca67151540f9d66f (diff)
downloadgcc-2a1a3cd51f8bb928fe7291d8dcb84492bc49f6ed.zip
gcc-2a1a3cd51f8bb928fe7291d8dcb84492bc49f6ed.tar.gz
gcc-2a1a3cd51f8bb928fe7291d8dcb84492bc49f6ed.tar.bz2
fold-const.c (fold_single_bit_test): If flag_syntax_only, pretend LOAD_EXTEND_OP is not defined.
* fold-const.c (fold_single_bit_test): If flag_syntax_only, pretend LOAD_EXTEND_OP is not defined. (fold): Likewise. If flag_syntax_only, don't depend on BITS_PER_WORD. From-SVN: r92150
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index da7a284..2fe0b7e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5876,7 +5876,8 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1,
operations as unsigned. If we must use the AND, we have a choice.
Normally unsigned is faster, but for some machines signed is. */
#ifdef LOAD_EXTEND_OP
- ops_unsigned = (LOAD_EXTEND_OP (operand_mode) == SIGN_EXTEND ? 0 : 1);
+ ops_unsigned = (LOAD_EXTEND_OP (operand_mode) == SIGN_EXTEND
+ && !flag_syntax_only) ? 0 : 1;
#else
ops_unsigned = 1;
#endif
@@ -6404,10 +6405,11 @@ fold (tree expr)
&& ! VOID_TYPE_P (TREE_OPERAND (tem, 2))
&& (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (tem, 1), 0))
== TREE_TYPE (TREE_OPERAND (TREE_OPERAND (tem, 2), 0)))
- && ! (INTEGRAL_TYPE_P (TREE_TYPE (tem))
- && (INTEGRAL_TYPE_P
- (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (tem, 1), 0))))
- && TYPE_PRECISION (TREE_TYPE (tem)) <= BITS_PER_WORD))
+ && (! (INTEGRAL_TYPE_P (TREE_TYPE (tem))
+ && (INTEGRAL_TYPE_P
+ (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (tem, 1), 0))))
+ && TYPE_PRECISION (TREE_TYPE (tem)) <= BITS_PER_WORD)
+ || flag_syntax_only))
tem = build1 (code, type,
build3 (COND_EXPR,
TREE_TYPE (TREE_OPERAND
@@ -6614,6 +6616,7 @@ fold (tree expr)
change = (cst == 0);
#ifdef LOAD_EXTEND_OP
if (change
+ && !flag_syntax_only
&& (LOAD_EXTEND_OP (TYPE_MODE (TREE_TYPE (and0)))
== ZERO_EXTEND))
{