This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/57742] memset(malloc(n),0,n) -> calloc(n,1)
- From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 Jun 2014 07:41:51 +0000
- Subject: [Bug tree-optimization/57742] memset(malloc(n),0,n) -> calloc(n,1)
- Auto-submitted: auto-generated
- References: <bug-57742-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57742
Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |---
--- Comment #18 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
The following now fails, so'll reopen this PR. It is at least related to
zeroing pvec twice in a row, and doesn seem to happen if I manually inline the
routine get_pseudo_param .
> cat bug.f90
MODULE atom_fit
INTEGER, PARAMETER :: dp=8
CONTAINS
SUBROUTINE atom_fit_pseudo ()
REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: x, xi
LOGICAL :: lsdpot
ALLOCATE(xi(200),STAT=ierr)
CALL get_pseudo_param(xi,lsdpot)
CALL foo(xi)
END SUBROUTINE atom_fit_pseudo
SUBROUTINE get_pseudo_param (pvec,lsdpot)
REAL(KIND=dp), DIMENSION(:), INTENT(out) :: pvec
LOGICAL :: lsdpot
IF(lsdpot) THEN
pvec = 0
pvec = 0
END IF
END SUBROUTINE get_pseudo_param
END MODULE atom_fit
> gfortran -c -O3 bug.f90
bug.f90: In function âatom_fit_pseudoâ:
bug.f90:4:0: internal compiler error: Segmentation fault
SUBROUTINE atom_fit_pseudo ()
^
0xa63a0f crash_signal
../../gcc/gcc/toplev.c:337
0x871f76 bb_seq_addr
../../gcc/gcc/gimple.h:1389
0x871f76 gsi_start_bb
../../gcc/gcc/gimple-iterator.h:118
0x871f76 gsi_for_stmt(gimple_statement_base*)
../../gcc/gcc/gimple-iterator.c:620
0xbfe1c1 handle_builtin_memset
../../gcc/gcc/tree-ssa-strlen.c:1653
0xbfe1c1 strlen_optimize_stmt
../../gcc/gcc/tree-ssa-strlen.c:1917
0xbfe1c1 strlen_dom_walker::before_dom_children(basic_block_def*)
../../gcc/gcc/tree-ssa-strlen.c:2096
0xfa483a dom_walker::walk(basic_block_def*)
../../gcc/gcc/domwalk.c:177
0xbf963d execute
../../gcc/gcc/tree-ssa-strlen.c:2170
Please submit a full bug report,