diff mbox

Fix __ATOMIC_HLE* defines (PR target/53194)

Message ID 20120503100554.GW16117@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek May 3, 2012, 10:05 a.m. UTC
Hi!

On Wed, May 02, 2012 at 07:37:15PM +0400, Kirill Yukhin wrote:
> > Otherwise, this looks good.

> Thanks, I've applied inputs!
> 
> Comitted to MT: http://gcc.gnu.org/ml/gcc-cvs/2012-05/msg00047.html

As I mentioned in http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00730.html
this doesn't really work.  Fixed thusly, bootstrapped/regtested on
x86_64-linux and i686-linux, ok for trunk?

2012-05-03  Jakub Jelinek  <jakub@redhat.com>

	PR target/53194
	* config/i386/i386-c.c (ix86_target_macros_internal): Don't
	define __ATOMIC_HLE_* macros here.
	(ix86_target_macros): But here, using cpp_define_formatted.



	Jakub

Comments

Uros Bizjak May 3, 2012, 10:08 a.m. UTC | #1
On Thu, May 3, 2012 at 12:05 PM, Jakub Jelinek <jakub@redhat.com> wrote:

> On Wed, May 02, 2012 at 07:37:15PM +0400, Kirill Yukhin wrote:
>> > Otherwise, this looks good.
>
>> Thanks, I've applied inputs!
>>
>> Comitted to MT: http://gcc.gnu.org/ml/gcc-cvs/2012-05/msg00047.html
>
> As I mentioned in http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00730.html
> this doesn't really work.  Fixed thusly, bootstrapped/regtested on
> x86_64-linux and i686-linux, ok for trunk?

I have missed this post, sorry for not considering it. :(

> 2012-05-03  Jakub Jelinek  <jakub@redhat.com>
>
>        PR target/53194
>        * config/i386/i386-c.c (ix86_target_macros_internal): Don't
>        define __ATOMIC_HLE_* macros here.
>        (ix86_target_macros): But here, using cpp_define_formatted.

This is OK.

Thanks,
Uros.
diff mbox

Patch

--- gcc/config/i386/i386-c.c.jj	2012-05-03 08:35:52.000000000 +0200
+++ gcc/config/i386/i386-c.c	2012-05-03 09:02:45.139388086 +0200
@@ -54,7 +54,6 @@  ix86_target_macros_internal (HOST_WIDE_I
   size_t tune_len = strlen (ix86_tune_string);
   int last_arch_char = ix86_arch_string[arch_len - 1];
   int last_tune_char = ix86_tune_string[tune_len - 1];
-  char hle_macro[64];
 
   /* Built-ins based on -march=.  */
   switch (arch)
@@ -294,12 +293,6 @@  ix86_target_macros_internal (HOST_WIDE_I
     def_or_undef (parse_in, "__SSE_MATH__");
   if ((fpmath & FPMATH_SSE) && (isa_flag & OPTION_MASK_ISA_SSE2))
     def_or_undef (parse_in, "__SSE2_MATH__");
-
-  sprintf (hle_macro, "__ATOMIC_HLE_ACQUIRE=%d", IX86_HLE_ACQUIRE);
-  def_or_undef (parse_in, hle_macro);
-
-  sprintf (hle_macro, "__ATOMIC_HLE_RELEASE=%d", IX86_HLE_RELEASE);
-  def_or_undef (parse_in, hle_macro);
 }
 
 
@@ -403,6 +396,9 @@  ix86_target_macros (void)
       builtin_define_std ("i386");
     }
 
+  cpp_define_formatted (parse_in, "__ATOMIC_HLE_ACQUIRE=%d", IX86_HLE_ACQUIRE);
+  cpp_define_formatted (parse_in, "__ATOMIC_HLE_RELEASE=%d", IX86_HLE_RELEASE);
+
   ix86_target_macros_internal (ix86_isa_flags,
 			       ix86_arch,
 			       ix86_tune,