diff options
Diffstat (limited to 'meta-microblaze/recipes-devtools/gcc/gcc-13/0052-If-we-use-break_handler-attribute-then-interrupt-vec.patch')
-rw-r--r-- | meta-microblaze/recipes-devtools/gcc/gcc-13/0052-If-we-use-break_handler-attribute-then-interrupt-vec.patch | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-13/0052-If-we-use-break_handler-attribute-then-interrupt-vec.patch b/meta-microblaze/recipes-devtools/gcc/gcc-13/0052-If-we-use-break_handler-attribute-then-interrupt-vec.patch new file mode 100644 index 00000000..d0474dd9 --- /dev/null +++ b/meta-microblaze/recipes-devtools/gcc/gcc-13/0052-If-we-use-break_handler-attribute-then-interrupt-vec.patch | |||
@@ -0,0 +1,72 @@ | |||
1 | From b792943436857172e7a39e26a00602c7e6620860 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mahesh Bodapati <mbodapat@xilinx.com> | ||
3 | Date: Tue, 13 Sep 2022 16:38:43 +0530 | ||
4 | Subject: [PATCH 52/54] If we use break_handler attribute then interrupt vector | ||
5 | call happened to break_handler instead of interrupt_handler. this fix will | ||
6 | resolve the issue CR-1081780. This fix will not change the behavior of | ||
7 | compiler unless there is a usage of break_handler attribute. signed-off-by : | ||
8 | Mahesh Bodapati <mbodapat@xilinx.com> | ||
9 | |||
10 | --- | ||
11 | gcc/config/microblaze/microblaze.cc | 13 +++++-------- | ||
12 | 1 file changed, 5 insertions(+), 8 deletions(-) | ||
13 | |||
14 | diff --git a/gcc/config/microblaze/microblaze.cc b/gcc/config/microblaze/microblaze.cc | ||
15 | index e6d3f35370c..58d091fbed2 100644 | ||
16 | --- a/gcc/config/microblaze/microblaze.cc | ||
17 | +++ b/gcc/config/microblaze/microblaze.cc | ||
18 | @@ -2025,7 +2025,7 @@ microblaze_save_volatiles (tree func) | ||
19 | int | ||
20 | microblaze_is_interrupt_variant (void) | ||
21 | { | ||
22 | - return (interrupt_handler || fast_interrupt); | ||
23 | + return (interrupt_handler || fast_interrupt || break_handler); | ||
24 | } | ||
25 | int | ||
26 | microblaze_is_break_handler (void) | ||
27 | @@ -2064,7 +2064,7 @@ microblaze_must_save_register (int regno) | ||
28 | { | ||
29 | if (df_regs_ever_live_p (regno) | ||
30 | || regno == MB_ABI_MSR_SAVE_REG | ||
31 | - || ((interrupt_handler || fast_interrupt) | ||
32 | + || ((interrupt_handler || fast_interrupt || break_handler) | ||
33 | && (regno == MB_ABI_ASM_TEMP_REGNUM | ||
34 | || regno == MB_ABI_EXCEPTION_RETURN_ADDR_REGNUM))) | ||
35 | return 1; | ||
36 | @@ -2280,9 +2280,6 @@ compute_frame_size (HOST_WIDE_INT size) | ||
37 | fast_interrupt = | ||
38 | microblaze_fast_interrupt_function_p (current_function_decl); | ||
39 | save_volatiles = microblaze_save_volatiles (current_function_decl); | ||
40 | - if (break_handler) | ||
41 | - interrupt_handler = break_handler; | ||
42 | - | ||
43 | gp_reg_size = 0; | ||
44 | mask = 0; | ||
45 | var_size = size; | ||
46 | @@ -3242,7 +3239,7 @@ microblaze_expand_prologue (void) | ||
47 | gen_rtx_PLUS (Pmode, stack_pointer_rtx, | ||
48 | const0_rtx)); | ||
49 | |||
50 | - if (interrupt_handler) | ||
51 | + if (interrupt_handler || break_handler) | ||
52 | /* Do not optimize in flow analysis. */ | ||
53 | MEM_VOLATILE_P (mem_rtx) = 1; | ||
54 | |||
55 | @@ -3353,12 +3350,12 @@ microblaze_expand_epilogue (void) | ||
56 | a load-use stall cycle :) This is also important to handle alloca. | ||
57 | (See comments for if (frame_pointer_needed) below. */ | ||
58 | |||
59 | - if (!crtl->is_leaf || interrupt_handler) | ||
60 | + if (!crtl->is_leaf || interrupt_handler || break_handler) | ||
61 | { | ||
62 | mem_rtx = | ||
63 | gen_rtx_MEM (Pmode, | ||
64 | gen_rtx_PLUS (Pmode, stack_pointer_rtx, const0_rtx)); | ||
65 | - if (interrupt_handler) | ||
66 | + if (interrupt_handler || break_handler) | ||
67 | /* Do not optimize in flow analysis. */ | ||
68 | MEM_VOLATILE_P (mem_rtx) = 1; | ||
69 | reg_rtx = gen_rtx_REG (Pmode, MB_ABI_SUB_RETURN_ADDR_REGNUM); | ||
70 | -- | ||
71 | 2.34.1 | ||
72 | |||