public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/23268] New: ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s)
@ 2005-08-07  4:25 plgs at ozemail dot com dot au
  2005-08-07  4:28 ` [Bug c/23268] " plgs at ozemail dot com dot au
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: plgs at ozemail dot com dot au @ 2005-08-07  4:25 UTC (permalink / raw)
  To: gcc-bugs

ICE (segmentation fault) compiling a function containing two math functions (log
and rint), using -ffast-math and -O1 (or 2, 3 or s).  Error does not occur when
-ffast-math not used.  Error does not occur when optimisation flag not used (or
if -O0 used).

To reproduce, compile the following:

#include <math.h>
int f (float x) {
  int a, b;
  a = log(2.f);
  b = rint(x);
  return(a+b);
}

Using:
$ gcc -ffast-math -O1 -c test.c

Gives the following output:
test.c: In function 'f':
test.c:7: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

However, neither of
$ gcc -O1 -c test.c
nor
$ gcc -ffast-math -c test.c
cause the same error.

$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1-20050730/configure --prefix=/usr/local/gcc41
Thread model: posix
gcc version 4.1.0 20050730 (experimental)

-- 
           Summary: ICE using math functions log & rint, -ffast-math, -O1
                    (,2,3,s)
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: plgs at ozemail dot com dot au
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c/23268] ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s)
  2005-08-07  4:25 [Bug c/23268] New: ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s) plgs at ozemail dot com dot au
@ 2005-08-07  4:28 ` plgs at ozemail dot com dot au
  2005-08-07  4:33 ` [Bug target/23268] [4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: plgs at ozemail dot com dot au @ 2005-08-07  4:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From plgs at ozemail dot com dot au  2005-08-07 04:27 -------
Created an attachment (id=9442)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9442&action=view)
Preprocessed source testcase


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/23268] [4.1 Regression] ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s)
  2005-08-07  4:25 [Bug c/23268] New: ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s) plgs at ozemail dot com dot au
  2005-08-07  4:28 ` [Bug c/23268] " plgs at ozemail dot com dot au
@ 2005-08-07  4:33 ` pinskia at gcc dot gnu dot org
  2005-08-07  4:34 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-07  4:33 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uros at gcc dot gnu dot org
          Component|c                           |target
           Keywords|                            |ice-on-valid-code
            Summary|ICE using math functions log|[4.1 Regression] ICE using
                   |& rint, -ffast-math, -O1    |math functions log & rint, -
                   |(,2,3,s)                    |ffast-math, -O1 (,2,3,s)
   Target Milestone|---                         |4.1.0


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/23268] [4.1 Regression] ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s)
  2005-08-07  4:25 [Bug c/23268] New: ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s) plgs at ozemail dot com dot au
  2005-08-07  4:28 ` [Bug c/23268] " plgs at ozemail dot com dot au
  2005-08-07  4:33 ` [Bug target/23268] [4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-08-07  4:34 ` pinskia at gcc dot gnu dot org
  2005-08-07  4:36 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-07  4:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-07 04:34 -------
Confirmed.

This is either a target bug or a middle-end bug.

CCing the person who added the builtins.

Reduced testcase:
int f (float x) {
  int a, b;
  a = __builtin_log(2.f);
  b = __builtin_rint(x);
  return(a+b);
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
      Known to fail|                            |4.1.0
      Known to work|                            |4.0.0
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-07 04:34:27
               date|                            |


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/23268] [4.1 Regression] ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s)
  2005-08-07  4:25 [Bug c/23268] New: ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s) plgs at ozemail dot com dot au
                   ` (2 preceding siblings ...)
  2005-08-07  4:34 ` pinskia at gcc dot gnu dot org
@ 2005-08-07  4:36 ` pinskia at gcc dot gnu dot org
  2005-08-07 20:05 ` uros at kss-loka dot si
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-07  4:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-07 04:36 -------
Here is the backtrace:
#0  0x084d47e6 in find_oldest_value_reg (cl=GENERAL_REGS, reg=0xb7d01050, vd=0xa483b08)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/regrename.c:1357
#1  0x084d48f0 in replace_oldest_value_reg (loc=0xb7d89040, cl=Variable "cl" is not available.
) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/regrename.c:1391
#2  0x084d4ac2 in replace_oldest_value_addr (loc=0xb7d89040, cl=GENERAL_REGS, mode=SImode, 
insn=0xb7d0a7f8, vd=0xa483b08)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/regrename.c:1522
#3  0x084d4c1c in replace_oldest_value_addr (loc=Variable "loc" is not available.
) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/regrename.c:1500
#4  0x084d4dce in replace_oldest_value_mem (x=Variable "x" is not available.
) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/regrename.c:1548
#5  0x084d70ac in copyprop_hardreg_forward () at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/
regrename.c:1712
#6  0x083eca14 in execute_one_pass (pass=0x85bff80) at /home/peshtigo/pinskia/src/gnu/gcc/src/
gcc/passes.c:797


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/23268] [4.1 Regression] ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s)
  2005-08-07  4:25 [Bug c/23268] New: ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s) plgs at ozemail dot com dot au
                   ` (3 preceding siblings ...)
  2005-08-07  4:36 ` pinskia at gcc dot gnu dot org
@ 2005-08-07 20:05 ` uros at kss-loka dot si
  2005-08-16  9:10 ` uros at kss-loka dot si
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: uros at kss-loka dot si @ 2005-08-07 20:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From uros at kss-loka dot si  2005-08-07 20:05 -------
Mine.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |uros at kss-loka dot si
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-08-07 04:34:27         |2005-08-07 20:05:45
               date|                            |


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/23268] [4.1 Regression] ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s)
  2005-08-07  4:25 [Bug c/23268] New: ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s) plgs at ozemail dot com dot au
                   ` (4 preceding siblings ...)
  2005-08-07 20:05 ` uros at kss-loka dot si
@ 2005-08-16  9:10 ` uros at kss-loka dot si
  2005-08-17 21:06 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: uros at kss-loka dot si @ 2005-08-16  9:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From uros at kss-loka dot si  2005-08-16 09:02 -------
Patch here: http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00962.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2005-
                   |                            |08/msg00962.html
           Keywords|                            |patch


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/23268] [4.1 Regression] ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s)
  2005-08-07  4:25 [Bug c/23268] New: ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s) plgs at ozemail dot com dot au
                   ` (5 preceding siblings ...)
  2005-08-16  9:10 ` uros at kss-loka dot si
@ 2005-08-17 21:06 ` cvs-commit at gcc dot gnu dot org
  2005-08-17 21:39 ` pinskia at gcc dot gnu dot org
  2005-09-26 19:20 ` cvs-commit at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-08-17 21:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-08-17 20:44 -------
Subject: Bug 23268

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2005-08-17 20:44:09

Modified files:
	gcc            : ChangeLog 
	gcc/config/i386: i386.md 

Log message:
	PR target/23268
	* config/i386/i386.md ("*fist<mode>2_1"): New pattern.
	("lrint<mode>2"): Change expander to use "*fist<mode>2_1" pattern.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9763&r2=2.9764
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&r1=1.652&r2=1.653



-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/23268] [4.1 Regression] ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s)
  2005-08-07  4:25 [Bug c/23268] New: ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s) plgs at ozemail dot com dot au
                   ` (6 preceding siblings ...)
  2005-08-17 21:06 ` cvs-commit at gcc dot gnu dot org
@ 2005-08-17 21:39 ` pinskia at gcc dot gnu dot org
  2005-09-26 19:20 ` cvs-commit at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-17 21:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-17 21:08 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/23268] [4.1 Regression] ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s)
  2005-08-07  4:25 [Bug c/23268] New: ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s) plgs at ozemail dot com dot au
                   ` (7 preceding siblings ...)
  2005-08-17 21:39 ` pinskia at gcc dot gnu dot org
@ 2005-09-26 19:20 ` cvs-commit at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ 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 23268

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=23268


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-09-26 19:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-07  4:25 [Bug c/23268] New: ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s) plgs at ozemail dot com dot au
2005-08-07  4:28 ` [Bug c/23268] " plgs at ozemail dot com dot au
2005-08-07  4:33 ` [Bug target/23268] [4.1 Regression] " pinskia at gcc dot gnu dot org
2005-08-07  4:34 ` pinskia at gcc dot gnu dot org
2005-08-07  4:36 ` pinskia at gcc dot gnu dot org
2005-08-07 20:05 ` uros at kss-loka dot si
2005-08-16  9:10 ` uros at kss-loka dot si
2005-08-17 21:06 ` cvs-commit at gcc dot gnu dot org
2005-08-17 21:39 ` 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).