Summary: | [3.4 regression] ICE in subst_stack_regs_pat with -O -ffast-math and atan2 | ||
---|---|---|---|
Product: | gcc | Reporter: | Martin Reinecke <martin> |
Component: | target | Assignee: | roger |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs |
Priority: | P1 | Keywords: | ice-on-valid-code |
Version: | 3.4.0 | ||
Target Milestone: | 3.4.0 | ||
Host: | i686-pc-linux-gnu | Target: | i686-pc-linux-gnu |
Build: | i686-pc-linux-gnu | Known to work: | |
Known to fail: | Last reconfirmed: | 2003-06-23 02:21:43 | |
Attachments: | a testcase to reproduce the bug |
Description
Martin Reinecke
2003-05-26 10:59:43 UTC
Created attachment 4076 [details]
a testcase to reproduce the bug
Yep this is a bug on the mainline (20030526). Still exists on the mainline (20030621). This looks like it is caused by Roger Sayle <roger@eyesopen.com>'s patches to make atan2 a builtin and a pattern for i386, he fixed log but it looks like atan2 is not fixed. Here is a smaller example (also a C example): void t(double); double atan2(double,double); void temp(double *c) { double c2 = 8; double s2 = 0; *c = atan2(s2,c2); t(1/s2); } This regression was introduced between 2003-05-14-trunk (#203) and 2003-05-15-trunk (#204). Found using Phil's regression hunter. Subject: Bug 10979 CVSROOT: /cvs/gcc Module name: gcc Changes by: sayle@gcc.gnu.org 2003-07-08 00:28:47 Modified files: gcc : ChangeLog gcc/config/i386: i386.md gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: 20030707-1.c Log message: PR target/10979 * config/i386/i386.md (atan2df3, atan2sf3, atan2xf3, atan2tf3): Changed to define_expand patterns that copy operand[1] to prevent it from being clobbered before emitting an atan2?f3_1 insn. (atan2df3_1, atan2sf3_1, atan2xf_1, atan2tf3_1): New define_insn patterns that actually specify the behaviour of x87's FPATAN. * gcc.dg/20030707-1.c: New testcase. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.385&r2=2.386 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&r1=1.474&r2=1.475 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2847&r2=1.2848 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/20030707-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1 Fixed by Roger's patch. Thanks! |