public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/38260] vector_size attribute vs specialization
       [not found] <bug-38260-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-28  9:21 ` pinskia at gcc dot gnu.org
  2012-10-15 11:22 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-28  9:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38260

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.7.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-28 06:28:43 UTC ---
This still fails as of today.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/38260] vector_size attribute vs specialization
       [not found] <bug-38260-4@http.gcc.gnu.org/bugzilla/>
  2012-01-28  9:21 ` [Bug c++/38260] vector_size attribute vs specialization pinskia at gcc dot gnu.org
@ 2012-10-15 11:22 ` paolo.carlini at oracle dot com
  2012-10-15 12:59 ` glisse at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-15 11:22 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38260

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|gcc-bugs at gcc dot gnu.org |glisse at gcc dot gnu.org

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-15 11:22:40 UTC ---
Marc, are you aware of this? First blush it seems simple but weird.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/38260] vector_size attribute vs specialization
       [not found] <bug-38260-4@http.gcc.gnu.org/bugzilla/>
  2012-01-28  9:21 ` [Bug c++/38260] vector_size attribute vs specialization pinskia at gcc dot gnu.org
  2012-10-15 11:22 ` paolo.carlini at oracle dot com
@ 2012-10-15 12:59 ` glisse at gcc dot gnu.org
  2012-10-15 13:55 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-10-15 12:59 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38260

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> 2012-10-15 12:59:15 UTC ---
(In reply to comment #2)
> Marc, are you aware of this?

Yes, attributes don't work so well with templates. This particular case should
be fixable, but I'd rather we had a complete plan for vectors that would be as
easy to use as std::array.

> First blush it seems simple but weird.

If you can see how to fix it, please go ahead :-)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/38260] vector_size attribute vs specialization
       [not found] <bug-38260-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2012-10-15 12:59 ` glisse at gcc dot gnu.org
@ 2012-10-15 13:55 ` paolo.carlini at oracle dot com
  2014-06-11 20:38 ` paolo.carlini at oracle dot com
  2014-06-11 23:47 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-15 13:55 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38260

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-15 13:54:43 UTC ---
Yes. This one seems special, it seems purely a parsing issue.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/38260] vector_size attribute vs specialization
       [not found] <bug-38260-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2012-10-15 13:55 ` paolo.carlini at oracle dot com
@ 2014-06-11 20:38 ` paolo.carlini at oracle dot com
  2014-06-11 23:47 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-11 20:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38260

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paolo.carlini at oracle dot com

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Putting a break point in determine_specialization reveals that the attribute on
the return type gets lost, and post parser the code is essentially equivalent
to:

template< class T > T Abs(T);
template<> float Abs(__vector(4) float);

which of course cannot work. Indeed, for obvious reasons, both:

#define vf4 __attribute__((vector_size(16) )) float
template< class T > T Abs();
template<> vf4 Abs();

and

#define vf4 __attribute__((vector_size(16) )) float
template< class T > void Abs(T);
template<> void Abs(vf4);

are accepted.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/38260] vector_size attribute vs specialization
       [not found] <bug-38260-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-06-11 20:38 ` paolo.carlini at oracle dot com
@ 2014-06-11 23:47 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-11 23:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38260

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-06-11
                 CC|paolo.carlini at oracle dot com    |
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com
     Ever confirmed|0                           |1

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
With the below, the attributes are applied to the bare float return type
*before* the specialization is checked, and the testcase finally is accepted.
But I didn't regression test anything, and at the moment I have no idea if
there are other unwanted effects of anticipating cplus_decl_attributes.

Index: decl.c
===================================================================
--- decl.c    (revision 211478)
+++ decl.c    (working copy)
@@ -7786,6 +7786,12 @@ grokfndecl (tree ctype,
       && !processing_template_decl)
     deduce_noexcept_on_destructor (decl);

+  if (attrlist)
+    {
+      cplus_decl_attributes (&decl, *attrlist, 0);
+      *attrlist = NULL_TREE;
+    }
+
   decl = check_explicit_specialization (orig_declarator, decl,
                     template_count,
                     2 * funcdef_flag +
@@ -7796,12 +7802,6 @@ grokfndecl (tree ctype,
   if (DECL_STATIC_FUNCTION_P (decl))
     check_static_quals (decl, quals);

-  if (attrlist)
-    {
-      cplus_decl_attributes (&decl, *attrlist, 0);
-      *attrlist = NULL_TREE;
-    }
-
   /* Check main's type after attributes have been applied.  */
   if (ctype == NULL_TREE && DECL_MAIN_P (decl))
     {


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-11 23:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-38260-4@http.gcc.gnu.org/bugzilla/>
2012-01-28  9:21 ` [Bug c++/38260] vector_size attribute vs specialization pinskia at gcc dot gnu.org
2012-10-15 11:22 ` paolo.carlini at oracle dot com
2012-10-15 12:59 ` glisse at gcc dot gnu.org
2012-10-15 13:55 ` paolo.carlini at oracle dot com
2014-06-11 20:38 ` paolo.carlini at oracle dot com
2014-06-11 23:47 ` paolo.carlini at oracle dot com

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).