+2015-07-05 Chung-Lin Tang <cltang@codesourcery.com>
+ Sandra Loosemore <sandra@codesourcery.com>
+
+ * config/nios2/nios2-protos.h (nios2_symbol_ref_in_small_data_p):
+ Delete extern declaration.
+ (gprel_constant_p): Add extern declaration.
+ * config/nios2/constraints.md ("S"): Use gprel_constant_p
+ instead of nios2_symbol_ref_in_small_data_p.
+ * config/nios2/nios2.c (nios2_legitimate_address_p): Likewise.
+ (nios2_symbol_ref_in_small_data_p): Make static.
+ (gprel_constant_p): Make non-static.
+
2015-07-05 Gerald Pfeifer <gerald@pfeifer.com>
* doc/fragments.texi (Target Fragment): Convert debian.org
(define_constraint "S"
"An immediate stored in small data, accessible by GP."
- (and (match_code "symbol_ref")
- (match_test "nios2_symbol_ref_in_small_data_p (op)")))
+ (match_test "gprel_constant_p (op)"))
(define_constraint "T"
"A constant unspec offset representing a relocation."
extern const char * nios2_fpu_insn_asm (enum n2fpu_code);
extern bool nios2_legitimate_pic_operand_p (rtx);
-extern bool nios2_symbol_ref_in_small_data_p (rtx);
+extern bool gprel_constant_p (rtx);
extern bool nios2_regno_ok_for_base_p (int, bool);
extern bool nios2_unspec_reloc_p (rtx);
case SYMBOL_REF:
if (SYMBOL_REF_TLS_MODEL (operand))
return false;
-
- if (nios2_symbol_ref_in_small_data_p (operand))
+
+ /* Else, fall through. */
+ case CONST:
+ if (gprel_constant_p (operand))
return true;
/* Else, fall through. */
case LABEL_REF:
case CONST_INT:
- case CONST:
case CONST_DOUBLE:
return false;
/* Return true if symbol is in small data section. */
-bool
+static bool
nios2_symbol_ref_in_small_data_p (rtx sym)
{
tree decl;
}
/* Return true if this is a GP-relative accessible reference. */
-static bool
+bool
gprel_constant_p (rtx op)
{
if (GET_CODE (op) == SYMBOL_REF
+2015-07-05 Chung-Lin Tang <cltang@codesourcery.com>
+ Sandra Loosemore <sandra@codesourcery.com>
+
+ * gcc.target/nios2/gprel-offset.c: New test.
+
2015-07-04 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66725
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+static struct s {
+ int x;
+ char y;
+} s;
+
+void set (char c)
+{
+ s.y = c;
+}
+
+
+char get (void)
+{
+ return s.y;
+}
+
+/* { dg-final { scan-assembler-times "%gprel\\(s\\+4\\)\\(gp\\)" 2 } } */