Bug 9090 - [3.2/3.3/3.4 regression?] arm ICE with >= -O2; regression from 2.95
Summary: [3.2/3.3/3.4 regression?] arm ICE with >= -O2; regression from 2.95
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2002-12-29 07:36 UTC by 168086
Modified: 2004-01-17 04:22 UTC (History)
2 users (show)

See Also:
Host: arm-linux
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
bug-168086-3.2.ii.gz (98.44 KB, application/x-gzip )
2003-05-21 15:17 UTC, 168086
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 168086 2002-12-29 07:36:01 UTC
[ Reported to the Debian BTS as report #168086.
  Please CC 168086@bugs.debian.org on replies.
  Log of report can be found at http://bugs.debian.org/168086 ]

The attached testcase ICEs on arm-linux with 3.2 branch 20021212 (-O2 
only, not -O). As the 3.3 branch doesn't bootstrap, I cannot check with 3.3. 
g++-2.95 did work ok, so this is a regression. 
 
$ gcc-3.2  -O2 -c bug-168086-3.2.ii  
GLinkGLvar/FGLvarHigh.C: In member function `virtual void  
   FGLvarHigh::xIdentify(short int)': 
GLinkGLvar/FGLvarHigh.C:736: Internal compiler error in elimination_effects, at   reload1.c:2837 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions. 
 
$ gcc-3.2  -O -c bug-168086-3.2.ii  
$

Release:
3.2.1 (Debian) (Debian unstable)

Environment:
System: Debian GNU/Linux (unstable)
Architecture: arm
host: arm-linux
Configured with: /home/packages/gcc/3.2/gcc-3.2-3.2.1ds5/src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc arm-linux
Comment 1 Richard Earnshaw 2003-01-11 09:04:58 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: The cause of PR 9090 comes from the fact that when we have
    
    (insn 127 126 128 1 0x40c653c8 (set (reg:SI 1 r1)
            (reg:SI 59)) 161 {*arm_movsi_insn} (nil)
        (expr_list:REG_EQUAL (addressof:SI (reg/v:DI 56) 55 0x40aa48c0)
            (nil)))
    
    purge_addressof_1, when applied to the notes fails to purge the address, 
    instead giving just
    
    (insn 127 126 128 1 0x40c653c8 (set (reg:SI 1 r1)
            (reg:SI 59)) 161 {*arm_movsi_insn} (nil)
        (expr_list:REG_EQUAL (addressof:SI (mem/s:DI (plus:SI (reg/f:SI 25 sfp)
                        (const_int -16 [0xfffffff0])) [14 S8 A32]) 55 
    0x40aa48c0)
    
    That is, it's pushed the referenced register onto the stack, but then 
    failed to simplify the resulting addressof expression.  However, the patch 
    seems so simple that I'm concerned that I've missed somthing obvious.
    
    Would someone care to comment?
    
    No regressions shown by an arm-elf cross build.
    
    <date>  Richard Earnshaw  <rearnsha@arm.com>
    
    	* function.c (purge_addressof_1): After pushing an addressed register
    	onto the stack, simplify the result.
    
    
    
    2.	addressof.patch	(text/x-patch)
    This is a text/x-patch
    It might be displayable with metamail.	(Invoke menu with right button.)
    Index: function.c
    ===================================================================
    RCS file: /cvs/gcc/gcc/gcc/function.c,v
    retrieving revision 1.392
    diff -p -r1.392 function.c
    *** function.c	10 Jan 2003 02:22:01 -0000	1.392
    --- function.c	11 Jan 2003 16:57:16 -0000
    *************** purge_addressof_1 (loc, insn, force, sto
    *** 3007,3016 ****
            rtx sub, insns;
      
            if (GET_CODE (XEXP (x, 0)) != MEM)
    ! 	{
    ! 	  put_addressof_into_stack (x, ht);
    ! 	  return true;
    ! 	}
      
            /* We must create a copy of the rtx because it was created by
      	 overwriting a REG rtx which is always shared.  */
    --- 3007,3013 ----
            rtx sub, insns;
      
            if (GET_CODE (XEXP (x, 0)) != MEM)
    ! 	put_addressof_into_stack (x, ht);
      
            /* We must create a copy of the rtx because it was created by
      	 overwriting a REG rtx which is always shared.  */
Comment 2 Richard Earnshaw 2003-01-27 10:45:24 UTC
From: rearnsha@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: optimization/9090
Date: 27 Jan 2003 10:45:24 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	rearnsha@gcc.gnu.org	2003-01-27 10:45:24
 
 Modified files:
 	gcc            : ChangeLog function.c 
 
 Log message:
 	PR optimization/9090
 	* function.c (purge_addressof_1): After pushing an addressed register
 	onto the stack, simplify the result.
 
 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.118&r2=1.16114.2.119
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.389&r2=1.389.2.1
 

Comment 3 Richard Earnshaw 2003-01-27 10:46:49 UTC
From: rearnsha@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: optimization/9090
Date: 27 Jan 2003 10:46:49 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	rearnsha@gcc.gnu.org	2003-01-27 10:46:47
 
 Modified files:
 	gcc            : ChangeLog function.c 
 
 Log message:
 	PR optimization/9090
 	* function.c (purge_addressof_1): After pushing an addressed register
 	onto the stack, simplify the result.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.16523&r2=1.16524
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.c.diff?cvsroot=gcc&r1=1.397&r2=1.398
 
Comment 4 Richard Earnshaw 2003-01-28 09:45:00 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: This has been fixed on the trunk and both maintained release branches.