diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gimple.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/20091020-1_0.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/20091020-1_1.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/20091020-2_0.c | 18 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/20091020-2_1.c | 5 |
7 files changed, 66 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3e000cd424f..7e580c72348 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -6,6 +6,12 @@ 2009-10-20 Richard Guenther <rguenther@suse.de> + PR lto/41761 + * gimple.c (gimple_register_type): Make sure we register + the types main variant first. + +2009-10-20 Richard Guenther <rguenther@suse.de> + * gimple.c (gimple_types_compatible_p): Simplify. Move cheap checks before hashtable queries. Add checks for TYPE_NONALIASED_COMPONENT and DECL_NONADDRESSABLE_P. diff --git a/gcc/gimple.c b/gcc/gimple.c index d5b1cf7f1c7..f725a347bac 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -3809,6 +3809,12 @@ gimple_register_type (tree t) gcc_assert (TYPE_P (t)); + /* Always register the main variant first. This is important so we + pick up the non-typedef variants as canonical, otherwise we'll end + up taking typedef ids for structure tags during comparison. */ + if (TYPE_MAIN_VARIANT (t) != t) + gimple_register_type (TYPE_MAIN_VARIANT (t)); + if (gimple_types == NULL) gimple_types = htab_create (16381, gimple_type_hash, gimple_type_eq, 0); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7a862affcbb..0e4f1aff52c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2009-10-20 Richard Guenther <rguenther@suse.de> + + PR lto/41761 + * gcc.dg/lto/20091020-1_0.c: New testcase. + * gcc.dg/lto/20091020-1_1.c: Likewise. + * gcc.dg/lto/20091020-2_0.c: Likewise. + * gcc.dg/lto/20091020-2_1.c: Likewise. + 2009-10-20 Jakub Jelinek <jakub@redhat.com> PR debug/41340 diff --git a/gcc/testsuite/gcc.dg/lto/20091020-1_0.c b/gcc/testsuite/gcc.dg/lto/20091020-1_0.c new file mode 100644 index 00000000000..ef61e98b4cc --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091020-1_0.c @@ -0,0 +1,8 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-fPIC -shared -flto}} } */ + +typedef struct { + int NumPackStreams; +} CSzAr; +void cli_7unz (CSzAr db) { } + diff --git a/gcc/testsuite/gcc.dg/lto/20091020-1_1.c b/gcc/testsuite/gcc.dg/lto/20091020-1_1.c new file mode 100644 index 00000000000..899183a2459 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091020-1_1.c @@ -0,0 +1,15 @@ +typedef struct { + int NumPackStreams; +} CSzAr; +typedef struct { + CSzAr db; +} CSzArEx; +int SzArEx_Init(CSzArEx *p) +{ + return p->db.NumPackStreams; +} +int SzArEx_GetFolderFullPackSize(const CSzArEx *p) +{ + return p->db.NumPackStreams; +} + diff --git a/gcc/testsuite/gcc.dg/lto/20091020-2_0.c b/gcc/testsuite/gcc.dg/lto/20091020-2_0.c new file mode 100644 index 00000000000..7dcbb2da2ca --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091020-2_0.c @@ -0,0 +1,18 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-fPIC -shared -flto}} } */ + +typedef struct { + int NumPackStreams; +} CSzAr; +typedef struct { + CSzAr db; +} CSzArEx; +int SzArEx_Init(CSzArEx *p) +{ + return p->db.NumPackStreams; +} +int SzArEx_GetFolderFullPackSize(const CSzArEx *p) +{ + return p->db.NumPackStreams; +} + diff --git a/gcc/testsuite/gcc.dg/lto/20091020-2_1.c b/gcc/testsuite/gcc.dg/lto/20091020-2_1.c new file mode 100644 index 00000000000..9174f26c35c --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20091020-2_1.c @@ -0,0 +1,5 @@ +typedef struct { + int NumPackStreams; +} CSzAr; +void cli_7unz (CSzAr db) { } + |