Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 8396
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Eric Botcazou <ebotcazou@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: papadopo@shfj.remove.cea.decoy.fr
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
didispfn.i didispfn.i text/x-c 2003-05-21 15:17 90.88 KB Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 8396 depends on: Show dependency tree
Show dependency graph
Bug 8396 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2002-10-30 00:36
Hi,

I'm attempting to build the DICOM Toolkit using GCC 3.2 + GNU binutils 2.12.1 on SPARC / Solaris 8. I get this error:

c++     -DHAVE_CONFIG_H  -DNDEBUG  -c -I. -I. -I../include -I../../config/include -I../../ofstd/include -I../../dcmdata/include  \
         -O -I/usr/local/tiff/include -I/usr/local/openssl/include -D_REENTRANT -Wall -pedantic didispfn.cc 
../include/dicrvfit.h: In member function `int 
   DiDisplayFunction::interpolateValues()':
../include/dicrvfit.h:164: Internal compiler error in copy_to_mode_reg, at 
   explow.c:711
Please submit a full bug report,
with preprocessed source if appropriate.

This is an optimizer bug, removing the "-O" option flag fixes the bug.

I can work around the problem by changing the relevant code from:
        if (... && (xs < xe))
to:
        if (... && (xe > xs))

Note: I haven't tried removing useless stuff from the preprocessed file because I thought it wouldn't help in this particular case. I can try to build a minimal test case if that's important.

Release:
gcc-3.2

How-To-Repeat:
Compile the attached preprocessed file:
c++ -c -O didispfn.i

------- Comment #1 From papadopo@remove.shfj.decoy.cea.fr 2002-10-30 10:09 -------
From: Dimitri Papadopoulos <papadopo@REMOVE.shfj.DECOY.cea.fr>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   papadopo@shfj.REMOVE.cea.DECOY.fr.cea.fr, gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: optimization/8396: optimizer ICE on SPARC
Date: Wed, 30 Oct 2002 10:09:27 +0100

 This is a multi-part message in MIME format.
 --------------060007050009070405090207
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8396
 
 Attached is a much shorter example that reproduces the bug.
 
 --------------060007050009070405090207
 Content-Type: text/plain;
  name="didispfn.cc"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="didispfn.cc"
 
 template <typename T1>
 struct Foo
 {
     static void bar(const T1 xs, const T1 xe)
     {
         void *a;
 	void *b;
 	void *c;
         if (a && b && c && (xs < xe))
             ;
     }
 };
 
 
 int main()
 {
     short xe;
     Foo<short>::bar(0, xe);
 }
 
 --------------060007050009070405090207--
 

------- Comment #2 From Christian Ehrhardt 2002-12-20 06:49 -------
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed with 3.2 and 3.4, it is a regression from 2.95.
    An even simpler testcase is this:
    
    ---------------------------- cut ---------------------------
    struct Foo {
    	static void bar(const short xs, const short xe) {
    		if (xe && (xs < xe ))
    			;
    	}
    };
     
    int main()
    {   
    	short xe;
    	Foo::bar(0, xe);
    }
    ---------------------------- cut ---------------------------
    
    It ICEs in explow.c:731 in this function because GET_MODE(x) == HImode:
    
    rtx
    copy_to_mode_reg (mode, x)
         enum machine_mode mode;
         rtx x;
    { 
      rtx temp = gen_reg_rtx (mode);
    
      /* If not an operand, must be an address with PLUS and MULT so
         do the computation.  */
      if (! general_operand (x, VOIDmode))
        x = force_operand (x, temp);
    
      if (GET_MODE (x) != mode && GET_MODE (x) != VOIDmode)
        abort ();
      if (x != temp)
        emit_move_insn (temp, x);
      return temp;
    }
    
         regards   Christian

------- Comment #3 From Eric Botcazou 2003-03-11 13:54 -------
Responsible-Changed-From-To: unassigned->ebotcazou
Responsible-Changed-Why: Investigating.

------- Comment #4 From Eric Botcazou 2003-03-14 14:49 -------
From: ebotcazou@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: optimization/8396
Date: 14 Mar 2003 14:49:40 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	ebotcazou@gcc.gnu.org	2003-03-14 14:49:40
 
 Modified files:
 	gcc            : ChangeLog tree-inline.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/gcc.c-torture/compile: 20030314-1.c 
 
 Log message:
 	PR optimization/8396
 	* tree-inline.c (initialize_inlined_parameters): Make sure the value
 	of read-only constant arguments is passed with the right type.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.17078&r2=1.17079
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-inline.c.diff?cvsroot=gcc&r1=1.50&r2=1.51
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2505&r2=1.2506
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20030314-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
 


------- Comment #5 From Eric Botcazou 2003-03-14 14:53 -------
From: ebotcazou@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: optimization/8396
Date: 14 Mar 2003 14:53:57 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	ebotcazou@gcc.gnu.org	2003-03-14 14:53:57
 
 Modified files:
 	gcc            : ChangeLog tree-inline.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/gcc.c-torture/compile: 20030314-1.c 
 
 Log message:
 	PR optimization/8396
 	* tree-inline.c (initialize_inlined_parameters): Make sure the value
 	of read-only constant arguments is passed with the right type.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.298&r2=1.16114.2.299
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-inline.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.38.2.4&r2=1.38.2.5
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.98&r2=1.2261.2.99
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20030314-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
 


------- Comment #6 From Eric Botcazou 2003-03-14 14:59 -------
From: ebotcazou@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: optimization/8396
Date: 14 Mar 2003 14:59:35 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	ebotcazou@gcc.gnu.org	2003-03-14 14:59:35
 
 Modified files:
 	gcc            : ChangeLog tree-inline.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/gcc.c-torture/compile: 20030314-1.c 
 
 Log message:
 	PR optimization/8396
 	* tree-inline.c (initialize_inlined_parameters): Make sure the value
 	of read-only constant arguments is passed with the right type.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.13152.2.657.2.259&r2=1.13152.2.657.2.260
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-inline.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.15.2.3.4.2&r2=1.15.2.3.4.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.108&r2=1.1672.2.166.2.109
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20030314-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.4.1
 

------- Comment #7 From Eric Botcazou 2003-03-14 15:07 -------
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed. See http://gcc.gnu.org/ml/gcc-patches/2003-03/msg01134.html

------- Comment #8 From Andrew Pinski 2004-08-25 17:29 -------
*** Bug 9123 has been marked as a duplicate of this bug. ***

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug