summaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/i386/i386.c')
-rw-r--r--gcc/config/i386/i386.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 42bf323855b..1da18964bd4 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "cgraph.h"
#include "gimple.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
#include "df.h"
#include "tm-constrs.h"
#include "params.h"
@@ -7421,18 +7421,18 @@ ix86_can_use_return_insn_p (void)
Zero means the frame pointer need not be set up (and parms may
be accessed via the stack pointer) in functions that seem suitable. */
-int
+static bool
ix86_frame_pointer_required (void)
{
/* If we accessed previous frames, then the generated code expects
to be able to access the saved ebp value in our frame. */
if (cfun->machine->accesses_prev_frame)
- return 1;
+ return true;
/* Several x86 os'es need a frame pointer for other reasons,
usually pertaining to setjmp. */
if (SUBTARGET_FRAME_POINTER_REQUIRED)
- return 1;
+ return true;
/* In override_options, TARGET_OMIT_LEAF_FRAME_POINTER turns off
the frame pointer by default. Turn it back on now if we've not
@@ -7440,12 +7440,12 @@ ix86_frame_pointer_required (void)
if (TARGET_OMIT_LEAF_FRAME_POINTER
&& (!current_function_is_leaf
|| ix86_current_function_calls_tls_descriptor))
- return 1;
+ return true;
if (crtl->profile)
- return 1;
+ return true;
- return 0;
+ return false;
}
/* Record that the current function accesses previous call frames. */
@@ -12760,7 +12760,7 @@ ix86_expand_move (enum machine_mode mode, rtx operands[])
op1 = force_reg (Pmode, op1);
else if (!TARGET_64BIT || !x86_64_movabs_operand (op1, Pmode))
{
- rtx reg = !can_create_pseudo_p () ? op0 : NULL_RTX;
+ rtx reg = can_create_pseudo_p () ? NULL_RTX : op0;
op1 = legitimize_pic_address (op1, reg);
if (op0 == op1)
return;
@@ -19389,7 +19389,7 @@ memory_address_length (rtx addr)
len = 4;
}
/* ebp always wants a displacement. Similarly r13. */
- else if (REG_P (base)
+ else if (base && REG_P (base)
&& (REGNO (base) == BP_REG || REGNO (base) == R13_REG))
len = 1;
@@ -19398,7 +19398,7 @@ memory_address_length (rtx addr)
/* ...like esp (or r12), which always wants an index. */
|| base == arg_pointer_rtx
|| base == frame_pointer_rtx
- || (REG_P (base)
+ || (base && REG_P (base)
&& (REGNO (base) == SP_REG || REGNO (base) == R12_REG)))
len += 1;
}
@@ -30525,6 +30525,9 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree)
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P ix86_legitimate_address_p
+#undef TARGET_FRAME_POINTER_REQUIRED
+#define TARGET_FRAME_POINTER_REQUIRED ix86_frame_pointer_required
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-i386.h"