Bug 43840 - ICE in gcc 4.6.0 with -O1 -finline-small-functions
Summary: ICE in gcc 4.6.0 with -O1 -finline-small-functions
Status: RESOLVED DUPLICATE of bug 43791
Alias: None
Product: gcc
Classification: Unclassified
Component: regression (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-21 19:11 UTC by Tom Rothrock
Modified: 2010-04-21 20:23 UTC (History)
3 users (show)

See Also:
Host: x86_64-redhat-linux
Target: x86_64-redhat-linux
Build: x86_64-redhat-linux
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Rothrock 2010-04-21 19:11:57 UTC
Program compiles correctly with GCC 4.1.2, 4.2.4, 4.3.4, 4.4.3, and 4.5.0 at -O3.  In GCC 4.6.0-20100419, program compiles correctly at -O1, but ICE occurs with -O1 -finline-small-functions.  ICE also occurs at -O2 and higher.  GCC 4.6.0 was built from source checked out of SVN on 19 Apr 2010.  Host system is RHEL 5.5 on AMD Barcelona processors.

$ cat tfail.c
/* tfail.c */

typedef unsigned long int (*a)(unsigned long int *);

extern __inline__ unsigned long int e(unsigned long int *d){
  unsigned long int r;
  u(r,d);
  return r;
}

a s(a f){
  return f;
}

int main(void){
  unsigned long int b[1];
  unsigned long int c;
  int i;

  for(i=0;i<1;i++){
    c=(*s(e))(b);
    c=(*s(e))(b);
  }
  return 0;
}

$ /opt/gcc/4.6/bin/gcc -c tfail.c -O1

$ /opt/gcc/4.6/bin/gcc -c tfail.c -O1 -finline-small-functions
tfail.c:25:1: internal compiler error: in cgraph_decide_inlining_of_small_functions, at ipa-inline.c:1009
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ /opt/gcc/4.6/bin/gcc --version
gcc (GCC) 4.6.0 20100419 (experimental)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ /opt/gcc/4.6/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/opt/gcc/4.6/bin/gcc
COLLECT_LTO_WRAPPER=/opt/gcc/4.6/libexec/gcc/x86_64-redhat-linux/4.6.0/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --host=x86_64-redhat-linux --build=x86_64-redhat-linux --target=x86_64-redhat-linux --enable-shared --enable-static --prefix=/opt/gcc/4.6 --disable-libmudflap --enable-__cxa_atexit --enable-check=thorough --enable-languages=c,c++,fortran --enable-multilib --with-pic --enable-stage1-checking=yes --disable-nls --enable-shared=libgfortran --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --with-mpfrcx=/usr/local --with-ppl=/usr/local --with-cloog=/usr/local
Thread model: posix
gcc version 4.6.0 20100419 (experimental) (GCC)
Comment 1 Richard Biener 2010-04-21 20:23:22 UTC

*** This bug has been marked as a duplicate of 43791 ***