Commit b16c1435 by Eric Christopher Committed by Eric Christopher

frv.c (frv_adjust_field_align): Redo check for too wide bitfields.

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.

From-SVN: r72463
parent 5a167978
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> 2003-10-13 Nathanael Nerode <neroden@gcc.gnu.org>
* Makefile.in, configure.in, config.host, mkheaders.in: Replace * Makefile.in, configure.in, config.host, mkheaders.in: Replace
......
...@@ -1469,7 +1469,7 @@ frv_frame_insn (pattern, dwarf_pattern) ...@@ -1469,7 +1469,7 @@ frv_frame_insn (pattern, dwarf_pattern)
simply be the stack pointer, but if several accesses are being made to a 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 region far away from the stack pointer, it may be more efficient to set
up a temporary instead. up a temporary instead.
Store instructions will be frame-related and will be annotated with the Store instructions will be frame-related and will be annotated with the
overall effect of the store. Load instructions will be followed by a overall effect of the store. Load instructions will be followed by a
(use) to prevent later optimizations from zapping them. (use) to prevent later optimizations from zapping them.
...@@ -1566,7 +1566,7 @@ frv_frame_access_standard_regs (op, info) ...@@ -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_GPR);
frv_frame_access_multi (&accessor, info, STACK_REGS_FPR); frv_frame_access_multi (&accessor, info, STACK_REGS_FPR);
frv_frame_access_multi (&accessor, info, STACK_REGS_LCR); frv_frame_access_multi (&accessor, info, STACK_REGS_LCR);
} }
/* Called after register allocation to add any instructions needed for the /* 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) ...@@ -6933,7 +6933,7 @@ frv_ifcvt_modify_multiple_tests (ce_info, bb, p_true, p_false)
if (GET_CODE (cr) != REG) if (GET_CODE (cr) != REG)
goto fail; goto fail;
if (mode == CCmode || mode == CC_UNSmode) if (mode == CCmode || mode == CC_UNSmode)
{ {
cr_class = ICR_REGS; cr_class = ICR_REGS;
...@@ -7794,15 +7794,17 @@ frv_adjust_field_align (field, computed) ...@@ -7794,15 +7794,17 @@ frv_adjust_field_align (field, computed)
tree field; tree field;
int computed; int computed;
{ {
/* C++ provides a null DECL_CONTEXT if the bit field is wider than its
type. */ tree type = TREE_TYPE (field);
if (DECL_BIT_FIELD (field) && DECL_CONTEXT (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 parent = DECL_CONTEXT (field);
tree prev = NULL_TREE; tree prev = NULL_TREE;
tree cur; tree cur;
/* Loop finding the previous field to the current one */
for (cur = TYPE_FIELDS (parent); cur && cur != field; cur = TREE_CHAIN (cur)) for (cur = TYPE_FIELDS (parent); cur && cur != field; cur = TREE_CHAIN (cur))
{ {
if (TREE_CODE (cur) != FIELD_DECL) if (TREE_CODE (cur) != FIELD_DECL)
...@@ -7925,8 +7927,8 @@ frv_hard_regno_mode_ok (regno, mode) ...@@ -7925,8 +7927,8 @@ frv_hard_regno_mode_ok (regno, mode)
} }
else else
{ {
/* The other registers store one word. */ /* The other registers store one word. */
if (GPR_P (regno)) if (GPR_P (regno) || regno == AP_FIRST)
base = GPR_FIRST; base = GPR_FIRST;
else if (FPR_P (regno)) else if (FPR_P (regno))
...@@ -7935,6 +7937,10 @@ frv_hard_regno_mode_ok (regno, mode) ...@@ -7935,6 +7937,10 @@ frv_hard_regno_mode_ok (regno, mode)
else if (ACC_P (regno)) else if (ACC_P (regno))
base = ACC_FIRST; base = ACC_FIRST;
else if (SPR_P (regno))
return mode == SImode;
/* Fill in the table. */
else else
return 0; return 0;
...@@ -9075,7 +9081,7 @@ frv_init_builtins () ...@@ -9075,7 +9081,7 @@ frv_init_builtins ()
def_builtin ("__MPACKH", uw1_ftype_uh_uh, FRV_BUILTIN_MPACKH); def_builtin ("__MPACKH", uw1_ftype_uh_uh, FRV_BUILTIN_MPACKH);
def_builtin ("__MUNPACKH", uw2_ftype_uw1, FRV_BUILTIN_MUNPACKH); def_builtin ("__MUNPACKH", uw2_ftype_uw1, FRV_BUILTIN_MUNPACKH);
def_builtin ("__MDPACKH", uw2_ftype_uw2_uw2, FRV_BUILTIN_MDPACKH); 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 ("__MBTOH", uw2_ftype_uw1, FRV_BUILTIN_MBTOH);
def_builtin ("__MHTOB", uw1_ftype_uw2, FRV_BUILTIN_MHTOB); def_builtin ("__MHTOB", uw1_ftype_uw2, FRV_BUILTIN_MHTOB);
def_builtin ("__MBTOHE", void_ftype_uw4_uw1, FRV_BUILTIN_MBTOHE); def_builtin ("__MBTOHE", void_ftype_uw4_uw1, FRV_BUILTIN_MBTOHE);
......
...@@ -2076,7 +2076,7 @@ struct machine_function GTY(()) ...@@ -2076,7 +2076,7 @@ struct machine_function GTY(())
This declaration must be present, but it can be an abort if profiling is This declaration must be present, but it can be an abort if profiling is
not implemented. */ not implemented. */
#define FUNCTION_PROFILER(FILE, LABELNO) abort () #define FUNCTION_PROFILER(FILE, LABELNO)
/* Implementing the Varargs Macros. */ /* Implementing the Varargs Macros. */
...@@ -2522,7 +2522,6 @@ __asm__("\n" \ ...@@ -2522,7 +2522,6 @@ __asm__("\n" \
/* Short Data Support */ /* Short Data Support */
#define SDATA_SECTION_ASM_OP "\t.section .sdata,\"aw\"" #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 /* 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 can put stuff in there to be executed before and after `main'. We let
...@@ -2553,7 +2552,7 @@ __asm__("\n" \ ...@@ -2553,7 +2552,7 @@ __asm__("\n" \
`in_text' and `in_data'. You need not define this macro `in_text' and `in_data'. You need not define this macro
on a system with no other sections (that GCC needs to use). */ on a system with no other sections (that GCC needs to use). */
#undef EXTRA_SECTIONS #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 /* One or more functions to be defined in "varasm.c". These
functions should do jobs analogous to those of `text_section' and functions should do jobs analogous to those of `text_section' and
...@@ -2562,7 +2561,6 @@ __asm__("\n" \ ...@@ -2562,7 +2561,6 @@ __asm__("\n" \
#undef EXTRA_SECTION_FUNCTIONS #undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \ #define EXTRA_SECTION_FUNCTIONS \
SDATA_SECTION_FUNCTION \ SDATA_SECTION_FUNCTION \
SBSS_SECTION_FUNCTION \
FIXUP_SECTION_FUNCTION FIXUP_SECTION_FUNCTION
#define SDATA_SECTION_FUNCTION \ #define SDATA_SECTION_FUNCTION \
...@@ -2576,17 +2574,6 @@ sdata_section () \ ...@@ -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 \ #define FIXUP_SECTION_FUNCTION \
void \ void \
fixup_section () \ fixup_section () \
...@@ -2682,7 +2669,7 @@ extern int size_directive_output; ...@@ -2682,7 +2669,7 @@ extern int size_directive_output;
#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGN) \ #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGN) \
do { \ do { \
if ((SIZE) > 0 && (SIZE) <= g_switch_value) \ if ((SIZE) > 0 && (SIZE) <= g_switch_value) \
sbss_section (); \ named_section (0, ".sbss", 0); \
else \ else \
bss_section (); \ bss_section (); \
ASM_OUTPUT_ALIGN (STREAM, floor_log2 ((ALIGN) / BITS_PER_UNIT)); \ ASM_OUTPUT_ALIGN (STREAM, floor_log2 ((ALIGN) / BITS_PER_UNIT)); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment