Bug seen with the RH version of gcc (gcc-3.4.4-2.fc3) but Jim Wilson says
he can reproduce this with the FSF gcc-3.4.4.
See Message-ID: <[EMAIL PROTECTED]> on gcc mailing list
and https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=174061

$ 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
}


-- 
           Summary: internal error with __thread and memcpy()
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fcusack at fcusack dot com


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

Reply via email to