User account creation filtered due to spam.

Bug 30486 - segfault in aggregate_value_p while bootstrapping fortran
Summary: segfault in aggregate_value_p while bootstrapping fortran
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2007-01-16 20:10 UTC by Bernhard Reutner-Fischer
Modified: 2007-11-23 17:54 UTC (History)
6 users (show)

See Also:
Host:
Target: arm-linux-uclibcgnueabi,arm-linux-gnueabi
Build:
Known to work:
Known to fail: 4.1.0 4.2.0
Last reconfirmed: 2007-01-23 17:53:28


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Reutner-Fischer 2007-01-16 20:10:57 UTC
/scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2-final/./gcc/cc1 -E -lang-fortran -traditional-cpp -D_LANGUAGE_FORTRAN -quiet -v -I. -I/scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/libgfortran -I. -I/scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/libgfortran/../gcc -I/scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/libgfortran/../gcc/config -I../.././gcc -I . -iprefix /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2-final/gcc/../lib/gcc/arm-linux-uclibcgnueabi/4.2.0/ -isystem /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2-final/./gcc/include -DHAVE_CONFIG_H -D_GNU_SOURCE -DPIC -isystem /scratch/obj.x86_64/buildroot.arm/build_arm/staging_dir/arm-linux-uclibcgnueabi/include -isystem /scratch/obj.x86_64/buildroot.arm/build_arm/staging_dir/arm-linux-uclibcgnueabi/sys-include -iquote/scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/libgfortran/io /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/libgfortran/generated/_mod_i8.F90 -Wall -fno-repack-arrays -fno-underscoring -fPIC -fworking-directory -O2 -o ice_on_armeabi.f95

$ egrep -v "^(#|$|!)" ice_on_armeabi.f95 
elemental function specific__mod_i8 (p1, p2)
   integer (kind=8), intent (in) :: p1, p2
   integer (kind=8) :: specific__mod_i8
   specific__mod_i8 = mod (p1, p2)
end function

(gdb) run
Starting program: /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2-final/gcc/f951 ice_on_armeabi.f95 -ffree-form -quiet -dumpbase _mod_i8.F90 -auxbase-strip .libs/_mod_i8.o -g -O2 -Wall -version -fno-repack-arrays -fno-underscoring -fPIC -I. -I/scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/libgfortran -I. -I/scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/libgfortran/../gcc -I/scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/libgfortran/../gcc/config -I../.././gcc -I . -fpreprocessed -I finclude -o /dev/null 
GNU F95 version 4.2.0 20070115 (prerelease) (arm-linux-uclibcgnueabi)
        compiled by GNU C version 4.0.3 (Ubuntu 4.0.3-1ubuntu5).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

Program received signal SIGSEGV, Segmentation fault.
aggregate_value_p (exp=0x0, fntype=0x0)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/function.c:1756
1756      tree type = (TYPE_P (exp)) ? exp : TREE_TYPE (exp);
(gdb) bt  
#0  aggregate_value_p (exp=0x0, fntype=0x0)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/function.c:1756
#1  0x00000000004dbdc5 in emit_library_call_value_1 (retval=1, 
    orgfun=0x2aaaab15ea40, value=0x0, fn_type=LCT_CONST, outmode=TImode, 
    nargs=<value optimized out>, p=0x7fffffa29800)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/calls.c:3312
#2  0x00000000004dc435 in emit_library_call_value (orgfun=0x0, value=0x0, 
    fn_type=LCT_THROW, outmode=TImode, nargs=2)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/calls.c:3967
#3  0x00000000005d9b7a in expand_twoval_binop_libfunc (
    binoptab=<value optimized out>, op0=0x2aaaab1989e0, op1=0x2aaaab1989c0, 
    targ0=dwarf2_read_address: Corrupted DWARF expression.
)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/optabs.c:2283
#4  0x000000000052b6e9 in expand_divmod (rem_flag=1, code=TRUNC_MOD_EXPR, 
    mode=DImode, op0=0x2aaaab1989e0, op1=0x2aaaab1989c0, 
    target=0x2aaaab198980, unsignedp=0)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/expmed.c:4914
#5  0x0000000000534bcd in expand_expr_real_1 (exp=<value optimized out>, 
    target=0x2aaaab198980, tmode=<value optimized out>, 
    modifier=<value optimized out>, alt_rtl=0x0)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/expr.c:8189
#6  0x00000000005382cb in expand_expr_real (exp=0x2aaaab0ec370, 
    target=0x2aaaab198980, tmode=DImode, modifier=EXPAND_NORMAL, alt_rtl=0x0)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/expr.c:6706
#7  0x0000000000631324 in expand_return (retval=0x2aaaab0ec5a0) at expr.h:493
#8  0x0000000000534995 in expand_expr_real_1 (exp=<value optimized out>, 
    target=0x2aaaab0eb400, tmode=<value optimized out>, 
    modifier=<value optimized out>, alt_rtl=0x0)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/expr.c:8613
#9  0x00000000005382cb in expand_expr_real (exp=0x2aaaab197100, 
    target=0x2aaaab0eb400, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/expr.c:6706
#10 0x0000000000630fd9 in expand_expr_stmt (exp=0x0) at expr.h:493
#11 0x000000000065ac16 in expand_gimple_basic_block (bb=0x2aaaab19a100)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/cfgexpand.c:1383
#12 0x000000000065bd0b in tree_expand_cfg ()
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/cfgexpand.c:1649
#13 0x00000000006591c8 in execute_one_pass (pass=0x9f89e0)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/passes.c:870
#14 0x000000000065933c in execute_pass_list (pass=0x9f89e0)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/passes.c:917
#15 0x000000000048df4e in tree_rest_of_compilation (fndecl=0x2aaaab1961c0)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/tree-optimize.c:463
#16 0x0000000000694a02 in cgraph_expand_function (node=0x2aaaab192600)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/cgraphunit.c:1241
#17 0x0000000000695382 in cgraph_optimize ()
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/cgraphunit.c:1306
#18 0x0000000000461c2d in gfc_be_parse_file (set_yydebug=<value optimized out>)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/fortran/f95-lang.c:307
#19 0x000000000063956e in toplev_main (argc=<value optimized out>, argv=0x0)
    at /scratch/obj.x86_64/buildroot.arm/toolchain_build_arm/gcc-4.2/gcc/toplev.c:1033
#20 0x00002aaaaae9e49b in __libc_start_main () from /lib/libc.so.6
#21 0x00000000004046da in _start () at ../sysdeps/x86_64/elf/start.S:113
(gdb)
Comment 1 Martin Michlmayr 2007-01-23 17:51:35 UTC
My backtrace looks slightly different but I can confirm this bug for arm-linux-gnueabi.  Lennert Buytenhek reported on debian-arm that fortran fails to bootstrap when building natively and I verified that the testcase also segfaults for me - both with current GCC 4.1 and 4.2 from SVN.

Program received signal SIGSEGV, Segmentation fault.
aggregate_value_p (exp=0x0, fntype=0x0) at /home/tbm/scratch/gcc-4.2/gcc/function.c:1756
1756      tree type = (TYPE_P (exp)) ? exp : TREE_TYPE (exp);
(gdb) where
#0  aggregate_value_p (exp=0x0, fntype=0x0) at /home/tbm/scratch/gcc-4.2/gcc/function.c:1756
#1  0x00000000004d9b7b in emit_library_call_value_1 (retval=1, orgfun=0x2b407a3468e0, value=0x0,
    fn_type=LCT_CONST, outmode=TImode, nargs=<value optimized out>, p=0x7fff30ef3e20)
    at /home/tbm/scratch/gcc-4.2/gcc/calls.c:3312
#2  0x00000000004da125 in emit_library_call_value (orgfun=0x0, value=0x0, fn_type=LCT_THROW,
    outmode=TImode, nargs=2) at /home/tbm/scratch/gcc-4.2/gcc/calls.c:3967
#3  0x00000000005d49ba in expand_twoval_binop_libfunc (binoptab=<value optimized out>,
    op0=0x2b407a363f20, op1=0x2b407a363f00, targ0=0x0, targ1=0x2b407a380320, code=MOD)
    at /home/tbm/scratch/gcc-4.2/gcc/optabs.c:2283
#4  0x00000000005289cf in expand_divmod (rem_flag=1, code=<value optimized out>, mode=DImode,
    op0=0x2b407a363f20, op1=0x2b407a363f00, target=0x2b407a363ee0, unsignedp=0)
    at /home/tbm/scratch/gcc-4.2/gcc/expmed.c:4914
#5  0x000000000052e887 in expand_expr_real_1 (exp=0x2b407a2d4280, target=0x2b407a363ee0,
    tmode=<value optimized out>, modifier=<value optimized out>, alt_rtl=0x7fff30ef4270)
    at /home/tbm/scratch/gcc-4.2/gcc/expr.c:8189
#6  0x00000000005327c9 in expand_expr_real (exp=0x2b407a2d4280, target=0x2b407a363ee0, tmode=DImode,
    modifier=EXPAND_NORMAL, alt_rtl=0x7fff30ef4270) at /home/tbm/scratch/gcc-4.2/gcc/expr.c:6706
#7  0x000000000053783d in store_expr (exp=0x0, target=0x2b407a363ee0, call_param_p=0)
    at /home/tbm/scratch/gcc-4.2/gcc/expr.c:4370
#8  0x0000000000539147 in expand_assignment (to=0x2b407a37e160, from=<value optimized out>)
    at /home/tbm/scratch/gcc-4.2/gcc/expr.c:4249
#9  0x000000000052e709 in expand_expr_real_1 (exp=0x2b407a2d4460, target=0x2b407a2d3400,
    tmode=<value optimized out>, modifier=<value optimized out>, alt_rtl=<value optimized out>)
    at /home/tbm/scratch/gcc-4.2/gcc/expr.c:8604
#10 0x00000000005326b9 in expand_expr_real (exp=0x2b407a2d4460, target=0x2b407a2d3400,
    tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0) at /home/tbm/scratch/gcc-4.2/gcc/expr.c:6700
#11 0x0000000000629049 in expand_expr_stmt (exp=0x0) at /home/tbm/scratch/gcc-4.2/gcc/expr.h:493
#12 0x000000000064fed0 in expand_gimple_basic_block (bb=0x2b407a37f100)
    at /home/tbm/scratch/gcc-4.2/gcc/cfgexpand.c:1383
#13 0x0000000000650eda in tree_expand_cfg () at /home/tbm/scratch/gcc-4.2/gcc/cfgexpand.c:1649
#14 0x000000000064d4b8 in execute_one_pass (pass=0x9db040)
    at /home/tbm/scratch/gcc-4.2/gcc/passes.c:870
#15 0x000000000064d60c in execute_pass_list (pass=0x9db040)
    at /home/tbm/scratch/gcc-4.2/gcc/passes.c:917
#16 0x000000000048c22e in tree_rest_of_compilation (fndecl=0x2b407a37b1c0)
Comment 2 Paul Brook 2007-05-16 20:05:07 UTC
Fixed.

http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01010.html
Comment 3 Bernhard Reutner-Fischer 2007-11-23 12:24:22 UTC
Please backport to the 4_2-branch, too. Looks like this was only applied to trunk.
Comment 4 Andrew Pinski 2007-11-23 17:54:13 UTC
(In reply to comment #3)
> Please backport to the 4_2-branch, too. Looks like this was only applied to
> trunk.

So this is not a regression.