Bug 37539 - [4.4 Regression] Hang for -O3
Summary: [4.4 Regression] Hang for -O3
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Ira Rosen
URL:
Keywords: compile-time-hog
Depends on:
Blocks:
 
Reported: 2008-09-16 08:17 UTC by David Binderman
Modified: 2008-09-24 03:24 UTC (History)
3 users (show)

See Also:
Host: suse-linux-x86_64
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-09-18 08:43:27


Attachments
C source code (7.82 KB, text/plain)
2008-09-16 08:18 UTC, David Binderman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2008-09-16 08:17:51 UTC
I just tried to compile the Suse Linux package liboil-0.3.14-17
with the most recent snapshot of gcc version 4.4, dated 20080912.

The compiler said

 gcc -DHAVE_CONFIG_H -I. -I../.. -Wall -D_BSD_SOURCE -D_GNU_SOURCE -I../.. -DOIL_ENABLE_UNSTABLE_API -O3 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -MT libref_la-yuv.lo -MD -MP -MF .deps/libref_la-yuv.Tpo -c yuv.c  -fPIC -DPIC -o .libs/libref_la-yuv.o
yuv.c:145: warning: missing initializer
yuv.c:145: warning: (near initialization for '_oil_function_impl_yuyv2ayuv_ref.profile_ave')
yuv.c:161: warning: missing initializer
yuv.c:161: warning: (near initialization for '_oil_function_impl_yvyu2ayuv_ref.profile_ave')
yuv.c:177: warning: missing initializer
yuv.c:177: warning: (near initialization for '_oil_function_impl_uyvy2ayuv_ref.profile_ave')
yuv.c:200: warning: missing initializer
yuv.c:200: warning: (near initialization for '_oil_function_impl_ayuv2yuyv_ref.profile_ave')
yuv.c:221: warning: missing initializer
yuv.c:221: warning: (near initialization for '_oil_function_impl_ayuv2yvyu_ref.profile_ave')
yuv.c:242: warning: missing initializer
yuv.c:242: warning: (near initialization for '_oil_function_impl_ayuv2uyvy_ref.profile_ave')
yuv.c:257: warning: missing initializer
yuv.c:257: warning: (near initialization for '_oil_function_impl_packyuyv_ref.profile_ave')
yuv.c:272: warning: missing initializer
yuv.c:272: warning: (near initialization for '_oil_function_impl_unpackyuyv_ref.profile_ave')

and proceeded to hang an otherwise idle machine for half an hour.

Preprocessed source code attached. Flag -O3 required to cause the hang.
Changing the -O3 flag to -O2 caused the file to compile in half a second.
Comment 1 David Binderman 2008-09-16 08:18:48 UTC
Created attachment 16336 [details]
C source code
Comment 2 Richard Biener 2008-09-16 13:14:56 UTC
There's a dup for this.
Comment 3 Andrew Pinski 2008-09-16 16:36:30 UTC
It is hanging in vectorizable_load. 
Comment 4 Ira Rosen 2008-09-18 07:26:21 UTC
Reduced testcase:

typedef struct _OilFunctionImpl OilFunctionImpl;

struct _OilFunctionImpl {
 void *func;
};

static void
ayuv2yuyv_ref (int *d, int *src, int n)
{
  char *dest = (char *)d;
  int i;

  for(i=0;i<n/2;i++){
    dest[i*4 + 0] = (((src[i*2 + 0])>>16)&0xff);
    dest[i*4 + 1] = ((((src[i*2 + 0])>>8)&0xff) + (((src[i*2] + 1)>>8)&0xff))/2;
    dest[i*4 + 2] = (((src[i*2 + 1])>>16)&0xff);
    dest[i*4 + 3] = ((((src[i*2 + 0])>>0)&0xff) + (((src[i*2] + 1)>>0)&0xff))/2;
  }
}

OilFunctionImpl _oil_function_impl_ayuv2yuyv_ref = {(void *)ayuv2yuyv_ref};
Comment 5 irar 2008-09-21 08:37:29 UTC
Subject: Bug 37539

Author: irar
Date: Sun Sep 21 08:36:07 2008
New Revision: 140522

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140522
Log:
	PR tree-optimization/37539
	* tree-vect-transform.c (vect_transform_strided_load): Save vector
	statement in related statement field only for the first load of the
	group of loads with the same data reference.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr37539.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-transform.c

Comment 6 irar 2008-09-21 08:52:23 UTC
Subject: Bug 37539

Author: irar
Date: Sun Sep 21 08:51:01 2008
New Revision: 140523

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140523
Log:

	PR tree-optimization/37539
	* tree-vect-transform.c (vect_transform_strided_load): Save vector
	statement in related statement field only for the first load of the
	group of loads with the same data reference.



Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/tree-vect-transform.c

Comment 7 Jakub Jelinek 2008-09-24 03:24:33 UTC
Fixed.