aboutsummaryrefslogtreecommitdiff
path: root/gcc/reg-stack.c
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2021-12-08 23:37:15 -0300
committerAlexandre Oliva <oliva@gnu.org>2021-12-08 23:37:15 -0300
commitaf93386ffc18ca6c7d1949751ff97cc6ce092b2c (patch)
treea1fd06c35251dd11712a91dbcb4961dfe46af283 /gcc/reg-stack.c
parent50e8b0c9bca6cdc57804f860ec5311b641753fbb (diff)
downloadgcc-af93386ffc18ca6c7d1949751ff97cc6ce092b2c.zip
gcc-af93386ffc18ca6c7d1949751ff97cc6ce092b2c.tar.gz
gcc-af93386ffc18ca6c7d1949751ff97cc6ce092b2c.tar.bz2
[PR103097] tolerate reg-stack cross-block malformed asms
The testcase shows malformed asms in one block confuse reg-stack logic in another block. Moving the resetting of any_malformed_asm to the end of the pass enables it to take effect throughout the affected function. for gcc/ChangeLog PR target/103097 * reg-stack.c (convert_regs_1): Move any_malformed_asm resetting... (reg_to_stack): ... here. for gcc/testsuite/ChangeLog PR target/103097 * gcc.target/i386/pr103097.c: New.
Diffstat (limited to 'gcc/reg-stack.c')
-rw-r--r--gcc/reg-stack.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 1d9ea03..cc369f0 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -453,7 +453,7 @@ get_true_reg (rtx *pat)
}
}
-/* Set if we find any malformed asms in a block. */
+/* Set if we find any malformed asms in a function. */
static bool any_malformed_asm;
/* There are many rules that an asm statement for stack-like regs must
@@ -3014,8 +3014,6 @@ convert_regs_1 (basic_block block)
bool cfg_altered = false;
int debug_insns_with_starting_stack = 0;
- any_malformed_asm = false;
-
/* Choose an initial stack layout, if one hasn't already been chosen. */
if (bi->stack_in.top == -2)
{
@@ -3385,6 +3383,7 @@ reg_to_stack (void)
0, sizeof (char) * (max_uid + 1));
convert_regs ();
+ any_malformed_asm = false;
free_aux_for_blocks ();
return true;