Bug 174061

Summary: gcc internal error
Product: [Fedora] Fedora Reporter: Frank Cusack <fcusack>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 4.0.1-4.fc4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-11-29 10:04:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
preprocessor output none

Description Frank Cusack 2005-11-24 07:23:24 UTC
From Bugzilla Helper:
User-Agent: Opera/8.5 (Macintosh; PPC Mac OS X; U; en)

Description of problem:
$ gcc -g -O2 -c -DSHOWBUG  bug.c
bug.c: In function `bug':
bug.c:18: error: unrecognizable insn:
(insn:HI 15 14 17 0 bug.c:16 (set (reg/f:SI 64)
        (const:SI (plus:SI (symbol_ref:SI ("foo") [flags 0x22] <var_decl 0xb7e4f1b0 foo>)
                (const_int 4 [0x4])))) -1 (nil)
    (nil))
bug.c:18: internal compiler error: in extract_insn, at recog.c:2083
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.


Version-Release number of selected component (if applicable):
gcc-3.4.4-2.fc3

How reproducible:
Always

Steps to Reproduce:
1. requires -O2
2. requires __thread variable
3. requires builtin memcpy() (using -fno-builtin avoids the bug)
4. requires 2 memcpy() statements

Actual Results:  gcc failed

Expected Results:  gcc should have succeeded

Additional info:

#include <string.h>     /* memcpy() */

static
#ifdef SHOWBUG
__thread
#endif
int foo[2];

void
bug(void)
{
  int bar;

  (void) memcpy(&foo[0], &bar, sizeof(bar));
#ifdef SHOWBUG
  (void) memcpy(&foo[1], &bar, sizeof(bar));
#endif
}

Comment 1 Frank Cusack 2005-11-24 07:45:08 UTC
Created attachment 121436 [details]
preprocessor output

Comment 2 Frank Cusack 2005-11-29 04:43:49 UTC
There's a second bug here:

> The bug is not reproducible, so it is likely a hardware or OS problem.

The bug is quite reproducible.  Message-ID <438BA8FF.9080600>
on the gcc list says this is probably a bug in a RH patch.

Comment 3 Jakub Jelinek 2005-11-29 10:04:19 UTC
As pointed out on gcc ml by Jim Wilson, you should file the PR in upstream
database.  Regarding the second problem, I can't reproduce it, for me it always
prints that the bug is reproducable on gcc 3.4.x.  The ICE is fixed in gcc 4.0.x.