public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
@ 2005-07-20 19:29 black dot hole dot sun16 at gmail dot com
2005-07-20 19:30 ` [Bug c/22576] " black dot hole dot sun16 at gmail dot com
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: black dot hole dot sun16 at gmail dot com @ 2005-07-20 19:29 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]
Hello. Sorry if the summary is a little vague, I dont really know a whole bunch
about gcc terminology ;) So anyway, I wrote a simple program in C that computes
the factorials of numbers 1 through 100 (yes, after 7 they get super big). When
this program is compiled as
gcc -ffast-math factorial.c
I get an ICE;
paul@nephilim:~/c$ gcc -Wall -ffast-math factorials.c
factorials.c:8: warning: return type defaults to int
factorials.c: In function main:
factorials.c:24: internal compiler error: in instantiate_virtual_regs_lossage,
at function.c:1442
paul@nephilim:~/c$ gcc -dumpversion
4.0.2
This gcc is from Ubuntu-breezy, gcc-4.0 branch, CVS 20050718. Running on a
Pentium 4.
It told me to report this bug, so here I am :) Regardless of whether this can be
done in a simpler manner, and I'm /sure/ it can, I dont think gcc should die
because of it. The offending code is attached. -save-temps output also attached.
--
Summary: ICE with simple factorial program compiled with -ffast-
math on gcc 4.0.2
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: black dot hole dot sun16 at gmail dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/22576] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
2005-07-20 19:30 ` [Bug c/22576] " black dot hole dot sun16 at gmail dot com
@ 2005-07-20 19:30 ` black dot hole dot sun16 at gmail dot com
2005-07-20 19:32 ` black dot hole dot sun16 at gmail dot com
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: black dot hole dot sun16 at gmail dot com @ 2005-07-20 19:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From black dot hole dot sun16 at gmail dot com 2005-07-20 19:29 -------
Created an attachment (id=9309)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9309&action=view)
bug causing program...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/22576] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
@ 2005-07-20 19:30 ` black dot hole dot sun16 at gmail dot com
2005-07-20 19:30 ` black dot hole dot sun16 at gmail dot com
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: black dot hole dot sun16 at gmail dot com @ 2005-07-20 19:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From black dot hole dot sun16 at gmail dot com 2005-07-20 19:29 -------
Created an attachment (id=9310)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9310&action=view)
-save-temps output
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/22576] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
2005-07-20 19:30 ` [Bug c/22576] " black dot hole dot sun16 at gmail dot com
2005-07-20 19:30 ` black dot hole dot sun16 at gmail dot com
@ 2005-07-20 19:32 ` black dot hole dot sun16 at gmail dot com
2005-07-20 19:33 ` [Bug target/22576] " pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: black dot hole dot sun16 at gmail dot com @ 2005-07-20 19:32 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From black dot hole dot sun16 at gmail dot com 2005-07-20 19:30 -------
Created an attachment (id=9311)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9311&action=view)
-save-temps output
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/22576] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
` (3 preceding siblings ...)
2005-07-20 19:33 ` [Bug target/22576] " pinskia at gcc dot gnu dot org
@ 2005-07-20 19:33 ` black dot hole dot sun16 at gmail dot com
2005-07-20 19:39 ` [Bug target/22576] " black dot hole dot sun16 at gmail dot com
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: black dot hole dot sun16 at gmail dot com @ 2005-07-20 19:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From black dot hole dot sun16 at gmail dot com 2005-07-20 19:32 -------
If it is at all relevant, I'm using the glibc that breezy provides (2.3.5).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/22576] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
` (2 preceding siblings ...)
2005-07-20 19:32 ` black dot hole dot sun16 at gmail dot com
@ 2005-07-20 19:33 ` pinskia at gcc dot gnu dot org
2005-07-20 19:33 ` [Bug c/22576] " black dot hole dot sun16 at gmail dot com
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-20 19:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-20 19:33 -------
This is a target bug.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c |target
GCC target triplet| |i686-pc-linux-gnu
Keywords| |ice-on-valid-code
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/22576] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
` (4 preceding siblings ...)
2005-07-20 19:33 ` [Bug c/22576] " black dot hole dot sun16 at gmail dot com
@ 2005-07-20 19:39 ` black dot hole dot sun16 at gmail dot com
2005-07-20 22:02 ` [Bug target/22576] [4.0/4.1 regression] " reichelt at gcc dot gnu dot org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: black dot hole dot sun16 at gmail dot com @ 2005-07-20 19:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From black dot hole dot sun16 at gmail dot com 2005-07-20 19:33 -------
Created an attachment (id=9312)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9312&action=view)
#included file
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/22576] [4.0/4.1 regression] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
` (5 preceding siblings ...)
2005-07-20 19:39 ` [Bug target/22576] " black dot hole dot sun16 at gmail dot com
@ 2005-07-20 22:02 ` reichelt at gcc dot gnu dot org
2005-07-20 23:39 ` black dot hole dot sun16 at gmail dot com
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-07-20 22:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-07-20 21:26 -------
Reduced testcase:
========================
int foo(long double d)
{
return d==0;
}
========================
Comparison of long doubles with zero seems to be a problem.
This is a regression from gcc 3.4.x.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-07-20 21:26:27
date| |
Summary|ICE with simple factorial |[4.0/4.1 regression] ICE
|program compiled with - |with simple factorial
|ffast-math on gcc 4.0.2 |program compiled with -
| |ffast-math on gcc 4.0.2
Target Milestone|--- |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/22576] [4.0/4.1 regression] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
` (6 preceding siblings ...)
2005-07-20 22:02 ` [Bug target/22576] [4.0/4.1 regression] " reichelt at gcc dot gnu dot org
@ 2005-07-20 23:39 ` black dot hole dot sun16 at gmail dot com
2005-07-21 8:02 ` uros at kss-loka dot si
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: black dot hole dot sun16 at gmail dot com @ 2005-07-20 23:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From black dot hole dot sun16 at gmail dot com 2005-07-20 23:13 -------
(From update of attachment 9309)
>#include <stdio.h>
>
>/* Program prints the first 10 postitive integers and their factorials */
>
>main()
>{
>long double i, j, k = 1;
>
>for(i = 1; i <= 100; i++)
> {
> for(j = i; j > 0; j = j - 1)
> {
> k = k * j;
> if(j == 1)
> {
> printf("factorial of %Lf is %Lf\n", i, k);
> k = 1;
> }
> }
> }
> return 0;
>}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/22576] [4.0/4.1 regression] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
` (7 preceding siblings ...)
2005-07-20 23:39 ` black dot hole dot sun16 at gmail dot com
@ 2005-07-21 8:02 ` uros at kss-loka dot si
2005-07-21 17:10 ` reichelt at gcc dot gnu dot org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: uros at kss-loka dot si @ 2005-07-21 8:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From uros at kss-loka dot si 2005-07-21 08:01 -------
Patch that fixes attached testcase and reduced testcase from comment #7.
BTW: In the attached testcase, there is a comment that program falls apart if
long double isn't used. With (patched) gcc-4.1 CVS, it works for me with "only"
doubles, with SSE or x87 math, -ffast-math or without it.
...
factorial of 99 is 9.33262e+155
factorial of 100 is 9.33262e+157
--
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2005-
| |07/msg01391.html
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/22576] [4.0/4.1 regression] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
` (8 preceding siblings ...)
2005-07-21 8:02 ` uros at kss-loka dot si
@ 2005-07-21 17:10 ` reichelt at gcc dot gnu dot org
2005-07-21 19:55 ` cvs-commit at gcc dot gnu dot org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-07-21 17:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-07-21 17:07 -------
The problem is related to PR22585 where another ICE with long doubles occurs.
Unfortunately Uros' patch doesn't fix the problem there.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |monitored
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/22576] [4.0/4.1 regression] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
` (9 preceding siblings ...)
2005-07-21 17:10 ` reichelt at gcc dot gnu dot org
@ 2005-07-21 19:55 ` cvs-commit at gcc dot gnu dot org
2005-07-21 19:58 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-21 19:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-07-21 19:55 -------
Subject: Bug 22576
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: rth@gcc.gnu.org 2005-07-21 19:55:03
Modified files:
gcc : ChangeLog
gcc/config/i386: i386.md
Log message:
PR target/22576
* config/i386/i386.md (cmpxf): Change operand constraints
to "nonmemory_operand".
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9504&r2=2.9505
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&r1=1.649&r2=1.650
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/22576] [4.0/4.1 regression] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
` (10 preceding siblings ...)
2005-07-21 19:55 ` cvs-commit at gcc dot gnu dot org
@ 2005-07-21 19:58 ` cvs-commit at gcc dot gnu dot org
2005-07-21 20:38 ` pinskia at gcc dot gnu dot org
2005-09-26 19:20 ` cvs-commit at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-21 19:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-07-21 19:56 -------
Subject: Bug 22576
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-4_0-branch
Changes by: rth@gcc.gnu.org 2005-07-21 19:56:30
Modified files:
gcc : ChangeLog
gcc/config/i386: i386.md
Log message:
PR target/22576
* config/i386/i386.md (cmpxf): Change operand constraints
to "nonmemory_operand".
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.325&r2=2.7592.2.326
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.618.4.4&r2=1.618.4.5
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/22576] [4.0/4.1 regression] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
` (11 preceding siblings ...)
2005-07-21 19:58 ` cvs-commit at gcc dot gnu dot org
@ 2005-07-21 20:38 ` pinskia at gcc dot gnu dot org
2005-09-26 19:20 ` cvs-commit at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-21 20:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-21 20:33 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/22576] [4.0/4.1 regression] ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
` (12 preceding siblings ...)
2005-07-21 20:38 ` pinskia at gcc dot gnu dot org
@ 2005-09-26 19:20 ` cvs-commit at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-26 19:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-09-26 19:20 -------
Subject: Bug 22576
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: janis@gcc.gnu.org 2005-09-26 19:19:43
Modified files:
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.target/i386: pr22576.c pr22585.c pr23268.c
builtin-apply-mmx.c
Log message:
2005-08-26 Uros Bizjak <uros@kss-loka.si>
* gcc.target/i386/builtin-apply-mmx.c: New test.
PR target/22576
* gcc.target/i386/pr22576.c: New test.
PR target/22585
* gcc.target/i386/pr22585.c: New test.
PR target/23268
* gcc.target/i386/pr23268.c: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6104&r2=1.6105
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.target/i386/pr22576.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.target/i386/pr22585.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.target/i386/pr23268.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.target/i386/builtin-apply-mmx.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22576
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2005-09-26 19:20 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-20 19:29 [Bug c/22576] New: ICE with simple factorial program compiled with -ffast-math on gcc 4.0.2 black dot hole dot sun16 at gmail dot com
2005-07-20 19:30 ` [Bug c/22576] " black dot hole dot sun16 at gmail dot com
2005-07-20 19:30 ` black dot hole dot sun16 at gmail dot com
2005-07-20 19:32 ` black dot hole dot sun16 at gmail dot com
2005-07-20 19:33 ` [Bug target/22576] " pinskia at gcc dot gnu dot org
2005-07-20 19:33 ` [Bug c/22576] " black dot hole dot sun16 at gmail dot com
2005-07-20 19:39 ` [Bug target/22576] " black dot hole dot sun16 at gmail dot com
2005-07-20 22:02 ` [Bug target/22576] [4.0/4.1 regression] " reichelt at gcc dot gnu dot org
2005-07-20 23:39 ` black dot hole dot sun16 at gmail dot com
2005-07-21 8:02 ` uros at kss-loka dot si
2005-07-21 17:10 ` reichelt at gcc dot gnu dot org
2005-07-21 19:55 ` cvs-commit at gcc dot gnu dot org
2005-07-21 19:58 ` cvs-commit at gcc dot gnu dot org
2005-07-21 20:38 ` pinskia at gcc dot gnu dot org
2005-09-26 19:20 ` cvs-commit at gcc dot gnu dot org
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).