[gnu.gcc.bug] Bug report for gcc 1.34 on the Alliant

brooks@MADDOG.LLNL.GOV (Eugene Brooks) (03/11/89)

VERSION: Unmolested gcc 1.34 bootstrapped with cc -pcc on first
build then normal bootstrap.

The following code:
main()
{
	int i;

	i = 0;

	if(1./4. == i)
		printf(" bug1 FAILED\n");
	else
		printf(" bug1 PASSED\n");
}
when compiled with gcc -O will produce the following assembler
instruction on line 13
	fmoveld #0,fp0
which the assembler will report as having an invalid operand.
Evidently a constant operand is not allowed, I checked that the FX
compiler did generate fmoveld, and it did, but it never generated it with
a constand operand.  I do not know how to constrain the machine description
entry to rule out a constand operand, but allow register and memory
references, which seems to be the ticket here.

weening@GANG-OF-FOUR.STANFORD.EDU (Joe Weening) (03/12/89)

The following patch should fix the "invalid operand" bug.  It turns
out that none of the Alliant fix-to-float instructions allow immediate
data operands.

*** alliant.md.old	Sat Mar 11 13:12:18 1989
--- alliant.md	Sat Mar 11 13:13:15 1989
***************
*** 987,991 ****
  (define_insn ""
    [(set (match_operand:SF 0 "general_operand" "=f")
! 	(float:SF (match_operand:SI 1 "general_operand" "dmi")))]
    "TARGET_68881"
    "fmovels %1,%0")
--- 987,991 ----
  (define_insn ""
    [(set (match_operand:SF 0 "general_operand" "=f")
! 	(float:SF (match_operand:SI 1 "general_operand" "dm")))]
    "TARGET_68881"
    "fmovels %1,%0")
***************
*** 999,1003 ****
  (define_insn ""
    [(set (match_operand:DF 0 "general_operand" "=f")
! 	(float:DF (match_operand:SI 1 "general_operand" "dmi")))]
    "TARGET_68881"
    "fmoveld %1,%0")
--- 999,1003 ----
  (define_insn ""
    [(set (match_operand:DF 0 "general_operand" "=f")
! 	(float:DF (match_operand:SI 1 "general_operand" "dm")))]
    "TARGET_68881"
    "fmoveld %1,%0")
***************
*** 1005,1009 ****
  (define_insn "floathisf2"
    [(set (match_operand:SF 0 "general_operand" "=f")
! 	(float:SF (match_operand:HI 1 "general_operand" "dmn")))]
    "TARGET_68881"
    "fmovews %1,%0")
--- 1005,1009 ----
  (define_insn "floathisf2"
    [(set (match_operand:SF 0 "general_operand" "=f")
! 	(float:SF (match_operand:HI 1 "general_operand" "dm")))]
    "TARGET_68881"
    "fmovews %1,%0")
***************
*** 1011,1015 ****
  (define_insn "floathidf2"
    [(set (match_operand:DF 0 "general_operand" "=f")
! 	(float:DF (match_operand:HI 1 "general_operand" "dmn")))]
    "TARGET_68881"
    "fmovewd %1,%0")
--- 1011,1015 ----
  (define_insn "floathidf2"
    [(set (match_operand:DF 0 "general_operand" "=f")
! 	(float:DF (match_operand:HI 1 "general_operand" "dm")))]
    "TARGET_68881"
    "fmovewd %1,%0")
***************
*** 1017,1021 ****
  (define_insn "floatqisf2"
    [(set (match_operand:SF 0 "general_operand" "=f")
! 	(float:SF (match_operand:QI 1 "general_operand" "dmn")))]
    "TARGET_68881"
    "fmovebs %1,%0")
--- 1017,1021 ----
  (define_insn "floatqisf2"
    [(set (match_operand:SF 0 "general_operand" "=f")
! 	(float:SF (match_operand:QI 1 "general_operand" "dm")))]
    "TARGET_68881"
    "fmovebs %1,%0")
***************
*** 1023,1027 ****
  (define_insn "floatqidf2"
    [(set (match_operand:DF 0 "general_operand" "=f")
! 	(float:DF (match_operand:QI 1 "general_operand" "dmn")))]
    "TARGET_68881"
    "fmovebd %1,%0")
--- 1023,1027 ----
  (define_insn "floatqidf2"
    [(set (match_operand:DF 0 "general_operand" "=f")
! 	(float:DF (match_operand:QI 1 "general_operand" "dm")))]
    "TARGET_68881"
    "fmovebd %1,%0")