[Bug inline-asm/31705] New: inline assembler causes ICE: extract_constrain_insn_cached, at recog.c:2002

2007-04-25 Thread fultonm at ca dot ibm dot com
The source file:

double helperDoubleTan(double * a, double * b)
{
double tmpA, tmpB;

tmpA = *a;
{
double y[3] = { 0.0, 0.0, 0.0 };
double r;
int lq;

lq = __ieee754_rem_pio2(tmpA, y);
r = y[0];
if (lq & 0x1) {
  __asm__ __volatile__("fptan; fdivp;fchs;":
"=&t"(tmpB):"f"(r));
  tmpB = __kernel_tan(y[0], y[1], 1 - ((lq & 1) << 1));
} else {
tmpB = tan(r);
}
}
*b = tmpB;
return 0;
}

compiled with gcc -O -c testcase.c

results in:

testcase.c: In function ‘helperDoubleTan’:
testcase.c:17: warning: incompatible implicit declaration of built-in function
‘tan’
testcase.c:22: error: unrecognizable insn:
(insn 36 34 96 (parallel [
(set (reg/v:DF 8 st [orig:58 tmpB.26 ] [58])
(asm_operands/v:DF ("fptan; fdivp;fchs;") ("=&t") 0 [
(reg:DF 8 st)
]
 [
(asm_input:DF ("f"))
] ("testcase.c") 14))
(clobber (reg:QI 19 dirflag))
(clobber (reg:QI 18 fpsr))
(clobber (reg:QI 17 flags))
]) -1 (nil)
(expr_list:REG_UNUSED (reg:QI 17 flags)
(expr_list:REG_UNUSED (reg:QI 18 fpsr)
(expr_list:REG_UNUSED (reg:QI 19 dirflag)
(expr_list:REG_UNUSED (reg/v:DF 8 st [orig:58 tmpB.26 ] [58])
(nil))

Output from gcc -v:

gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)


-- 
   Summary: inline assembler causes ICE:
extract_constrain_insn_cached, at recog.c:2002
   Product: gcc
   Version: 4.1.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: inline-asm
        AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fultonm at ca dot ibm dot com
 GCC build triplet:  i486-linux-gnu
  GCC host triplet:  i486-linux-gnu
GCC target triplet:  i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31705



[Bug target/31705] inline assembler causes ICE: extract_constrain_insn_cached, at recog.c:2002

2007-04-26 Thread fultonm at ca dot ibm dot com


--- Comment #2 from fultonm at ca dot ibm dot com  2007-04-26 16:17 ---
Thank you for the information. I guess the follow-on question is if generating
an internal compiler error is appropriate? I realize it's inline assembler, but
are you not able to recover from an invalid entry? Also - I should have
mentioned that at no-opt, there is no message or error. Perhaps no-opt is
generating invalid code?


-- 

fultonm at ca dot ibm dot com changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31705