Hello, the attached code fails to compile with gcc 4.5.0 when enabling OpenMP: [kraused@cub ~]$ gcc -c -std=gnu99 test.c [kraused@cub ~]$ gcc -c -std=gnu99 -fopenmp test.c test.c: In function 'convert_u8_f32.omp_fn.0': test.c:31:9: internal compiler error: in expand_one_var, at cfgexpand.c:953 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. The gcc version is 4.5.0: [kraused@cub ~]$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/share/apps/gcc/4.5.0/gcc_412/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ./configure --prefix=/share/apps/gcc/4.5.0/gcc_412 --with-mpfr=/share/apps/mpfr/2.4.2/gcc_412 --with-gmp=/share/apps/gmp/5.0.1/gcc_412 --with-mpc=/share/apps/mpc/0.8.2/gcc_412 --enable-languages=c,c++,fortran Thread model: posix gcc version 4.5.0 (GCC) Btw. the code also fails to compile with the 4.1.2 gcc on my RHEL box: [kraused@icsprec03 ~]$ gcc -c -std=gnu99 -fopenmp convert.c convert.c: In function ‘convert_u8_s32.omp_fn.0’: convert.c:27: internal compiler error: in make_decl_rtl, at varasm.c:893 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugzilla.redhat.com/bugzilla> for instructions. Preprocessed source stored into /tmp/ccsIbyBy.out file, please attach this to your bugreport. [kraused@icsprec03 ~]$ gcc -v Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux Thread model: posix gcc version 4.1.2 20080704 (Red Hat 4.1.2-50) Unfortunately I don't have a newer gcc available right now for testing.
Created attachment 24688 [details] The test code
Created attachment 24703 [details] gcc47-pr49640.patch Untested fix.
Author: jakub Date: Thu Jul 7 12:49:17 2011 New Revision: 175967 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175967 Log: PR middle-end/49640 * gimplify.c (gimplify_compound_lval): For last 2 ARRAY_*REF operands and last COMPONENT_REF operand call gimplify_expr on it if non-NULL. * gcc.dg/gomp/pr49640.c: New test. Added: trunk/gcc/testsuite/gcc.dg/gomp/pr49640.c Modified: trunk/gcc/ChangeLog trunk/gcc/gimplify.c trunk/gcc/testsuite/ChangeLog
Author: jakub Date: Thu Jul 7 12:50:03 2011 New Revision: 175968 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175968 Log: PR middle-end/49640 * gimplify.c (gimplify_compound_lval): For last 2 ARRAY_*REF operands and last COMPONENT_REF operand call gimplify_expr on it if non-NULL. * gcc.dg/gomp/pr49640.c: New test. Added: branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/gomp/pr49640.c Modified: branches/gcc-4_6-branch/gcc/ChangeLog branches/gcc-4_6-branch/gcc/gimplify.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Fixed for 4.6/4.7+ so far.
Author: jakub Date: Tue Jul 19 13:06:00 2011 New Revision: 176455 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176455 Log: Backport from mainline 2011-07-07 Jakub Jelinek <jakub@redhat.com> PR middle-end/49640 * gimplify.c (gimplify_compound_lval): For last 2 ARRAY_*REF operands and last COMPONENT_REF operand call gimplify_expr on it if non-NULL. * gcc.dg/gomp/pr49640.c: New test. Added: branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/gomp/pr49640.c Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/gimplify.c branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
Author: jakub Date: Tue Jul 19 19:33:30 2011 New Revision: 176486 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176486 Log: Backport from mainline 2011-07-07 Jakub Jelinek <jakub@redhat.com> PR middle-end/49640 * gimplify.c (gimplify_compound_lval): For last 2 ARRAY_*REF operands and last COMPONENT_REF operand call gimplify_expr on it if non-NULL. * gcc.dg/gomp/pr49640.c: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/gomp/pr49640.c Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/gimplify.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Fixed.