From 2e3964763a9c0f12cc15b2b787e3d0ed5c93ca63 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Mon, 21 Jan 2002 22:57:49 +0000 Subject: [PATCH] pa-protos.h (reg_before_reload_operand): New function prototype. * pa-protos.h (reg_before_reload_operand): New function prototype. * pa.c (reg_before_reload_operand): New function implementation. * pa.md (decrement_and_branch_until_zero, movb): Use it. Change "!*m" contraints to "*m". From-SVN: r49058 --- gcc/ChangeLog | 7 +++++++ gcc/config/pa/pa-protos.h | 3 ++- gcc/config/pa/pa.c | 22 ++++++++++++++++++++++ gcc/config/pa/pa.md | 6 +++--- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 33de54d7b39..513425dcf8c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2002-01-21 John David Anglin + + * pa-protos.h (reg_before_reload_operand): New function prototype. + * pa.c (reg_before_reload_operand): New function implementation. + * pa.md (decrement_and_branch_until_zero, movb): Use it. Change "!*m" + contraints to "*m". + 2002-01-21 Franz Sirl * combine.c (simplify_and_const_int): Properly sign-extend CONSTOP. diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h index e3487e5a018..0c81ae06814 100644 --- a/gcc/config/pa/pa-protos.h +++ b/gcc/config/pa/pa-protos.h @@ -1,5 +1,5 @@ /* Prototypes for pa.c functions used in the md file & elsewhere. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -83,6 +83,7 @@ extern int ior_operand PARAMS ((rtx, enum machine_mode)); extern int arith32_operand PARAMS ((rtx, enum machine_mode)); extern int uint32_operand PARAMS ((rtx, enum machine_mode)); extern int reg_or_nonsymb_mem_operand PARAMS ((rtx, enum machine_mode)); +extern int reg_before_reload_operand PARAMS ((rtx, enum machine_mode)); extern int reg_or_0_operand PARAMS ((rtx, enum machine_mode)); extern int reg_or_0_or_nonsymb_mem_operand PARAMS ((rtx, enum machine_mode)); extern int pre_cint_operand PARAMS ((rtx, enum machine_mode)); diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index fd2099fa6eb..40fe3dab139 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -364,6 +364,28 @@ reg_or_0_or_nonsymb_mem_operand (op, mode) return 0; } +/* Return 1 if the operand is a register operand or a non-symbolic memory + operand after reload. This predicate is used for branch patterns that + internally handle register reloading. We need to accept non-symbolic + memory operands after reload to ensure that the pattern is still valid + if reload didn't find a hard register for the operand. */ + +int +reg_before_reload_operand (op, mode) + register rtx op; + enum machine_mode mode; +{ + if (register_operand (op, mode)) + return 1; + + if (reload_completed + && memory_operand (op, mode) + && ! symbolic_memory_operand (op, mode)) + return 1; + + return 0; +} + /* Accept any constant that can be moved in one instructions into a general register. */ int diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 09dd2ff470c..846cc49fc72 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -6589,7 +6589,7 @@ (if_then_else (match_operator 2 "comparison_operator" [(plus:SI - (match_operand:SI 0 "reg_or_nonsymb_mem_operand" "+!r,!*f,!*m") + (match_operand:SI 0 "reg_before_reload_operand" "+!r,!*f,*m") (match_operand:SI 1 "int5_operand" "L,L,L")) (const_int 0)]) (label_ref (match_operand 3 "" "")) @@ -6646,7 +6646,7 @@ [(match_operand:SI 1 "register_operand" "r,r,r,r") (const_int 0)]) (label_ref (match_operand 3 "" "")) (pc))) - (set (match_operand:SI 0 "register_operand" "=!r,!*f,!*m,!*q") + (set (match_operand:SI 0 "reg_before_reload_operand" "=!r,!*f,*m,!*q") (match_dup 1))] "" "* return output_movb (operands, insn, which_alternative, 0); " @@ -6692,7 +6692,7 @@ [(match_operand:SI 1 "register_operand" "r,r,r,r") (const_int 0)]) (pc) (label_ref (match_operand 3 "" "")))) - (set (match_operand:SI 0 "register_operand" "=!r,!*f,!*m,!*q") + (set (match_operand:SI 0 "reg_before_reload_operand" "=!r,!*f,*m,!*q") (match_dup 1))] "" "* return output_movb (operands, insn, which_alternative, 1); "