Bug 41576 - LTO complains about mismatches in common sections
Summary: LTO complains about mismatches in common sections
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Richard Biener
URL:
Keywords: diagnostic, lto, wrong-code
Depends on:
Blocks:
 
Reported: 2009-10-05 10:55 UTC by Richard Biener
Modified: 2012-01-05 13:29 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-10-05 10:55:40


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2009-10-05 10:55:20 UTC
t1.f90
------
subroutine foo
  common /bar/ a, b
  integer(4) :: a ,b
  a = 1
  b = 2
end

t2.f90
------
program test
  common /bar/ c, d
  integer(4) :: c, d
  call foo
  if (c/=1 .or. d/=2) call abort
end program test


> ./gfortran -B. -B ../x86_64-unknown-linux-gnu/libgfortran/.libs -o t t1.f90 t2.f90 -flto
t1.f90:2:0: warning: type of 'bar' does not match original declaration
t2.f90:2:0: note: previously declared here

testcase reduced from for example 436.cactusADM
Comment 1 Richard Biener 2009-10-05 10:55:40 UTC
I have a patch.
Comment 2 Steven Bosscher 2010-04-08 10:39:50 UTC
What happened to the patch mentioned in comment #1?
Comment 3 Richard Biener 2010-04-08 11:01:57 UTC
They are still there and don't work completely.  There is a more complete
and proper solution in my mind but it's not implemented yet.
Comment 4 Richard Biener 2012-01-05 13:28:37 UTC
Author: rguenth
Date: Thu Jan  5 13:28:34 2012
New Revision: 182907

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182907
Log:
2012-01-05  Richard Guenther  <rguenther@suse.de>

	PR lto/41576
	* gfortran.dg/lto/pr41576_0.f90: New testcase.
	* gfortran.dg/lto/pr41576_1.f90: Likewise.

Added:
    trunk/gcc/testsuite/gfortran.dg/lto/pr41576_0.f90
    trunk/gcc/testsuite/gfortran.dg/lto/pr41576_1.f90
Modified:
    trunk/gcc/testsuite/ChangeLog
Comment 5 Richard Biener 2012-01-05 13:29:02 UTC
This was fixed for 4.6.