OSDN Git Service

2003-10-13 Eric Christopher <echristo@redhat.com>
authorechristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Oct 2003 08:39:24 +0000 (08:39 +0000)
committerechristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Oct 2003 08:39:24 +0000 (08:39 +0000)
* config/frv/frv.c (frv_adjust_field_align): Redo check for
too wide bitfields.
(frv_hard_regno_mode_ok): Add SPR_P and AP_FIRST.
* config/frv/frv.h (FUNCTION_PROFILER): Remove abort call.
(SBSS_SECTION_ASM_OP): Remove.
(EXTRA_SECTIONS): Remove in_sbss.
(EXTRA_SECTION_FUNCTIONS): Remove SBSS_SECTION_FUNCTION.
(SBSS_SECTION_FUNCTION, sbss_section): Remove.
(ASM_OUTPUT_ALIGNED_DECL_LOCAL): Change sbss_section to
named_section.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72463 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/frv/frv.c
gcc/config/frv/frv.h

index 0a68b5a..84a2355 100644 (file)
@@ -1,3 +1,16 @@
+2003-10-13  Eric Christopher  <echristo@redhat.com>
+
+       * config/frv/frv.c (frv_adjust_field_align): Redo check for
+       too wide bitfields.
+       (frv_hard_regno_mode_ok): Add SPR_P and AP_FIRST.
+       * config/frv/frv.h (FUNCTION_PROFILER): Remove abort call.
+       (SBSS_SECTION_ASM_OP): Remove.
+       (EXTRA_SECTIONS): Remove in_sbss.
+       (EXTRA_SECTION_FUNCTIONS): Remove SBSS_SECTION_FUNCTION.
+       (SBSS_SECTION_FUNCTION, sbss_section): Remove.
+       (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Change sbss_section to
+       named_section.
+
 2003-10-13  Nathanael Nerode  <neroden@gcc.gnu.org>
 
        * Makefile.in, configure.in, config.host, mkheaders.in: Replace
index c9eab11..a9debdf 100644 (file)
@@ -1469,7 +1469,7 @@ frv_frame_insn (pattern, dwarf_pattern)
    simply be the stack pointer, but if several accesses are being made to a
    region far away from the stack pointer, it may be more efficient to set
    up a temporary instead.
-   
+
    Store instructions will be frame-related and will be annotated with the
    overall effect of the store.  Load instructions will be followed by a
    (use) to prevent later optimizations from zapping them.
@@ -1566,7 +1566,7 @@ frv_frame_access_standard_regs (op, info)
   frv_frame_access_multi (&accessor, info, STACK_REGS_GPR);
   frv_frame_access_multi (&accessor, info, STACK_REGS_FPR);
   frv_frame_access_multi (&accessor, info, STACK_REGS_LCR);
-}  
+}
 
 
 /* Called after register allocation to add any instructions needed for the
@@ -6933,7 +6933,7 @@ frv_ifcvt_modify_multiple_tests (ce_info, bb, p_true, p_false)
 
   if (GET_CODE (cr) != REG)
     goto fail;
-      
+
   if (mode == CCmode || mode == CC_UNSmode)
     {
       cr_class = ICR_REGS;
@@ -7794,15 +7794,17 @@ frv_adjust_field_align (field, computed)
      tree field;
      int computed;
 {
-  /* C++ provides a null DECL_CONTEXT if the bit field is wider than its
-     type.  */
-  if (DECL_BIT_FIELD (field) && DECL_CONTEXT (field))
+
+  tree type = TREE_TYPE (field);
+
+  /* Make sure that the bitfield is not wider than the type.  */
+  if (DECL_BIT_FIELD (field)
+      && tree_int_cst_compare (DECL_SIZE (field), TYPE_SIZE (type)) <= 0)
     {
       tree parent = DECL_CONTEXT (field);
       tree prev = NULL_TREE;
       tree cur;
 
-      /* Loop finding the previous field to the current one */
       for (cur = TYPE_FIELDS (parent); cur && cur != field; cur = TREE_CHAIN (cur))
        {
          if (TREE_CODE (cur) != FIELD_DECL)
@@ -7925,8 +7927,8 @@ frv_hard_regno_mode_ok (regno, mode)
        }
       else
        {
-         /* The other registers store one word.  */
-         if (GPR_P (regno))
+          /* The other registers store one word.  */
+         if (GPR_P (regno) || regno == AP_FIRST)
            base = GPR_FIRST;
 
          else if (FPR_P (regno))
@@ -7935,6 +7937,10 @@ frv_hard_regno_mode_ok (regno, mode)
          else if (ACC_P (regno))
            base = ACC_FIRST;
 
+         else if (SPR_P (regno))
+           return mode == SImode;
+
+         /* Fill in the table. */
          else
            return 0;
 
@@ -9075,7 +9081,7 @@ frv_init_builtins ()
   def_builtin ("__MPACKH", uw1_ftype_uh_uh, FRV_BUILTIN_MPACKH);
   def_builtin ("__MUNPACKH", uw2_ftype_uw1, FRV_BUILTIN_MUNPACKH);
   def_builtin ("__MDPACKH", uw2_ftype_uw2_uw2, FRV_BUILTIN_MDPACKH);
-  def_builtin ("__MDUNPACKH", void_ftype_uw4_uw2, FRV_BUILTIN_MDUNPACKH); 
+  def_builtin ("__MDUNPACKH", void_ftype_uw4_uw2, FRV_BUILTIN_MDUNPACKH);
   def_builtin ("__MBTOH", uw2_ftype_uw1, FRV_BUILTIN_MBTOH);
   def_builtin ("__MHTOB", uw1_ftype_uw2, FRV_BUILTIN_MHTOB);
   def_builtin ("__MBTOHE", void_ftype_uw4_uw1, FRV_BUILTIN_MBTOHE);
index cd8019f..2f958da 100644 (file)
@@ -2076,7 +2076,7 @@ struct machine_function GTY(())
    This declaration must be present, but it can be an abort if profiling is
    not implemented.  */
 
-#define FUNCTION_PROFILER(FILE, LABELNO) abort ()
+#define FUNCTION_PROFILER(FILE, LABELNO)
 
 \f
 /* Implementing the Varargs Macros.  */
@@ -2522,7 +2522,6 @@ __asm__("\n"                                                              \
 
 /* Short Data Support */
 #define SDATA_SECTION_ASM_OP   "\t.section .sdata,\"aw\""
-#define SBSS_SECTION_ASM_OP    "\t.section .sbss,\"aw\""
 
 /* On svr4, we *do* have support for the .init and .fini sections, and we
    can put stuff in there to be executed before and after `main'.  We let
@@ -2553,7 +2552,7 @@ __asm__("\n"                                                              \
    `in_text' and `in_data'.  You need not define this macro
    on a system with no other sections (that GCC needs to use).  */
 #undef  EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_sdata, in_sbss, in_const, in_fixup
+#define EXTRA_SECTIONS in_sdata, in_const, in_fixup
 
 /* One or more functions to be defined in "varasm.c".  These
    functions should do jobs analogous to those of `text_section' and
@@ -2562,7 +2561,6 @@ __asm__("\n"                                                              \
 #undef  EXTRA_SECTION_FUNCTIONS
 #define EXTRA_SECTION_FUNCTIONS                                         \
        SDATA_SECTION_FUNCTION                                          \
-       SBSS_SECTION_FUNCTION                                           \
        FIXUP_SECTION_FUNCTION
 
 #define SDATA_SECTION_FUNCTION                                         \
@@ -2576,17 +2574,6 @@ sdata_section ()                                                 \
     }                                                                  \
 }
 
-#define SBSS_SECTION_FUNCTION                                          \
-void                                                                   \
-sbss_section ()                                                                \
-{                                                                      \
-  if (in_section != in_sbss)                                           \
-    {                                                                  \
-      fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP);             \
-      in_section = in_sbss;                                            \
-    }                                                                  \
-}
-
 #define FIXUP_SECTION_FUNCTION                                         \
 void                                                                   \
 fixup_section ()                                                       \
@@ -2682,7 +2669,7 @@ extern int size_directive_output;
 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGN) \
 do {                                                                           \
   if ((SIZE) > 0 && (SIZE) <= g_switch_value)                          \
-    sbss_section ();                                                   \
+    named_section (0, ".sbss", 0);                                     \
   else                                                                         \
     bss_section ();                                                    \
   ASM_OUTPUT_ALIGN (STREAM, floor_log2 ((ALIGN) / BITS_PER_UNIT));             \