aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-03-30 11:00:12 -0800
committerRichard Henderson <rth@gcc.gnu.org>2003-03-30 11:00:12 -0800
commit5bf92e20913144dd2f78754dd76310e75786e478 (patch)
tree43e341af707a7ff467e050b4e291a0d902698955
parent438f63a80d960df11deb432ee840decd3e4ae713 (diff)
downloadgcc-5bf92e20913144dd2f78754dd76310e75786e478.zip
gcc-5bf92e20913144dd2f78754dd76310e75786e478.tar.gz
gcc-5bf92e20913144dd2f78754dd76310e75786e478.tar.bz2
re PR c/10083 (alpha: ICE while building swi-prolog-packages)
PR c/10083 * config/alpha/alpha.md (umuldi3_highpart): Change to expander; don't zero_extend const inputs. * gcc.c-torture/compile/20030330-1.c: New. From-SVN: r65047
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/alpha/alpha.md22
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030330-1.c7
3 files changed, 31 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c38187b..7c5433c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-03-30 Richard Henderson <rth@redhat.com>
+
+ PR c/10083
+ * config/alpha/alpha.md (umuldi3_highpart): Change to expander;
+ don't zero_extend const inputs.
+
2003-03-30 Kazu Hirata <kazu@cs.umass.edu>
* reload1.c (reload_cse_move2add): Fix a comment typo.
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index b4518df..8ae7aca 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -750,17 +750,31 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
"mulqv %r1,%2,%0"
[(set_attr "type" "imul")])
-(define_insn "umuldi3_highpart"
+(define_expand "umuldi3_highpart"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (truncate:DI
+ (lshiftrt:TI
+ (mult:TI (zero_extend:TI
+ (match_operand:DI 1 "register_operand" ""))
+ (match_operand:DI 2 "reg_or_8bit_operand" ""))
+ (const_int 64))))]
+ ""
+{
+ if (REG_P (operands[2]))
+ operands[2] = gen_rtx_ZERO_EXTEND (TImode, operands[2]);
+})
+
+(define_insn "*umuldi3_highpart_reg"
[(set (match_operand:DI 0 "register_operand" "=r")
(truncate:DI
(lshiftrt:TI
(mult:TI (zero_extend:TI
- (match_operand:DI 1 "reg_or_0_operand" "%rJ"))
+ (match_operand:DI 1 "register_operand" "r"))
(zero_extend:TI
- (match_operand:DI 2 "reg_or_8bit_operand" "rI")))
+ (match_operand:DI 2 "register_operand" "r")))
(const_int 64))))]
""
- "umulh %r1,%2,%0"
+ "umulh %1,%2,%0"
[(set_attr "type" "imul")
(set_attr "opsize" "udi")])
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030330-1.c b/gcc/testsuite/gcc.c-torture/compile/20030330-1.c
new file mode 100644
index 0000000..a5d5de2
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030330-1.c
@@ -0,0 +1,7 @@
+/* PR c/10083 */
+/* This will result in a very small constant for umul_highpart, which
+ uncovered a bug in the Alpha machine description. */
+
+unsigned long f(unsigned long x) {
+ return x % 0x3fffffffffffffff;
+}