public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13634] New: ICE when compiling OpenCV.
@ 2004-01-09 18:08 rosbacke at nada dot kth dot se
  2004-01-09 18:43 ` [Bug c/13634] " rosbacke at nada dot kth dot se
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: rosbacke at nada dot kth dot se @ 2004-01-09 18:08 UTC (permalink / raw)
  To: gcc-bugs

When i try to compile OpenCV I get an internal compiler error. The following testcase 
triggers an ICE when compiled with: 
 
gcc -march=i686 -ffast-math -O2 -fPIC -c gcctest2.c 
------------------------------------------------------------------------------------------------- 
double pow(double ,double ); 
 
int icvCubicV( double a2, double a1, double a0, double *squares ) 
{ 
  double p, c2, ro1; 
  double x[6][3]; 
  int i; 
   
  p = a1 - a2 * a2 / 3; 
     
  for( i = 0; i < 6; i++ ) 
    squares[i] = x[i][i % 2]; 
 
  c2 = pow( ro1 , 1. / 3 ) + ( (ro1)<0 ? -1:((ro1)>0?1:0 ) )  *  p / 3.; 
 
  if( !( (ro1) < 1e-8 )) 
    { 
      x[i][1] = c2; 
    }   
} 
------------------------------------------------------------------------------------------------- 
The code might be non-sensible since I've cut out everything except what causes the 
ICE. The original file is OpenCV-0.9.5/cv/src/cvfundam.cpp. Removing any more 
options to gcc will also finish the compilation without error. 
I have tried this on both version 3.3.2 and 3.3-20040105. I get the fault: 
 
[rosbacke@cvap83 gcctest]$ gcc -march=i686 -ffast-math -O2 -fPIC -c gcctest2.c 
gcctest2.c: In function `icvCubicV': 
gcctest2.c:22: internal compiler error: in emit_move_insn_1, at expr.c:3507 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
[rosbacke@cvap83 gcctest]$ 
 
Output from gcc -v is: 
 Reading specs 
from /afs/nada.kth.se/home/cvap/rosbacke/install/redhat90/gcc33-20040105/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.3.3/specs 
Configured with: ../gcc-3.3-20040105/configure 
--prefix=/home/cvap/rosbacke/install/redhat90/gcc33-20040105 
Thread model: posix 
gcc version 3.3.3 20040105 (prerelease)

-- 
           Summary: ICE when compiling OpenCV.
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rosbacke at nada dot kth dot se
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c/13634] ICE when compiling OpenCV.
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
@ 2004-01-09 18:43 ` rosbacke at nada dot kth dot se
  2004-01-09 19:07 ` [Bug c/13634] [3.3 regression] ICE in emit_move_insn_1 bangerth at dealii dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rosbacke at nada dot kth dot se @ 2004-01-09 18:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rosbacke at nada dot kth dot se  2004-01-09 18:43 -------
I have a shorter testcase: 
------------------------------------------------------------------------------ 
double pow(double); 
 
int icvCubicV(double a2) 
{ 
  double p; 
  int i=0; 
   
  p = a2 / 3; 
  while(i<6) ++i; 
 
  return pow( 1./ 3. ) +  
    ( a2<0.0 ? -1.0: 1.0  )  *  p  / 3; 
} 
---------------------------------------------------------------- 
Compile with the same arguments as given above. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE when compiling OpenCV.  |ICE when compiling OpenCV.


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


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

* [Bug c/13634] [3.3 regression] ICE in emit_move_insn_1
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
  2004-01-09 18:43 ` [Bug c/13634] " rosbacke at nada dot kth dot se
@ 2004-01-09 19:07 ` bangerth at dealii dot org
  2004-01-10  4:16 ` [Bug target/13634] " pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bangerth at dealii dot org @ 2004-01-09 19:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-01-09 19:06 -------
Confirmed. A 3.3 regression. It compiles cleanly with mainline, but 
who knows whether this is not due to some different stream of 
instructions being generated. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-09 19:06:29
               date|                            |
            Summary|ICE when compiling OpenCV.  |[3.3 regression] ICE in
                   |                            |emit_move_insn_1
   Target Milestone|---                         |3.3.3


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


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

* [Bug target/13634] [3.3 regression] ICE in emit_move_insn_1
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
  2004-01-09 18:43 ` [Bug c/13634] " rosbacke at nada dot kth dot se
  2004-01-09 19:07 ` [Bug c/13634] [3.3 regression] ICE in emit_move_insn_1 bangerth at dealii dot org
@ 2004-01-10  4:16 ` pinskia at gcc dot gnu dot org
  2004-01-10  4:17 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-10  4:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-10 04:16 -------
Here is the back trace (there is a dup of this bug that I am going to close as a dup of this one 
because this one already has a small testcase).

#0  0x4202bb8a in exit () from /lib/i686/libc.so.6
#1  0x080b2fe7 in internal_error (msgid=0xbffeb9d0 "\205?-\b???(\eB\b\r") at ../../gcc/
diagnostic.c:1211
#2  0x080b340f in fancy_abort (file=0x83 <Address 0x83 out of bounds>, line=1108532352, 
function=0x83 <Address 0x83 out of bounds>)
    at ../../gcc/diagnostic.c:1376
#3  0x080deff7 in emit_move_insn_1 (x=0x4008d030, y=0x4008d030) at ../../gcc/expr.c:3486
#4  0x080decc8 in emit_move_insn (x=0x4008d030, y=0x4008d030) at ../../gcc/expr.c:3187
#5  0x08252395 in ix86_split_long_move (operands=0x83f54c0) at ../../gcc/config/i386/i386.c:
10092
#6  0x0814c587 in gen_split_854 (operands=0x83) at insn-emit.c:7462
#7  0x080c92e4 in try_split (pat=0x40085084, trial=0x4007f39c, last=1) at ../../gcc/emit-rtl.c:
3218
#8  0x081e6101 in split_insn (insn=0x4007f39c) at ../../gcc/recog.c:2772
#9  0x081e61b2 in split_all_insns (upd_life=0) at ../../gcc/recog.c:2828
#10 0x08229f1b in rest_of_compilation (decl=0x40077a10) at ../../gcc/toplev.c:3366
#11 0x0805c46b in c_expand_body (fndecl=0x40077a10, nested_p=0, can_defer_p=1) at ../../
gcc/c-decl.c:6612
#12 0x0805c237 in finish_function (nested=0, can_defer_p=131) at ../../gcc/c-decl.c:6444
#13 0x0804ab24 in yyparse () at c-parse.y:403
#14 0x08052b49 in c_common_parse_file (set_yydebug=131) at ../../gcc/c-lex.c:159
#15 0x08228d1a in compile_file () at ../../gcc/toplev.c:2130
#16 0x0822df95 in do_compile () at ../../gcc/toplev.c:5384
#17 0x0822e029 in toplev_main (argc=131, argv=0x0) at ../../gcc/toplev.c:5414
#18 0x0808cb5b in main (argc=131, argv=0x83) at ../../gcc/main.c:35

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target


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


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

* [Bug target/13634] [3.3 regression] ICE in emit_move_insn_1
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
                   ` (2 preceding siblings ...)
  2004-01-10  4:16 ` [Bug target/13634] " pinskia at gcc dot gnu dot org
@ 2004-01-10  4:17 ` pinskia at gcc dot gnu dot org
  2004-01-10 17:39 ` ebotcazou at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-10  4:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-10 04:17 -------
*** Bug 13516 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |debian-gcc at lists dot
                   |                            |debian dot org


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


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

* [Bug target/13634] [3.3 regression] ICE in emit_move_insn_1
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
                   ` (3 preceding siblings ...)
  2004-01-10  4:17 ` pinskia at gcc dot gnu dot org
@ 2004-01-10 17:39 ` ebotcazou at gcc dot gnu dot org
  2004-01-10 18:42 ` gdr at integrable-solutions dot net
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-01-10 17:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-01-10 17:39 -------
My patch for PR opt/13472 happens to make the ICE go away.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |ebotcazou at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug target/13634] [3.3 regression] ICE in emit_move_insn_1
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
                   ` (4 preceding siblings ...)
  2004-01-10 17:39 ` ebotcazou at gcc dot gnu dot org
@ 2004-01-10 18:42 ` gdr at integrable-solutions dot net
  2004-01-10 19:00 ` rosbacke at nada dot kth dot se
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-01-10 18:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2004-01-10 18:42 -------
Subject: Re:  [3.3 regression] ICE in emit_move_insn_1

"ebotcazou at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| My patch for PR opt/13472 happens to make the ICE go away.

Good! :-)


-- 


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


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

* [Bug target/13634] [3.3 regression] ICE in emit_move_insn_1
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
                   ` (5 preceding siblings ...)
  2004-01-10 18:42 ` gdr at integrable-solutions dot net
@ 2004-01-10 19:00 ` rosbacke at nada dot kth dot se
  2004-01-10 20:05 ` ebotcazou at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rosbacke at nada dot kth dot se @ 2004-01-10 19:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rosbacke at nada dot kth dot se  2004-01-10 19:00 -------
Good to see that the ICE got removed by the patch. But I'm afraid this might
lead us to cover the bug rather than fixing. I don't know much off gcc internals
but I can give you some notes from my work to create the second test case.

It seemed to be rather sensitive to acually perfoming floating point divisions.
For example replacing '1./3.' with '0.33' would remove the ICE. changing '* p /
3'  to '* p * 3' would remove the ICE. Also replacing 'pow( 1./ 3. )' with
'pow(1/3)' would remove the ICE.
Also it seemed important that 'while(i<6) ++i;' occured between 'p = ...' and
the return statement. Placing 'while(i<6) ++i;' above the assignment to p would
also remove the ICE.
>From these totally unscientific observations I would guess that we would have a
problem somewhere in the code that handles division of floating point numbers
with -ffast-math.
Maybe worth having a look at?

-- 


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


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

* [Bug target/13634] [3.3 regression] ICE in emit_move_insn_1
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
                   ` (6 preceding siblings ...)
  2004-01-10 19:00 ` rosbacke at nada dot kth dot se
@ 2004-01-10 20:05 ` ebotcazou at gcc dot gnu dot org
  2004-01-10 20:12 ` [Bug optimization/13634] " rosbacke at nada dot kth dot se
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-01-10 20:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-01-10 20:05 -------
> Good to see that the ICE got removed by the patch. But I'm afraid this might
> lead us to cover the bug rather than fixing.

No, the patch is a valid fix: the compiler dies on a move between two FP
constants, which is generated because the reload pass generated a brain-damaged
move between a symbolic FP constant and its representation in memory!  My patch
fixes the reload pass.

> From these totally unscientific observations I would guess that we would have
> a problem somewhere in the code that handles division of floating point
> numbers with -ffast-math.

Optimization bugs are usually dependent upon the phase of the moon :-) so the
symptoms are in general not directly related to the cause.


-- 


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


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

* [Bug optimization/13634] [3.3 regression] ICE in emit_move_insn_1
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
                   ` (7 preceding siblings ...)
  2004-01-10 20:05 ` ebotcazou at gcc dot gnu dot org
@ 2004-01-10 20:12 ` rosbacke at nada dot kth dot se
  2004-01-21  7:37 ` ebotcazou at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rosbacke at nada dot kth dot se @ 2004-01-10 20:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rosbacke at nada dot kth dot se  2004-01-10 20:12 -------
My mistake. I thought the patch only covered integer operations. Good to see
this one is under control. Let us just hope it can appear in gcc 3.3.3. I can
live with gcc 3.2.3 until then.
 

-- 


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


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

* [Bug optimization/13634] [3.3 regression] ICE in emit_move_insn_1
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
                   ` (8 preceding siblings ...)
  2004-01-10 20:12 ` [Bug optimization/13634] " rosbacke at nada dot kth dot se
@ 2004-01-21  7:37 ` ebotcazou at gcc dot gnu dot org
  2004-03-11 11:16 ` ebotcazou at gcc dot gnu dot org
  2004-03-27 16:18 ` cvs-commit at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-01-21  7:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-01-21 07:37 -------


*** This bug has been marked as a duplicate of 13472 ***

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


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


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

* [Bug optimization/13634] [3.3 regression] ICE in emit_move_insn_1
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
                   ` (9 preceding siblings ...)
  2004-01-21  7:37 ` ebotcazou at gcc dot gnu dot org
@ 2004-03-11 11:16 ` ebotcazou at gcc dot gnu dot org
  2004-03-27 16:18 ` cvs-commit at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-03-11 11:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-03-11 11:16 -------
*** Bug 14529 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu dot org


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


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

* [Bug optimization/13634] [3.3 regression] ICE in emit_move_insn_1
  2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
                   ` (10 preceding siblings ...)
  2004-03-11 11:16 ` ebotcazou at gcc dot gnu dot org
@ 2004-03-27 16:18 ` cvs-commit at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-27 16:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-03-27 16:18 -------
Subject: Bug 13634

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-rhl-branch
Changes by:	jakub@gcc.gnu.org	2004-03-27 16:17:59

Modified files:
	gcc            : ChangeLog 
	gcc/testsuite  : ChangeLog 
	gcc            : reload1.c 
Added files:
	gcc/testsuite/gcc.dg: 20040311-1.c 

Log message:
	2004-01-14  Eric Botcazou  <ebotcazou@libertysurf.fr>
	
	PR optimization/13634, optimization/13472, optimization/14529
	* reload1.c (reload): Ignore REQ_EQUIV notes with MEM/u.
	
	2004-03-11  Jakub Jelinek  <jakub@redhat.com>
	
	* gcc.dg/20040311-1.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.16114.2.523.2.97&r2=1.16114.2.523.2.98
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.2261.2.170.2.50&r2=1.2261.2.170.2.51
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reload1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.366.2.5.4.4&r2=1.366.2.5.4.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/20040311-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

end of thread, other threads:[~2004-03-27 16:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-09 18:08 [Bug c/13634] New: ICE when compiling OpenCV rosbacke at nada dot kth dot se
2004-01-09 18:43 ` [Bug c/13634] " rosbacke at nada dot kth dot se
2004-01-09 19:07 ` [Bug c/13634] [3.3 regression] ICE in emit_move_insn_1 bangerth at dealii dot org
2004-01-10  4:16 ` [Bug target/13634] " pinskia at gcc dot gnu dot org
2004-01-10  4:17 ` pinskia at gcc dot gnu dot org
2004-01-10 17:39 ` ebotcazou at gcc dot gnu dot org
2004-01-10 18:42 ` gdr at integrable-solutions dot net
2004-01-10 19:00 ` rosbacke at nada dot kth dot se
2004-01-10 20:05 ` ebotcazou at gcc dot gnu dot org
2004-01-10 20:12 ` [Bug optimization/13634] " rosbacke at nada dot kth dot se
2004-01-21  7:37 ` ebotcazou at gcc dot gnu dot org
2004-03-11 11:16 ` ebotcazou at gcc dot gnu dot org
2004-03-27 16:18 ` 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).