Fix PR debug/60655 part 2.

2014-04-10  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

        PR debug/60655
        * config/arm/arm.c (TARGET_CONST_NOT_OK_FOR_DEBUG_P): Define
        (arm_const_not_ok_for_debug_p): Reject MINUS with SYM_REF's
        ameliorating the cases where it can be.

2014-04-10  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

        PR debug/60655
        * gcc.c-torture/compile/pr60655-2.c: Copy from pr60655-1.c without
        -fdata-sections.

From-SVN: r209269
This commit is contained in:
Ramana Radhakrishnan 2014-04-10 08:13:30 +00:00 committed by Ramana Radhakrishnan
parent 9e837b7f5d
commit b322c36a1a
4 changed files with 89 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2014-04-10 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR debug/60655
* config/arm/arm.c (TARGET_CONST_NOT_OK_FOR_DEBUG_P): Define
(arm_const_not_ok_for_debug_p): Reject MINUS with SYM_REF's
ameliorating the cases where it can be.
2014-04-09 David Edelsohn <dje.gcc@gmail.com>
Revert

View File

@ -72,6 +72,7 @@ struct four_ints
};
/* Forward function declarations. */
static bool arm_const_not_ok_for_debug_p (rtx);
static bool arm_lra_p (void);
static bool arm_needs_doubleword_align (enum machine_mode, const_tree);
static int arm_compute_static_chain_stack_bytes (void);
@ -674,6 +675,9 @@ static const struct attribute_spec arm_attribute_table[] =
#undef TARGET_CAN_USE_DOLOOP_P
#define TARGET_CAN_USE_DOLOOP_P can_use_doloop_if_innermost
#undef TARGET_CONST_NOT_OK_FOR_DEBUG_P
#define TARGET_CONST_NOT_OK_FOR_DEBUG_P arm_const_not_ok_for_debug_p
struct gcc_target targetm = TARGET_INITIALIZER;
/* Obstack for minipool constant handling. */
@ -31116,4 +31120,46 @@ arm_asan_shadow_offset (void)
return (unsigned HOST_WIDE_INT) 1 << 29;
}
/* This is a temporary fix for PR60655. Ideally we need
to handle most of these cases in the generic part but
currently we reject minus (..) (sym_ref). We try to
ameliorate the case with minus (sym_ref1) (sym_ref2)
where they are in the same section. */
static bool
arm_const_not_ok_for_debug_p (rtx p)
{
tree decl_op0 = NULL;
tree decl_op1 = NULL;
if (GET_CODE (p) == MINUS)
{
if (GET_CODE (XEXP (p, 1)) == SYMBOL_REF)
{
decl_op1 = SYMBOL_REF_DECL (XEXP (p, 1));
if (decl_op1
&& GET_CODE (XEXP (p, 0)) == SYMBOL_REF
&& (decl_op0 = SYMBOL_REF_DECL (XEXP (p, 0))))
{
if ((TREE_CODE (decl_op1) == VAR_DECL
|| TREE_CODE (decl_op1) == CONST_DECL)
&& (TREE_CODE (decl_op0) == VAR_DECL
|| TREE_CODE (decl_op0) == CONST_DECL))
return (get_variable_section (decl_op1, false)
!= get_variable_section (decl_op0, false));
if (TREE_CODE (decl_op1) == LABEL_DECL
&& TREE_CODE (decl_op0) == LABEL_DECL)
return (DECL_CONTEXT (decl_op1)
!= DECL_CONTEXT (decl_op0));
}
return true;
}
}
return false;
}
#include "gt-arm.h"

View File

@ -1,3 +1,9 @@
2014-04-10 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR debug/60655
* gcc.c-torture/compile/pr60655-2.c: Copy from pr60655-1.c without
-fdata-sections.
2014-04-09 Steve Ellcey <sellcey@mips.com>
* gcc.dg/tree-ssa/ssa-ifcombine-13.c: Remove mips*-*-* from option

View File

@ -0,0 +1,30 @@
typedef unsigned char unit;
typedef unit *unitptr;
extern short global_precision;
typedef __SIZE_TYPE__ size_t;
extern void *memcpy (void *dest, const void *src, size_t n);
short mp_compare(const unit* r1, const unit* r2)
{
register short precision;
precision = global_precision;
(r1) = ((r1)+(precision)-1);
(r2) = ((r2)+(precision)-1);
do
{ if (*r1 < *r2)
return(-1);
if (*((r1)--) > *((r2)--))
return(1);
} while (--precision);
}
static unit modulus[((1280+(2*8))/8)];
static unit d_data[((1280+(2*8))/8)*2];
int upton_modmult (unitptr prod, unitptr multiplicand, unitptr multiplier)
{
unitptr d = d_data;
while (mp_compare(d,modulus) > 0)
memcpy((void*)(prod), (const void*)(d), (global_precision));
}