aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2014-09-01 22:25:09 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2014-09-01 22:25:09 +0000
commite3d59c5e7359daaaafcffed4e1c39d5558bca5a4 (patch)
treed54049a3a92f71270c04dfd9262b3e3bb1673c5b /gcc
parente04733ee53069a993a841bc0747c5c7290791230 (diff)
downloadgcc-e3d59c5e7359daaaafcffed4e1c39d5558bca5a4.zip
gcc-e3d59c5e7359daaaafcffed4e1c39d5558bca5a4.tar.gz
gcc-e3d59c5e7359daaaafcffed4e1c39d5558bca5a4.tar.bz2
re PR target/62312 ([SH] Invalid operands for opcode div0s)
gcc/ PR target/62312 * config/sh/sh.md (*cmp_div0s_0): Add missing constraints. gcc/testsuite/ PR target/62312 * gcc.c-torture/compile/pr62312.c: New. From-SVN: r214804
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.md4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr62312.c23
4 files changed, 35 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ce0f3bbe..f8aa0f3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-01 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/62312
+ * config/sh/sh.md (*cmp_div0s_0): Add missing constraints.
+
2014-09-01 Andi Kleen <ak@linux.intel.com>
* file-find.c (add_prefix_begin): Add.
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 3f92737..a715530 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -869,9 +869,9 @@
(define_insn "*cmp_div0s_0"
[(set (reg:SI T_REG)
- (eq:SI (lshiftrt:SI (match_operand:SI 0 "arith_reg_operand")
+ (eq:SI (lshiftrt:SI (match_operand:SI 0 "arith_reg_operand" "%r")
(const_int 31))
- (ge:SI (match_operand:SI 1 "arith_reg_operand")
+ (ge:SI (match_operand:SI 1 "arith_reg_operand" "r")
(const_int 0))))]
"TARGET_SH1"
"div0s %0,%1"
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 936bfac..7dcb6e7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-01 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/62312
+ * gcc.c-torture/compile/pr62312.c: New.
+
2014-09-01 Maciej W. Rozycki <macro@codesourcery.com>
* gcc.dg/tree-ssa/loop-19.c: Exclude classic FPU Power targets.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr62312.c b/gcc/testsuite/gcc.c-torture/compile/pr62312.c
new file mode 100644
index 0000000..2e87bb9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr62312.c
@@ -0,0 +1,23 @@
+/* PR target/62312 */
+
+typedef struct { unsigned int arg[100]; } *FunctionCallInfo;
+typedef struct { int day; int month; } Interval;
+void* palloc (unsigned int);
+int bar (void);
+void baz (void);
+
+void
+interval_pl (FunctionCallInfo fcinfo)
+{
+ Interval *span1 = ((Interval *) ((char *) ((fcinfo->arg[0]))));
+ Interval *span2 = ((Interval *) ((char *) ((fcinfo->arg[1]))));
+ Interval *result = (Interval *) palloc (sizeof (Interval));
+
+ if ((((span1->month) < 0) == ((span2->month) < 0))
+ && !(((result->month) < 0) == ((span1->month) < 0)))
+ do {
+ if (bar ())
+ baz ();
+ } while(0);
+ result->day = span1->day + span2->day;
+}