diff options
author | Richard Henderson <rth@redhat.com> | 2015-05-11 16:33:17 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2015-05-11 16:33:17 -0700 |
commit | 15a85b055d38e8f0000da08d80e143a89ecb827e (patch) | |
tree | bb6fc101af1083cea96478a59bea1d675d3625a8 /gcc/cfgexpand.c | |
parent | 6476a8fde0b47159a054f0d594ddba8875ae30ca (diff) | |
download | gcc-15a85b055d38e8f0000da08d80e143a89ecb827e.zip gcc-15a85b055d38e8f0000da08d80e143a89ecb827e.tar.gz gcc-15a85b055d38e8f0000da08d80e143a89ecb827e.tar.bz2 |
Canonicalize asm volatility earlier
If gimple_asm_volatile_p is correct, no point re-checking.
This is also done by the C and C++ front ends, but not Ada.
So we can't yet trust ASM_VOLATILE_P from the front end.
From-SVN: r223024
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 5d44c48..0479279 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -2587,8 +2587,6 @@ expand_asm_stmt (gasm *stmt) for (i = 0; i < noutputs; ++i) orig_outputs[i] = TREE_VALUE (gimple_asm_output_op (stmt, i)); - bool vol = gimple_asm_volatile_p (stmt); - rtvec argvec, constraintvec, labelvec; rtx body; int ninout; @@ -2603,10 +2601,6 @@ expand_asm_stmt (gasm *stmt) int old_generating_concat_p = generating_concat_p; rtx_code_label *fallthru_label = NULL; - /* An ASM with no outputs needs to be treated as volatile, for now. */ - if (noutputs == 0) - vol = 1; - if (! check_operand_nalternatives (outputs, inputs)) return; @@ -2815,7 +2809,7 @@ expand_asm_stmt (gasm *stmt) empty_string, 0, argvec, constraintvec, labelvec, locus); - MEM_VOLATILE_P (body) = vol; + MEM_VOLATILE_P (body) = gimple_asm_volatile_p (stmt); /* Eval the inputs and put them into ARGVEC. Put their constraints into ASM_INPUTs and store in CONSTRAINTS. */ @@ -2963,7 +2957,8 @@ expand_asm_stmt (gasm *stmt) ggc_strdup (constraints[i]), i, argvec, constraintvec, labelvec, locus)); - MEM_VOLATILE_P (SET_SRC (XVECEXP (body, 0, i))) = vol; + MEM_VOLATILE_P (SET_SRC (XVECEXP (body, 0, i))) + = gimple_asm_volatile_p (stmt); } /* If there are no outputs (but there are some clobbers) |