From: Olivier Hainque Date: Tue, 6 May 2008 12:13:07 +0000 (+0000) Subject: tree-sra.c (try_instantiate_multiple_fields): Early return if field has POINTER_TYPE. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b9d6cf30e659c40d8458b22c6400f6da7bb0856;p=gcc.git tree-sra.c (try_instantiate_multiple_fields): Early return if field has POINTER_TYPE. * tree-sra.c (try_instantiate_multiple_fields): Early return if field has POINTER_TYPE. testsuite/ * gnat.dg/fatp_sra.adb: New test. From-SVN: r134982 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b8e97904198..1fe2793b4b3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-05-06 Olivier Hainque + + * tree-sra.c (try_instantiate_multiple_fields): Early return + if field has POINTER_TYPE. + 2008-05-06 Kai Tietz * config/i386/i386.c (output_set_got): Fix for x86_64 output_emit_asm diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ecae39579e6..25e806f37fb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-05-06 Olivier Hainque + + * gnat.dg/fatp_sra.adb: New test. + 2008-05-05 Andrew Pinski PR middle-end/36141 diff --git a/gcc/testsuite/gnat.dg/fatp_sra.adb b/gcc/testsuite/gnat.dg/fatp_sra.adb new file mode 100644 index 00000000000..a964737d11f --- /dev/null +++ b/gcc/testsuite/gnat.dg/fatp_sra.adb @@ -0,0 +1,17 @@ +-- { dg-do compile } +-- { dg-options "-gnatp -O1" } + +procedure Fatp_Sra is + + function X return String is + begin + return "X"; + end; + + function Letter return String is + begin + return X; + end; +begin + null; +end; diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 78a100f38d7..9e15f928bf3 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -1472,6 +1472,10 @@ try_instantiate_multiple_fields (struct sra_elt *elt, tree f) tree type, var; struct sra_elt *block; + /* Point fields are typically best handled as standalone entities. */ + if (POINTER_TYPE_P (TREE_TYPE (f))) + return f; + if (!is_sra_scalar_type (TREE_TYPE (f)) || !host_integerp (DECL_FIELD_OFFSET (f), 1) || !host_integerp (DECL_FIELD_BIT_OFFSET (f), 1)