summaryrefslogtreecommitdiff
path: root/gcc/mode-switching.c
diff options
context:
space:
mode:
authorkkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-10 01:01:11 +0000
committerkkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-10 01:01:11 +0000
commit646857a5372afce5258dc1826e0c03b5de1117b1 (patch)
tree178762480d117e6b39ac6b9f575f63df1f6642e2 /gcc/mode-switching.c
parent458bfff7c593cb66b307a7b4e59cd38c735faa55 (diff)
downloadgcc-646857a5372afce5258dc1826e0c03b5de1117b1.tar.gz
PR rtl-optimization/32664
* mode-switching.c (create_pre_exit): Skip barrier insns. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126507 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/mode-switching.c')
-rw-r--r--gcc/mode-switching.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c
index 0e4f58caef0..e935acdd979 100644
--- a/gcc/mode-switching.c
+++ b/gcc/mode-switching.c
@@ -246,21 +246,37 @@ create_pre_exit (int n_entities, int *entity_map, const int *num_modes)
if (INSN_P (return_copy))
{
- if (GET_CODE (PATTERN (return_copy)) == USE
- && GET_CODE (XEXP (PATTERN (return_copy), 0)) == REG
- && (FUNCTION_VALUE_REGNO_P
- (REGNO (XEXP (PATTERN (return_copy), 0)))))
- {
- maybe_builtin_apply = 1;
- last_insn = return_copy;
- continue;
- }
- if (GET_CODE (PATTERN (return_copy)) == ASM_INPUT
- && strcmp (XSTR (PATTERN (return_copy), 0), "") == 0)
+ return_copy_pat = PATTERN (return_copy);
+ switch (GET_CODE (return_copy_pat))
{
+ case USE:
+ /* Skip __builtin_apply pattern. */
+ if (GET_CODE (XEXP (return_copy_pat, 0)) == REG
+ && (FUNCTION_VALUE_REGNO_P
+ (REGNO (XEXP (return_copy_pat, 0)))))
+ {
+ maybe_builtin_apply = 1;
+ last_insn = return_copy;
+ continue;
+ }
+ break;
+
+ case ASM_OPERANDS:
+ /* Skip barrier insns. */
+ if (!MEM_VOLATILE_P (return_copy_pat))
+ break;
+
+ /* Fall through. */
+
+ case ASM_INPUT:
+ case UNSPEC_VOLATILE:
last_insn = return_copy;
continue;
+
+ default:
+ break;
}
+
/* If the return register is not (in its entirety)
likely spilled, the return copy might be
partially or completely optimized away. */