diff options
author | Martin Jambor <mjambor@suse.cz> | 2013-01-21 18:16:57 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2013-01-21 18:16:57 +0100 |
commit | 5b9db1bc19b99bc1f401dcadeaa616155f31521a (patch) | |
tree | cc5bb08d0366e222ced364bd242ff1fda185c1b0 | |
parent | f6c23342da3e640e0d4fb36c2e74eb9c2f418894 (diff) | |
download | gcc-5b9db1bc19b99bc1f401dcadeaa616155f31521a.zip gcc-5b9db1bc19b99bc1f401dcadeaa616155f31521a.tar.gz gcc-5b9db1bc19b99bc1f401dcadeaa616155f31521a.tar.bz2 |
re PR middle-end/56022 (ICE (segfault) at convert_memory_address_addr_space (explow.c:334))
2013-01-21 Martin Jambor <mjambor@suse.cz>
PR middle-end/56022
* function.c (allocate_struct_function): Call
invoke_set_current_function_hook earlier.
testsuite/
* gcc.target/i386/pr56022.c: New test.
From-SVN: r195341
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/function.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr56022.c | 7 |
4 files changed, 24 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1aec9a3..20f2073 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-01-21 Martin Jambor <mjambor@suse.cz> + + PR middle-end/56022 + * function.c (allocate_struct_function): Call + invoke_set_current_function_hook earlier. + 2013-01-21 Jakub Jelinek <jakub@redhat.com> * reload1.c (init_reload): Only initialize reload_obstack diff --git a/gcc/function.c b/gcc/function.c index bb6a9ae..4ce2259 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4479,7 +4479,6 @@ get_last_funcdef_no (void) void allocate_struct_function (tree fndecl, bool abstract_p) { - tree result; tree fntype = fndecl ? TREE_TYPE (fndecl) : NULL_TREE; cfun = ggc_alloc_cleared_function (); @@ -4498,8 +4497,13 @@ allocate_struct_function (tree fndecl, bool abstract_p) DECL_STRUCT_FUNCTION (fndecl) = cfun; cfun->decl = fndecl; current_function_funcdef_no = get_next_funcdef_no (); + } + + invoke_set_current_function_hook (fndecl); - result = DECL_RESULT (fndecl); + if (fndecl != NULL_TREE) + { + tree result = DECL_RESULT (fndecl); if (!abstract_p && aggregate_value_p (result, fndecl)) { #ifdef PCC_STATIC_STRUCT_RETURN @@ -4518,8 +4522,6 @@ allocate_struct_function (tree fndecl, bool abstract_p) but is this worth the hassle? */ cfun->can_throw_non_call_exceptions = flag_non_call_exceptions; } - - invoke_set_current_function_hook (fndecl); } /* This is like allocate_struct_function, but pushes a new cfun for FNDECL diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index add76c9..0b3d2b7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-01-21 Martin Jambor <mjambor@suse.cz> + + PR middle-end/56022 + * gcc.target/i386/pr56022.c: New test. + 2013-01-21 Jason Merrill <jason@redhat.com> * lib/target-supports.exp (check_effective_target_alias): New. diff --git a/gcc/testsuite/gcc.target/i386/pr56022.c b/gcc/testsuite/gcc.target/i386/pr56022.c new file mode 100644 index 0000000..db43162 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr56022.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx" } */ + +typedef float __m256 __attribute__ ((__vector_size__ (32), __may_alias__)); +__attribute__((target("no-avx"))) static int currentImplementationSupported() +{} +__m256 foo0(__m256 a) {} |