public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-4762] parloops: Copy target and optimizations when creating a function clone
@ 2023-10-19 17:30 Andre Simoes Dias Vieira
  0 siblings, 0 replies; only message in thread
From: Andre Simoes Dias Vieira @ 2023-10-19 17:30 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:87d97e26076a131541e8562932248bc24590e38f

commit r14-4762-g87d97e26076a131541e8562932248bc24590e38f
Author: Andre Vieira <andre.simoesdiasvieira@arm.com>
Date:   Thu Oct 19 18:26:45 2023 +0100

    parloops: Copy target and optimizations when creating a function clone
    
    SVE simd clones require to be compiled with a SVE target enabled or the argument
    types will not be created properly. To achieve this we need to copy
    DECL_FUNCTION_SPECIFIC_TARGET from the original function declaration to the
    clones.  I decided it was probably also a good idea to copy
    DECL_FUNCTION_SPECIFIC_OPTIMIZATION in case the original function is meant to
    be compiled with specific optimization options.
    
    gcc/ChangeLog:
    
            * tree-parloops.cc (create_loop_fn): Copy specific target and
            optimization options to clone.

Diff:
---
 gcc/tree-parloops.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/tree-parloops.cc b/gcc/tree-parloops.cc
index e495bbd65270..a35f3d5023b0 100644
--- a/gcc/tree-parloops.cc
+++ b/gcc/tree-parloops.cc
@@ -2203,6 +2203,11 @@ create_loop_fn (location_t loc)
   DECL_CONTEXT (t) = decl;
   TREE_USED (t) = 1;
   DECL_ARGUMENTS (decl) = t;
+  DECL_FUNCTION_SPECIFIC_TARGET (decl)
+    = DECL_FUNCTION_SPECIFIC_TARGET (act_cfun->decl);
+  DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl)
+    = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (act_cfun->decl);
+
 
   allocate_struct_function (decl, false);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-19 17:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-19 17:30 [gcc r14-4762] parloops: Copy target and optimizations when creating a function clone Andre Simoes Dias Vieira

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).