Bug 33380 - Internal compiler error: in gen_lowpart_general, at rtlhooks.c:62
Summary: Internal compiler error: in gen_lowpart_general, at rtlhooks.c:62
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2007-09-10 16:16 UTC by Bill Long
Modified: 2010-09-19 18:50 UTC (History)
2 users (show)

See Also:
Host: x86_64-suse-linux
Target: x86_64-suse-linux
Build: x86_64-suse-linux
Known to work:
Known to fail:
Last reconfirmed: 2007-09-10 17:38:19


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Long 2007-09-10 16:16:43 UTC
Gfortran terminates with an internal compiler error for this test:

> cat test.f90
subroutine sub(var,thread_num)
!   derived from RTED_OpenMP/FORTRAN/SECTION_B/F_B_7_1_k_Z_s.f90
!   derived from RTED_OpenMP/FORTRAN/SECTION_B/F_B_7_2_k_Z_s.f90
    COMPLEX, INTENT(OUT) :: var
    integer, INTENT(IN) :: thread_num
    if (thread_num == 0) then
    !$OMP ATOMIC
            var = var + 2
    end if
end subroutine sub

> gfortran -fopenmp -c test.f90
test.f90: In function 'sub':
test.f90:7: internal compiler error: in gen_lowpart_general, at rtlhooks.c:62
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

> gfortran -v
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../xt-gcc-4.2.1/configure --prefix=/opt/gcc/4.2.1/snos --disable-nls --libdir=/opt/gcc/4.2.1/snos/lib --enable-languages=c,c++,fortran --with-gxx-include-dir=/opt/gcc/4.2.1/snos/include/g++ --with-slibdir=/opt/gcc/4.2.1/snos/lib --with-sy
Thread model: posix
gcc version 4.2.1 20070719 (rpm:3)
>
Comment 1 Andrew Pinski 2007-09-10 17:21:08 UTC
This works on the trunk.
Comment 2 kargls 2007-09-10 17:23:44 UTC
(In reply to comment #1)
> This works on the trunk.
> 

Not for me.

troutmask:sgk[210] gfc4x --version
GNU Fortran (GCC) 4.3.0 20070906 (experimental)

troutmask:sgk[211] gfc4x -o z -fopenmp l1.f90                                       
l1.f90: In function 'sub':
l1.f90:7: internal compiler error: in gen_lowpart_general, at rtlhooks.c:61
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

I have opteron hardware as does I believe Bill.
Comment 3 Andrew Pinski 2007-09-10 17:33:37 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > This works on the trunk.
> > 
> 
> Not for me.

I had forgot to add -fopenmp to the options.
Comment 4 Andrew Pinski 2007-09-10 17:38:18 UTC
Breakpoint 1, gen_lowpart_general (mode=3273328, x=0x31f420) at /Users/apinski/src/local/gcc/gcc/rtlhooks.c:61
61            gcc_assert (MEM_P (x));
(gdb) y
Undefined command: "y".  Try "help".
(gdb) p debug_rtx(x)
(concat:SC (reg:SF 65 [ D.1421 ])
    (reg:SF 66 [ D.1421+4 ]))

Comment 5 Andrew Pinski 2008-12-31 19:05:08 UTC
This works for me on the trunk now.
Comment 6 Jakub Jelinek 2010-09-19 18:50:35 UTC
Can't reproduce with either current trunk nor 4.4.4.