public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug inline-asm/31705] New: inline assembler causes ICE: extract_constrain_insn_cached, at recog.c:2002
@ 2007-04-25 18:02 fultonm at ca dot ibm dot com
2007-04-26 7:22 ` [Bug target/31705] " ubizjak at gmail dot com
2007-04-26 15:17 ` fultonm at ca dot ibm dot com
0 siblings, 2 replies; 3+ messages in thread
From: fultonm at ca dot ibm dot com @ 2007-04-25 18:02 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2618 bytes --]
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/31705] inline assembler causes ICE: extract_constrain_insn_cached, at recog.c:2002
2007-04-25 18:02 [Bug inline-asm/31705] New: inline assembler causes ICE: extract_constrain_insn_cached, at recog.c:2002 fultonm at ca dot ibm dot com
@ 2007-04-26 7:22 ` ubizjak at gmail dot com
2007-04-26 15:17 ` fultonm at ca dot ibm dot com
1 sibling, 0 replies; 3+ messages in thread
From: ubizjak at gmail dot com @ 2007-04-26 7:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from ubizjak at gmail dot com 2007-04-26 08:22 -------
(In reply to comment #0)
> __asm__ __volatile__("fptan; fdivp;fchs;": "=&t"(tmpB):"f"(r));
These constraints are wrong. You need:
__asm__ __volatile__ ("fptan; fdivp;fchs;" : "=t" (tmpB) : "0"(r) : "st(1)");
Also note that tmpB is unused, as you rewrite it in next statement.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31705
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/31705] inline assembler causes ICE: extract_constrain_insn_cached, at recog.c:2002
2007-04-25 18:02 [Bug inline-asm/31705] New: inline assembler causes ICE: extract_constrain_insn_cached, at recog.c:2002 fultonm at ca dot ibm dot com
2007-04-26 7:22 ` [Bug target/31705] " ubizjak at gmail dot com
@ 2007-04-26 15:17 ` fultonm at ca dot ibm dot com
1 sibling, 0 replies; 3+ messages in thread
From: fultonm at ca dot ibm dot com @ 2007-04-26 15:17 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-04-26 15:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-25 18:02 [Bug inline-asm/31705] New: inline assembler causes ICE: extract_constrain_insn_cached, at recog.c:2002 fultonm at ca dot ibm dot com
2007-04-26 7:22 ` [Bug target/31705] " ubizjak at gmail dot com
2007-04-26 15:17 ` fultonm at ca dot ibm dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).