summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/gcc/gcc-13/0052-If-we-use-break_handler-attribute-then-interrupt-vec.patch
blob: d0474dd95cf02b3852a401ac1b5c058fc1eb9cb2 (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
From b792943436857172e7a39e26a00602c7e6620860 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/54] 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>

---
 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 e6d3f35370c..58d091fbed2 100644
--- a/gcc/config/microblaze/microblaze.cc
+++ b/gcc/config/microblaze/microblaze.cc
@@ -2025,7 +2025,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)
@@ -2064,7 +2064,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;
@@ -2280,9 +2280,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;
@@ -3242,7 +3239,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;
 
@@ -3353,12 +3350,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.34.1