Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 153268 - gcc hangs while compiling src/lat_ops.c from lmbench-3.0-a4
Summary: gcc hangs while compiling src/lat_ops.c from lmbench-3.0-a4
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-04-04 10:25 UTC by Arenas Belon, Carlo Marcelo
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 4.0.0-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-04-26 15:27:09 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
GNU Compiler Collection 20742 None None None Never

Description Arenas Belon, Carlo Marcelo 2005-04-04 10:25:25 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040808 Firefox/0.9.3

Description of problem:
while running :

gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_DRAND48   -o ../bin/x86_64-linux-gnu/lat_ops lat_ops.c ../bin/x86_64-linux-gnu/lmbench.a -lm

the cc1 (/usr/libexec/gcc/x86_64-redhat-linux/4.0.0/cc1 -quiet -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_DRAND48 lat_ops.c -quiet -dumpbase lat_ops.c -mtune=k8 -auxbase lat_ops -O -o /tmp/ccblf70L.s) process eats 100% CPU but does nothing, leaving the generated assembler file incomplete as shown by the last 2 lines :

  xorl    %edx, %ecx
  orl     %ecx, %ed

while trying to force a core dump through a segfault the culprit seems to be :

lat_ops.c: In function 'do_integer_add':
lat_ops.c:97: internal compiler error: Segmentation fault

which corresponds to the following partially unrolled loop (including associated defines):

static volatile uint64  use_result_dummy;

use_int(int result) { use_result_dummy += result; }

struct _state {
        int     N;
        int     M;
        int     K;
        double* data;

#define TEN(a) a a a a a a a a a a
#define HUNDRED(a) TEN(TEN(a))

do_integer_add(iter_t iterations, void* cookie)
        struct _state *pState = (struct _state*)cookie;
        register int a = pState->N + 57;
        register int b = pState->N + 31;
        while (iterations-- > 0) {
                HUNDRED(a += b; b -= a;)

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

How reproducible:

Steps to Reproduce:
1. wget && tar -xvzf lmbench-3.0-a4.tgz
2. cd lmbench-3.0-a4 && make

Actual Results:  cc1 hang

Expected Results:  compile should have finished or at least shown an error saying why it couldn't

Additional info:

Comment 1 Jakub Jelinek 2005-04-26 15:27:09 UTC
Should be fixed in gcc-4.0.0-1.

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