summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/gcc/gcc-12/0052-Patch-MicroBlaze.patch
blob: 63feff7997434045ee61de629df15ecd18a5e7d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
From fe2781d189493dc82a3714b48bbc12c6bd5cdfd0 Mon Sep 17 00:00:00 2001
From: Mahesh Bodapati <mbodapat@xilinx.com>
Date: Tue, 13 Sep 2022 16:38:43 +0530
Subject: [PATCH 52/53] [Patch,MicroBlaze] :     If we use break_handler
 attribute then interrupt vector call happened     to break_handler instead of
 interrupt_handler.     this fix will resolve the issue CR-1081780.     This
 fix will not change the behavior of compiler unless there is a usage of
 break_handler attribute. 	signed-off-by : Mahesh Bodapati
 <mbodapat@xilinx.com>

Upstream-Status: Pending

Signed-off-by: Mark Hatle <mark.hatle@amd.com>

---
 gcc/config/microblaze/microblaze.cc | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/gcc/config/microblaze/microblaze.cc b/gcc/config/microblaze/microblaze.cc
index 24ac215b6d5..66d62f6f909 100644
--- a/gcc/config/microblaze/microblaze.cc
+++ b/gcc/config/microblaze/microblaze.cc
@@ -2020,7 +2020,7 @@ microblaze_save_volatiles (tree func)
 int
 microblaze_is_interrupt_variant (void)
 {
-  return (interrupt_handler || fast_interrupt);
+  return (interrupt_handler || fast_interrupt || break_handler);
 }
 int
 microblaze_is_break_handler (void)
@@ -2059,7 +2059,7 @@ microblaze_must_save_register (int regno)
     {
       if (df_regs_ever_live_p (regno) 
 	  || regno == MB_ABI_MSR_SAVE_REG
-	  || ((interrupt_handler || fast_interrupt)
+	  || ((interrupt_handler || fast_interrupt || break_handler)
               && (regno == MB_ABI_ASM_TEMP_REGNUM
 	          || regno == MB_ABI_EXCEPTION_RETURN_ADDR_REGNUM)))
 	return 1;
@@ -2275,9 +2275,6 @@ compute_frame_size (HOST_WIDE_INT size)
   fast_interrupt =
     microblaze_fast_interrupt_function_p (current_function_decl);
   save_volatiles = microblaze_save_volatiles (current_function_decl);
-  if (break_handler)
-    interrupt_handler = break_handler;
-
   gp_reg_size = 0;
   mask = 0;
   var_size = size;
@@ -3237,7 +3234,7 @@ microblaze_expand_prologue (void)
 				 gen_rtx_PLUS (Pmode, stack_pointer_rtx,
 					       const0_rtx));
 
-	  if (interrupt_handler)
+	  if (interrupt_handler || break_handler)
 	    /* Do not optimize in flow analysis.  */
 	    MEM_VOLATILE_P (mem_rtx) = 1;
 
@@ -3348,12 +3345,12 @@ microblaze_expand_epilogue (void)
          a load-use stall cycle  :)   This is also important to handle alloca. 
          (See comments for if (frame_pointer_needed) below.  */
 
-      if (!crtl->is_leaf || interrupt_handler)
+      if (!crtl->is_leaf || interrupt_handler || break_handler)
 	{
 	  mem_rtx =
 	    gen_rtx_MEM (Pmode,
 			 gen_rtx_PLUS (Pmode, stack_pointer_rtx, const0_rtx));
-	  if (interrupt_handler)
+	  if (interrupt_handler || break_handler)
 	    /* Do not optimize in flow analysis.  */
 	    MEM_VOLATILE_P (mem_rtx) = 1;
 	  reg_rtx = gen_rtx_REG (Pmode, MB_ABI_SUB_RETURN_ADDR_REGNUM);
-- 
2.37.1 (Apple Git-137.1)