diff options
author | Andrew Fresh <afresh1@cvs.openbsd.org> | 2016-03-30 15:39:08 +0000 |
---|---|---|
committer | Andrew Fresh <afresh1@cvs.openbsd.org> | 2016-03-30 15:39:08 +0000 |
commit | de1ef868608c897383ae96e1c842e9254fb5ff30 (patch) | |
tree | cc0ca247138a4ee3d7c067ab359f7bf4349863d9 /gnu/gcc | |
parent | 18b3dab060ebaf4577c6c7a323750a35ea9e48d3 (diff) |
Fix optimization for alphas without the ``precise arithmetic trap'' extension
From Miod Vallat
I trust miod deraadt@
Diffstat (limited to 'gnu/gcc')
-rw-r--r-- | gnu/gcc/gcc/config/alpha/alpha.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gnu/gcc/gcc/config/alpha/alpha.c b/gnu/gcc/gcc/config/alpha/alpha.c index 9d5cf0b3068..15899afc025 100644 --- a/gnu/gcc/gcc/config/alpha/alpha.c +++ b/gnu/gcc/gcc/config/alpha/alpha.c @@ -8723,11 +8723,15 @@ summarize_insn (rtx x, struct shadow_summary *sum, int set) result of an instruction that might generate an UNPREDICTABLE result. - (c) Within the trap shadow, no register may be used more than once + (c) Within the trap shadow, the destination register of the potentially + trapping instruction may not be used as an input, for its value would be + UNPREDICTABLE. + + (d) Within the trap shadow, no register may be used more than once as a destination register. (This is to make life easier for the trap-handler.) - (d) The trap shadow may not include any branch instructions. */ + (e) The trap shadow may not include any branch instructions. */ static void alpha_handle_trap_shadows (void) @@ -8799,7 +8803,7 @@ alpha_handle_trap_shadows (void) if ((sum.defd.i & shadow.defd.i) || (sum.defd.fp & shadow.defd.fp)) { - /* (c) would be violated */ + /* (d) would be violated */ goto close_shadow; } @@ -8822,11 +8826,19 @@ alpha_handle_trap_shadows (void) goto close_shadow; } + + if ((sum.used.i & shadow.defd.i) + || (sum.used.fp & shadow.defd.fp)) + { + /* (c) would be violated */ + goto close_shadow; + } break; case JUMP_INSN: case CALL_INSN: case CODE_LABEL: + /* (e) would be violated */ goto close_shadow; default: |