diff options
| author | Mark Hatle <mark.hatle@xilinx.com> | 2021-04-30 12:28:07 -0700 |
|---|---|---|
| committer | Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> | 2021-07-14 15:02:41 -0700 |
| commit | 0fa97a9f6992a452d2247b716926fac724f483b9 (patch) | |
| tree | 701638c34677d828236c30e9cace1c7c09d17751 /meta-microblaze/recipes-devtools | |
| parent | 980ad571ee51f5b796692ec5d3302183122bffbd (diff) | |
| download | meta-xilinx-0fa97a9f6992a452d2247b716926fac724f483b9.tar.gz | |
gcc: Fix break_hander attribute handling
Issue: CR-1081780
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-microblaze/recipes-devtools')
| -rw-r--r-- | meta-microblaze/recipes-devtools/gcc/gcc-10/0055-Patch-MicroBlaze.patch | 71 | ||||
| -rw-r--r-- | meta-microblaze/recipes-devtools/gcc/gcc-source_10.%.bbappend | 1 |
2 files changed, 72 insertions, 0 deletions
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-10/0055-Patch-MicroBlaze.patch b/meta-microblaze/recipes-devtools/gcc/gcc-10/0055-Patch-MicroBlaze.patch new file mode 100644 index 00000000..4d6cbae6 --- /dev/null +++ b/meta-microblaze/recipes-devtools/gcc/gcc-10/0055-Patch-MicroBlaze.patch | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | From db280c2d72bb043215b2fdfe7cf959fb50d3ce80 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mahesh Bodapati <mbodapat@xilinx.com> | ||
| 3 | Date: Wed, 28 Apr 2021 16:49:18 +0530 | ||
| 4 | Subject: [PATCH 55] [Patch,MicroBlaze] : If we use break_handler attribute then | ||
| 5 | interrupt vector call happened to break_handler instead of interrupt_handler. | ||
| 6 | this fix will resolve the issue CR-1081780 This fix will not change the | ||
| 7 | behavior of compiler unless there is a usage of break_handler attribute. | ||
| 8 | |||
| 9 | --- | ||
| 10 | gcc/config/microblaze/microblaze.c | 13 +++++-------- | ||
| 11 | 1 file changed, 5 insertions(+), 8 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c | ||
| 14 | index d72eb7d5898..e47eb1cd0fe 100644 | ||
| 15 | --- a/gcc/config/microblaze/microblaze.c | ||
| 16 | +++ b/gcc/config/microblaze/microblaze.c | ||
| 17 | @@ -2019,7 +2019,7 @@ microblaze_save_volatiles (tree func) | ||
| 18 | int | ||
| 19 | microblaze_is_interrupt_variant (void) | ||
| 20 | { | ||
| 21 | - return (interrupt_handler || fast_interrupt); | ||
| 22 | + return (interrupt_handler || fast_interrupt || break_handler); | ||
| 23 | } | ||
| 24 | int | ||
| 25 | microblaze_is_break_handler (void) | ||
| 26 | @@ -2058,7 +2058,7 @@ microblaze_must_save_register (int regno) | ||
| 27 | { | ||
| 28 | if (df_regs_ever_live_p (regno) | ||
| 29 | || regno == MB_ABI_MSR_SAVE_REG | ||
| 30 | - || ((interrupt_handler || fast_interrupt) | ||
| 31 | + || ((interrupt_handler || fast_interrupt || break_handler) | ||
| 32 | && (regno == MB_ABI_ASM_TEMP_REGNUM | ||
| 33 | || regno == MB_ABI_EXCEPTION_RETURN_ADDR_REGNUM))) | ||
| 34 | return 1; | ||
| 35 | @@ -2274,9 +2274,6 @@ compute_frame_size (HOST_WIDE_INT size) | ||
| 36 | fast_interrupt = | ||
| 37 | microblaze_fast_interrupt_function_p (current_function_decl); | ||
| 38 | save_volatiles = microblaze_save_volatiles (current_function_decl); | ||
| 39 | - if (break_handler) | ||
| 40 | - interrupt_handler = break_handler; | ||
| 41 | - | ||
| 42 | gp_reg_size = 0; | ||
| 43 | mask = 0; | ||
| 44 | var_size = size; | ||
| 45 | @@ -3236,7 +3233,7 @@ microblaze_expand_prologue (void) | ||
| 46 | gen_rtx_PLUS (Pmode, stack_pointer_rtx, | ||
| 47 | const0_rtx)); | ||
| 48 | |||
| 49 | - if (interrupt_handler) | ||
| 50 | + if (interrupt_handler || break_handler) | ||
| 51 | /* Do not optimize in flow analysis. */ | ||
| 52 | MEM_VOLATILE_P (mem_rtx) = 1; | ||
| 53 | |||
| 54 | @@ -3347,12 +3344,12 @@ microblaze_expand_epilogue (void) | ||
| 55 | a load-use stall cycle :) This is also important to handle alloca. | ||
| 56 | (See comments for if (frame_pointer_needed) below. */ | ||
| 57 | |||
| 58 | - if (!crtl->is_leaf || interrupt_handler) | ||
| 59 | + if (!crtl->is_leaf || interrupt_handler || break_handler) | ||
| 60 | { | ||
| 61 | mem_rtx = | ||
| 62 | gen_rtx_MEM (Pmode, | ||
| 63 | gen_rtx_PLUS (Pmode, stack_pointer_rtx, const0_rtx)); | ||
| 64 | - if (interrupt_handler) | ||
| 65 | + if (interrupt_handler || break_handler) | ||
| 66 | /* Do not optimize in flow analysis. */ | ||
| 67 | MEM_VOLATILE_P (mem_rtx) = 1; | ||
| 68 | reg_rtx = gen_rtx_REG (Pmode, MB_ABI_SUB_RETURN_ADDR_REGNUM); | ||
| 69 | -- | ||
| 70 | 2.17.1 | ||
| 71 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-source_10.%.bbappend b/meta-microblaze/recipes-devtools/gcc/gcc-source_10.%.bbappend index 2fc9bced..16c845cd 100644 --- a/meta-microblaze/recipes-devtools/gcc/gcc-source_10.%.bbappend +++ b/meta-microblaze/recipes-devtools/gcc/gcc-source_10.%.bbappend | |||
| @@ -56,5 +56,6 @@ SRC_URI_append_microblaze = " \ | |||
| 56 | file://0052-Patch-microblaze-Add-TARGET_OPTION_OPTIMIZATION-and-.patch \ | 56 | file://0052-Patch-microblaze-Add-TARGET_OPTION_OPTIMIZATION-and-.patch \ |
| 57 | file://0053-Patch-microblaze-Reducing-Stack-space-for-arguments.patch \ | 57 | file://0053-Patch-microblaze-Reducing-Stack-space-for-arguments.patch \ |
| 58 | file://0054-Patch-MicroBlaze-Typo-in-the-previous-commits.bsefi-.patch \ | 58 | file://0054-Patch-MicroBlaze-Typo-in-the-previous-commits.bsefi-.patch \ |
| 59 | file://0055-Patch-MicroBlaze.patch \ | ||
| 59 | file://microblaze-mulitlib-hack.patch \ | 60 | file://microblaze-mulitlib-hack.patch \ |
| 60 | " | 61 | " |
