to allow identical far pointers to remain.
tests * gcc.target/rl78: New directory.
* gcc.target/rl78/rl78.exp: New file: Test driver.
* gcc.target/rl78/test_addm3.c: New file: Test adds.
From-SVN: r226624
+2015-08-05 Nick Clifton <nickc@redhat.com>
+
+ * config/rl78/rl78.c (rl78_force_nonfar_3): Remove optimization
+ to allow identical far pointers to remain.
+
2015-08-05 Richard Biener <rguenther@suse.de>
PR middle-end/67120
int did = 0;
rtx temp_reg = NULL;
- /* As an exception, we allow two far operands if they're identical
- and the third operand is not a MEM. This allows global variables
- to be incremented, for example. */
- if (rtx_equal_p (operands[0], operands[1])
- && ! MEM_P (operands[2]))
- return 0;
-
/* FIXME: Likewise. */
if (rl78_far_p (operands[1]))
{
+2015-08-05 Nick Clifton <nickc@redhat.com>
+
+ * gcc.target/rl78: New directory.
+ * gcc.target/rl78/rl78.exp: New file: Test driver.
+ * gcc.target/rl78/test_addm3.c: New file: Test adds.
+
2015-08-05 Richard Biener <rguenther@suse.de>
PR middle-end/67120
--- /dev/null
+# Copyright (C) 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't the right target.
+if { ![istarget rl78-*-*] } then {
+ return
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS ""
+}
+
+# Initialize `dg'.
+dg-init
+
+# Find all tests
+set tests [lsort [find $srcdir/$subdir *.\[cS\]]]
+
+# Main loop.
+gcc-dg-runtest $tests "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
--- /dev/null
+/* Remove `-ansi' from options to enable the use of __far and long long. */\r
+/* { dg-options "" } */\r
+\r
+#define ADD(TYPE, name) \\r
+ TYPE \\r
+ add##name(TYPE a, TYPE b) \\r
+ { \\r
+ return a + b; \\r
+ } \\r
+ \r
+#define ADDIMM(TYPE, name) \\r
+ TYPE \\r
+ addimm##name(TYPE a) \\r
+ { \\r
+ return a + 50; \\r
+ } \\r
+\r
+#define ADDFAR(TYPE, name) \\r
+ TYPE __far gf##name; \\r
+ void \\r
+ addfar##name(TYPE __far *pa, TYPE b) \\r
+ { \\r
+ gf##name += b; \\r
+ *pa += 50; \\r
+ } \\r
+ \r
+\r
+ADD (char, qi3)\r
+ADD (int, hi3)\r
+ADD (long, si3)\r
+ADD (long long, di3)\r
+ADD (float, sf3)\r
+ADD (double, df3)\r
+\r
+ADDIMM (char, qi3)\r
+ADDIMM (int, hi3)\r
+ADDIMM (long, si3)\r
+ADDIMM (long long, di3)\r
+ADDIMM (float, sf3)\r
+ADDIMM (double, df3)\r
+\r
+ADDFAR (char, qi3)\r
+ADDFAR (int, hi3)\r
+ADDFAR (long, si3)\r
+ADDFAR (long long, di3)\r
+ADDFAR (float, sf3)\r
+ADDFAR (double, df3)\r
+\r
+char aqi1, aqi2;\r
+int ahi1, ahi2;\r
+long asi1, asi2;\r
+long long adi1, adi2;\r
+float af1, af2;\r
+double ad1, ad2;\r
+\r
+void\r
+testglobal (void)\r
+{\r
+ aqi1 += aqi2;\r
+ ahi1 += ahi2;\r
+ asi1 += asi2;\r
+ adi1 += adi2;\r
+ af1 += af2;\r
+ ad1 += ad2;\r
+}\r
+\r
+void\r
+testglobal2 (void)\r
+{\r
+ aqi1 += 10;\r
+ ahi1 += 11;\r
+ asi1 += 12;\r
+ adi1 += 13;\r
+ af1 += 2.0;\r
+ ad1 += 4.0;\r
+}\r
+\r
+void\r
+testptr (char *aqi1, int *ahi1, long *asi1, long long *adi1, float *af1, double *ad1, \r
+ char *aqi2, int *ahi2, long *asi2, long long *adi2, float *af2, double *ad2)\r
+{\r
+ *aqi1 += *aqi2;\r
+ *ahi1 += *ahi2;\r
+ *asi1 += *asi2;\r
+ *adi1 += *adi2;\r
+ *af1 += *af2;\r
+ *ad1 += *ad2;\r
+}\r
+\r
+void\r
+testptr2 (char *aqi1, int *ahi1, long *asi1, long long *adi1, float *af1, double *ad1)\r
+{\r
+ *aqi1 += 5;\r
+ *ahi1 += 10;\r
+ *asi1 += 11;\r
+ *adi1 += 12;\r
+ *af1 += 4.5;\r
+ *ad1 += 5.5;\r
+}\r
extern float _COM_SUBf (float, float);
extern float _COM_MULf (float, float);
extern float _COM_DIVf (float, float);
+
+#ifdef __RX_64BIT_DOUBLES__
+extern int _COM_CMPLTf (double, double);
+extern int _COM_CMPGTf (double, double);
+extern int _COM_CMPLEf (double, double);
+extern int _COM_CMPGEf (double, double);
+extern int _COM_CMPEQf (double, double);
+extern int _COM_CMPNEf (double, double);
+#else
extern int _COM_CMPLTf (float, float);
+extern int _COM_CMPGTf (float, float);
+extern int _COM_CMPLEf (float, float);
+extern int _COM_CMPGEf (float, float);
+extern int _COM_CMPEQf (float, float);
+extern int _COM_CMPNEf (float, float);
+#endif
+
+extern int _COM_CMPLTd (double, double);
+extern int _COM_CMPGTd (double, double);
+extern int _COM_CMPLEd (double, double);
+extern int _COM_CMPGEd (double, double);
+extern int _COM_CMPEQd (double, double);
+extern int _COM_CMPNEd (double, double);
extern long long _COM_MUL64 (long long, long long);
extern signed long long _COM_DIV64s (long long, long long);