Commit 22bea0be by Jan Hubicka Committed by Jan Hubicka

lto-symtab.c: Include alias.h

	* lto-symtab.c: Include alias.h
	(warn_type_compatibility_p): Replace types_compatible_p checks by
	TBAA and size checks; set bit 2 if locations are TBAA incompatible.
	(lto_symtab_merge): Compare DECL sizes.
	(lto_symtab_merge_decls_2): Warn about TBAA in compatibility.
	* gfortran.dg/lto/bind_c-6_0.f90: New testcase.
	* gfortran.dg/lto/bind_c-6_1.c: New testcase.

From-SVN: r230911
parent c74f743a
2015-11-24 Jan Hubicka <hubicka@ucw.cz> 2015-11-24 Jan Hubicka <hubicka@ucw.cz>
* lto-symtab.c: Include alias.h
(warn_type_compatibility_p): Replace types_compatible_p checks by
TBAA and size checks; set bit 2 if locations are TBAA incompatible.
(lto_symtab_merge): Compare DECL sizes.
(lto_symtab_merge_decls_2): Warn about TBAA in compatibility.
2015-11-24 Jan Hubicka <hubicka@ucw.cz>
* lto.c (iterative_hash_canonical_type): Recruse for all types * lto.c (iterative_hash_canonical_type): Recruse for all types
which pass !canonical_type_used_p. which pass !canonical_type_used_p.
(gimple_register_canonical_type_1): Sanity check we do not compute (gimple_register_canonical_type_1): Sanity check we do not compute
......
2015-11-23 Jan Hubicka <hubicka@ucw.cz>
* gfortran.dg/lto/bind_c-6_0.f90: New testcase.
* gfortran.dg/lto/bind_c-6_1.c: New testcase.
* g++.dg/lto/20100603-1_0.C: Add -Wno-lto-type-mismatch.
2015-11-25 Tom de Vries <tom@codesourcery.com> 2015-11-25 Tom de Vries <tom@codesourcery.com>
* g++.dg/tree-ssa/copyprop-1.C: Update after adding new dce1. * g++.dg/tree-ssa/copyprop-1.C: Update after adding new dce1.
......
/* { dg-lto-do link } */ /* { dg-lto-do link } */
/* { dg-extra-ld-options "-Wno-lto-type-mismatch" } */
extern "C" { extern "C" {
typedef struct {} CvImage; typedef struct {} CvImage;
......
! { dg-lto-do run }
! { dg-lto-options {{ -O3 -flto }} }
! This testcase will abort if C_FUNPTR is not interoperable with both int *
! and float *
module lto_type_merge_test
use, intrinsic :: iso_c_binding
implicit none
integer(c_size_t), bind(c, name="myVar") :: myVar
integer(c_size_t), bind(c, name="myVar2") :: myVar2
contains
subroutine types_test() bind(c)
myVar = myVar2
end subroutine types_test
end module lto_type_merge_test
#include <stdlib.h>
/* declared in the fortran module */
extern size_t myVar, myVar2;
void types_test(void);
extern void abort(void);
int main(int argc, char **argv)
{
size_t *myptr, *myptr2;
asm("":"=r"(myptr):"0"(&myVar));
asm("":"=r"(myptr2):"0"(&myVar2));
*myptr = 1;
*myptr2 = 2;
types_test();
if (*myptr != 2)
abort ();
if (*myptr2 != 2)
abort ();
*myptr2 = 3;
types_test();
if (*myptr != 3)
abort ();
if (*myptr2 != 3)
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment