public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [ia64 PATCH] Fix up ia64 attribute handling (PR target/61137)
@ 2014-11-20 18:44 Jakub Jelinek
  2014-11-21 11:22 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2014-11-20 18:44 UTC (permalink / raw)
  To: Steve Ellcey, Andreas Schwab; +Cc: gcc-patches

Hi!

Seems the gcc.target/ia64/small-addr-1.c testcase is failing on ia64 since
r210262 but clearly has been failing for much longer if compiled with C++
(just there is insufficient testsuite coverage).
The problem is that for the model attribute (and apparently common_object on
VMS too), the argument of that attribute is supposed to be an identifier
rather than expression (for common_object either an identifier or string),
and these days one has to tell the frontends about that in order not to
get the argument parsed as an expression.

The following untested patch fixes that (tested on small-addr-1.c with
a cross-compiler), I don't have ia64 hw nor spare cycles to test this
though, so I'm just offering the patch as is if anyone wants to test it.
Perhaps better testsuite coverage wouldn't hurt (test the model (small)
attribute also in C++, perhaps test the common_object attribute on VMS?).

2014-11-20  Jakub Jelinek  <jakub@redhat.com>

	PR target/61137
	* config/ia64/ia64.c (ia64_attribute_takes_identifier_p): New function.
	(TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P): Redefine to it.

--- gcc/config/ia64/ia64.c.jj	2014-11-11 00:06:23.000000000 +0100
+++ gcc/config/ia64/ia64.c	2014-11-20 11:51:59.729478773 +0100
@@ -324,6 +324,7 @@ static bool ia64_vms_valid_pointer_mode
 static tree ia64_vms_common_object_attribute (tree *, tree, tree, int, bool *)
      ATTRIBUTE_UNUSED;
 
+static bool ia64_attribute_takes_identifier_p (const_tree);
 static tree ia64_handle_model_attribute (tree *, tree, tree, int, bool *);
 static tree ia64_handle_version_id_attribute (tree *, tree, tree, int, bool *);
 static void ia64_encode_section_info (tree, rtx, int);
@@ -669,8 +670,26 @@ static const struct attribute_spec ia64_
 #undef TARGET_VECTORIZE_VEC_PERM_CONST_OK
 #define TARGET_VECTORIZE_VEC_PERM_CONST_OK ia64_vectorize_vec_perm_const_ok
 
+#undef TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P
+#define TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P ia64_attribute_takes_identifier_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
+/* Returns TRUE iff the target attribute indicated by ATTR_ID takes a plain
+   identifier as an argument, so the front end shouldn't look it up.  */
+
+static bool
+ia64_attribute_takes_identifier_p (const_tree attr_id)
+{
+  if (is_attribute_p ("model", attr_id))
+    return true;
+#if TARGET_ABI_OPEN_VMS
+  if (is_attribute_p ("common_object", attr_id))
+    return true;
+#endif
+  return false;
+}
+
 typedef enum
   {
     ADDR_AREA_NORMAL,	/* normal address area */

	Jakub

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

* Re: [ia64 PATCH] Fix up ia64 attribute handling (PR target/61137)
  2014-11-20 18:44 [ia64 PATCH] Fix up ia64 attribute handling (PR target/61137) Jakub Jelinek
@ 2014-11-21 11:22 ` Andreas Schwab
  2014-11-21 12:07   ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2014-11-21 11:22 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Steve Ellcey, gcc-patches

Jakub Jelinek <jakub@redhat.com> writes:

> The following untested patch fixes that (tested on small-addr-1.c with
> a cross-compiler), I don't have ia64 hw nor spare cycles to test this
> though, so I'm just offering the patch as is if anyone wants to test it.
> Perhaps better testsuite coverage wouldn't hurt (test the model (small)
> attribute also in C++, perhaps test the common_object attribute on VMS?).
>
> 2014-11-20  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR target/61137
> 	* config/ia64/ia64.c (ia64_attribute_takes_identifier_p): New function.
> 	(TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P): Redefine to it.

Looks good.

http://gcc.gnu.org/ml/gcc-testresults/2014-11/msg02276.html

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [ia64 PATCH] Fix up ia64 attribute handling (PR target/61137)
  2014-11-21 11:22 ` Andreas Schwab
@ 2014-11-21 12:07   ` Richard Biener
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Biener @ 2014-11-21 12:07 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Jakub Jelinek, Steve Ellcey, GCC Patches

On Fri, Nov 21, 2014 at 12:01 PM, Andreas Schwab <schwab@suse.de> wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
>
>> The following untested patch fixes that (tested on small-addr-1.c with
>> a cross-compiler), I don't have ia64 hw nor spare cycles to test this
>> though, so I'm just offering the patch as is if anyone wants to test it.
>> Perhaps better testsuite coverage wouldn't hurt (test the model (small)
>> attribute also in C++, perhaps test the common_object attribute on VMS?).
>>
>> 2014-11-20  Jakub Jelinek  <jakub@redhat.com>
>>
>>       PR target/61137
>>       * config/ia64/ia64.c (ia64_attribute_takes_identifier_p): New function.
>>       (TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P): Redefine to it.
>
> Looks good.
>
> http://gcc.gnu.org/ml/gcc-testresults/2014-11/msg02276.html

Ok.

Thanks,
Richard.

> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

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

end of thread, other threads:[~2014-11-21 11:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-20 18:44 [ia64 PATCH] Fix up ia64 attribute handling (PR target/61137) Jakub Jelinek
2014-11-21 11:22 ` Andreas Schwab
2014-11-21 12:07   ` Richard Biener

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