Bug 54131 - gcc reports internal compiler error in emit_move_insn_1
gcc reports internal compiler error in emit_move_insn_1
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.1
alpha Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-09-28 04:11 EDT by Ulrich Hagen
Modified: 2007-04-18 12:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-10-17 11:57:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Output of cpp of Obstack.cpp (g++ ... -E -o Obstack.cppoutput) treated with bzip2 (72.90 KB, application/octet-stream)
2001-10-02 04:01 EDT, Ulrich Hagen
no flags Details

  None (edit)
Description Ulrich Hagen 2001-09-28 04:11:38 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.3-12 alpha)

Description of problem:
When compiling ACE, I get

/home/hagen/medcom/ACE/ACE_wrappers/ace/Obstack_T.cpp: In method `CHAR
*ACE_Obstack_T<CHAR>::grow 
(CHAR) [with CHAR = char]':
Obstack.cpp:8:   instantiated from here
/home/hagen/medcom/ACE/ACE_wrappers/ace/Obstack_T.cpp:31: Internal compiler
error in emit_move_insn_1, 
at expr.c:2830

Compilation of ACE fails with
Internal compiler error in emit_move_insn_1, at expr.c:2830
when compiling Obstack.cpp

Version-Release number of selected component (if applicable): 2.96-87


How reproducible:
Always

Steps to Reproduce:
1. Download and install the latest beta ACE+TAO (5.1.21) from
   http://ace.cs.wustl.edu/Download.html
2. Configure it for Linux:
   cd include/makeinclude
   ln -s platform_linux.GNU platform_macros.GNU
   Uncomment the last three lines in this file, which deal with a problem
in gas on Alpha
   cd ../../ace
   ln -s config-linux.h config.h

   Correct the Makefile: the lines with 'COMPILE-NO_DASH_G.cc' have spaces
   instead of a TAB at the beginning :-(
   cd ..
3. Now 'make' it. Compilation will run into a problem with
g++ -W -Wall -Wpointer-arith -pipe -O3 -g -Wno-uninitialized
-fno-implicit-templates   -D_POSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS
-D_REENTRANT -DACE_HAS_AIO_CALLS  -I/home/hagen/medcom/ACE/ACE_wrappers
-DACE_HAS_EXCEPTIONS  -c -fPIC -o .shobj/Obstack.o Obstack.cpp
/home/hagen/medcom/ACE/ACE_wrappers/ace/Obstack_T.cpp: In method `CHAR
*ACE_Obstack_T<CHAR>::grow 
(CHAR) [with CHAR = char]':
Obstack.cpp:8:   instantiated from here
/home/hagen/medcom/ACE/ACE_wrappers/ace/Obstack_T.cpp:31: Internal compiler
error in emit_move_insn_1, 
at expr.c:2830


Actual Results:  Neither the ACE library nor the programs could be created.	

Expected Results:  Complete compiling/linking of ACE and TAO.

Additional info:

I tried this with gcc-2.96-87 and 2.96-97. No difference, both fail.
Comment 1 Ulrich Hagen 2001-10-02 04:01:28 EDT
Created attachment 33178 [details]
Output of cpp of Obstack.cpp (g++ ... -E -o Obstack.cppoutput) treated with bzip2
Comment 2 Jakub Jelinek 2001-10-17 11:57:51 EDT
Actually, it ICEs on Alpha too.
The problematic line is y *= sizeof(char); where 1 is substituted for y
during inlining. To one part of g++ this looks like there is no modification
of y, so it can be substituted, to some other part this is
y = (size_t) y;
Here is a patch which I'll include in gcc-2.96-100:
2001-10-17  Jakub Jelinek  <jakub@redhat.com>

        * optimize.c (copy_body_r): Ugly workaround for size_t casting
        problems.

        * g++.old-deja/g++.other/rh3.C: New test.

--- gcc/cp/optimize.c.jj        Fri Oct 12 16:49:24 2001
+++ gcc/cp/optimize.c   Wed Oct 17 17:58:28 2001
@@ -359,7 +359,15 @@ copy_body_r (tp, walk_subtrees, data)
       else if (TREE_CODE (*tp) == CALL_EXPR)
        CALL_EXPR_RTL (*tp) = NULL_RTX;
       else if (TREE_CODE (*tp) == MODIFY_EXPR
-              && TREE_OPERAND (*tp, 0) == TREE_OPERAND (*tp, 1)
+              && (TREE_OPERAND (*tp, 0) == TREE_OPERAND (*tp, 1)
+                     /* In 2.96-RH, there might be a (size_t) cast
+                        in between too.  */
+                  || (TREE_CODE (TREE_OPERAND (*tp, 1)) == NOP_EXPR
+                      && TREE_OPERAND (*tp, 0)
+                         == TREE_OPERAND (TREE_OPERAND (*tp, 1), 0)
+                      && TYPE_IS_SIZETYPE (TREE_TYPE (TREE_OPERAND (*tp, 1)))
+                      && TYPE_MODE (TREE_TYPE (TREE_OPERAND (*tp, 0)))
+                         == TYPE_MODE (TREE_TYPE (TREE_OPERAND (*tp, 1)))))
               && nonstatic_local_decl_p (TREE_OPERAND (*tp, 0))
               && DECL_CONTEXT (TREE_OPERAND (*tp, 0)) == fn)
        {
--- gcc/testsuite/g++.old-deja/g++.other/rh3.C.jj       Wed Oct 17 17:59:02 2001
+++ gcc/testsuite/g++.old-deja/g++.other/rh3.C  Wed Oct 17 17:59:43 2001
@@ -0,0 +1,12 @@
+// Build don't link:
+// Special g++ Options: -O3
+
+void foo (unsigned long y)
+{
+  y *= sizeof (char);
+}
+
+void bar (void)
+{
+  foo (1);
+}
Comment 3 Jakub Jelinek 2001-11-28 07:58:45 EST
The fix is in gcc-2.96-100 for some time already.
Comment 4 Bill Nottingham 2002-07-26 17:47:30 EDT
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2002-055.html
Comment 5 Bill Shirley 2003-07-22 14:04:13 EDT
I also get this error on i686 with compat-gcc-7.3-2.96.118, gcc-3.2.2-5, and 
gcc-3.3-14 when compiling the kernel with linux-abi-2.4.18.0.patch. In
abi/svr4/sysi86.c at line 135 which reads:
       case SI86FPHW:
                /*
                 * If we remove the 'static' from the definition
                 * of fpu_error in linux/init/main.c we can tell
                 * whether we are using hardware or software at
                 * least. For now let's lie...
                 * (actually SCO Unix 3.4 gives me -1...)
                 */
----->           return put_user(FP_387, arg1);   <---------
        case STIME:
                /*

Any chance for a fix?
Comment 6 Bill Shirley 2003-07-22 14:17:29 EDT
I forgot to add the sysout:

gcc -D__KERNEL__ -I/usr/src/linux-2.4.20-8/include -Wall -Wstrict-prototypes -
Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -
mpreferred-stack-boundary=2 -march=i686   -nostdinc -iwithprefix include -
DKBUILD_BASENAME=sysi86  -c -o sysi86.o sysi86.c
sysi86.c: In function `svr4_sysi86':
sysi86.c:133: internal compiler error: in emit_move_insn_1, at expr.c:3610
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccMJAW8k.out file, please attach this to 
your bugreport
make[3]: *** [sysi86.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.4.20-8/abi/svr4'
make[2]: *** [first_rule] Error 2
make[2]: Leaving directory `/usr/src/linux-2.4.20-8/abi/svr4'
make[1]: *** [_subdir_svr4] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.20-8/abi'
make: *** [_dir_abi] Error 2

Note You need to log in before you can comment on or make changes to this bug.