Bug 27765 - -fbounds-check gives undue warning with
Summary: -fbounds-check gives undue warning with
Status: RESOLVED DUPLICATE of bug 19777
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks: Fortran_bounds_checking
  Show dependency treegraph
 
Reported: 2006-05-24 21:37 UTC by Francois-Xavier Coudert
Modified: 2006-05-28 12:07 UTC (History)
9 users (show)

See Also:
Host:
Target:
Build:
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 Francois-Xavier Coudert 2006-05-24 21:37:51 UTC
I ran the gfortran testsuite with -fbounds-check and found a few failures (on i686-linux), among which was gfortran.dg/aliasing_dummy_1.f90. Here is a reduced testcase:

program test_lex
  type :: dtype
    character*5 :: word
  end type dtype

  type :: list
    type(dtype) :: list(1)
  end type list

  type(list) :: table

  call foo1 (table%list(1)%word)

contains

  subroutine foo1 (slist)
    character(*), dimension(*) :: slist
    write (slist(1), '(i5)') 0
  end subroutine foo1

end program test_lex

$ gfortran -fbounds-check bug.f90 && ./a.out 
Fortran runtime error: Array reference out of bounds
Comment 1 Andrew Pinski 2006-05-24 21:44:11 UTC
I bet $ 100 (or a beer at the GCC summit if you come) that the problem is with
dimension(*)

Which means this is a dup of bug 19777.
Comment 2 Francois-Xavier Coudert 2006-05-27 08:30:51 UTC
Right you are. Closed as duplicate.

*** This bug has been marked as a duplicate of 19777 ***
Comment 3 Andrew Pinski 2006-05-27 17:32:21 UTC
(In reply to comment #2)
> Right you are. Closed as duplicate.

FX, Are you comming to the GCC summit?
Comment 4 Francois-Xavier Coudert 2006-05-28 12:07:16 UTC
(In reply to comment #3)
> FX, Are you comming to the GCC summit?

Well, my employer has nothing to do with gfortra, so I won't be coming. But if you ever come to Paris, I'll offer you a beer!