public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] fix bootstrap on i686
@ 2007-05-15 15:12 Rafael Espindola
  2007-05-15 17:37 ` Rafael Espindola
  2007-05-16  8:32 ` Rafael Espindola
  0 siblings, 2 replies; 6+ messages in thread
From: Rafael Espindola @ 2007-05-15 15:12 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

This patch fixes the bootstrap by making
c_common_signed_or_unsigned_type behave as c_common_unsigned_type used
to. In particular, when passed a long it will return a long even if
another type has the same size.

This is currently bootstraping on a x86-64 and on a i686 (both linux).
OK if it bootstraps and has no regressions?

Cheers,
-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047

[-- Attachment #2: fix.patch --]
[-- Type: text/x-patch, Size: 2320 bytes --]

Index: gcc/c-common.c
===================================================================
--- gcc/c-common.c	(revision 124741)
+++ gcc/c-common.c	(working copy)
@@ -2065,10 +2065,37 @@
 tree
 c_common_signed_or_unsigned_type (int unsignedp, tree type)
 {
+  tree type1;
   if (!INTEGRAL_TYPE_P (type)
       || TYPE_UNSIGNED (type) == unsignedp)
     return type;
 
+  type1 = TYPE_MAIN_VARIANT (type);
+  if (type1 == signed_char_type_node || type1 == char_type_node || type1 == unsigned_char_type_node)
+    return unsignedp ? unsigned_char_type_node : signed_char_type_node;
+  if (type1 == integer_type_node || type1 == unsigned_type_node)
+    return unsignedp ? unsigned_type_node : integer_type_node;
+  if (type1 == short_integer_type_node || type1 == short_unsigned_type_node)
+    return unsignedp ? short_unsigned_type_node : short_integer_type_node;
+  if (type1 == long_integer_type_node || type1 == long_unsigned_type_node)
+    return unsignedp ? long_unsigned_type_node : long_integer_type_node;
+  if (type1 == long_long_integer_type_node || type1 == long_long_unsigned_type_node)
+    return unsignedp ? long_long_unsigned_type_node : long_long_integer_type_node;
+  if (type1 == widest_integer_literal_type_node || type1 == widest_unsigned_literal_type_node)
+    return unsignedp ? widest_unsigned_literal_type_node : widest_integer_literal_type_node;
+#if HOST_BITS_PER_WIDE_INT >= 64
+  if (type1 == intTI_type_node || type1 == unsigned_intTI_type_node)
+    return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
+#endif
+  if (type1 == intDI_type_node || type1 == unsigned_intDI_type_node)
+    return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
+  if (type1 == intSI_type_node || type1 == unsigned_intSI_type_node)
+    return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
+  if (type1 == intHI_type_node || type1 == unsigned_intHI_type_node)
+    return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
+  if (type1 == intQI_type_node || type1 == unsigned_intQI_type_node)
+    return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
+
   /* For ENUMERAL_TYPEs in C++, must check the mode of the types, not
      the precision; they have precision set to match their range, but
      may use a wider mode to match an ABI.  If we change modes, we may

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

* Re: [PATCH] fix bootstrap on i686
  2007-05-15 15:12 [PATCH] fix bootstrap on i686 Rafael Espindola
@ 2007-05-15 17:37 ` Rafael Espindola
  2007-05-15 19:47   ` Rafael Espindola
  2007-05-16  8:32 ` Rafael Espindola
  1 sibling, 1 reply; 6+ messages in thread
From: Rafael Espindola @ 2007-05-15 17:37 UTC (permalink / raw)
  To: gcc-patches

> This is currently bootstraping on a x86-64 and on a i686 (both linux).
> OK if it bootstraps and has no regressions?

The bootstrap finished both on x86_64 and on i686. Currently running
regression tests.


Cheers,
-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047

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

* Re: [PATCH] fix bootstrap on i686
  2007-05-15 17:37 ` Rafael Espindola
@ 2007-05-15 19:47   ` Rafael Espindola
  2007-05-15 20:43     ` Rafael Espindola
  0 siblings, 1 reply; 6+ messages in thread
From: Rafael Espindola @ 2007-05-15 19:47 UTC (permalink / raw)
  To: gcc-patches

> The bootstrap finished both on x86_64 and on i686. Currently running
> regression tests.

The regression tests on linux-i686 trunk r124741 + patch look good.
The reported regressions are no longer present. I am now bootstraping
r124714 (124715 is my previous patch) to check if there are any diffs.

The x86-64 regression tests should finish in a moment.

Cheers,
-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047

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

* Re: [PATCH] fix bootstrap on i686
  2007-05-15 19:47   ` Rafael Espindola
@ 2007-05-15 20:43     ` Rafael Espindola
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael Espindola @ 2007-05-15 20:43 UTC (permalink / raw)
  To: gcc-patches

> The x86-64 regression tests should finish in a moment.
Looks good.

Currently I am running the tests on r124714 (i686 and x86-64).
Tomorrow morning I will compare the results.

Cheers,
-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047

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

* Re: [PATCH] fix bootstrap on i686
  2007-05-15 15:12 [PATCH] fix bootstrap on i686 Rafael Espindola
  2007-05-15 17:37 ` Rafael Espindola
@ 2007-05-16  8:32 ` Rafael Espindola
       [not found]   ` <DB636EE3-9C83-416A-93A2-29FE55DD082D@apple.com>
  1 sibling, 1 reply; 6+ messages in thread
From: Rafael Espindola @ 2007-05-16  8:32 UTC (permalink / raw)
  To: gcc-patches

The patch bootstraped with no regressions on i686 and x86-64. OK for trunk?

Cheers,
-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047

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

* Re: [PATCH] fix bootstrap on i686
       [not found]   ` <DB636EE3-9C83-416A-93A2-29FE55DD082D@apple.com>
@ 2007-05-16  8:36     ` Rafael Espindola
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael Espindola @ 2007-05-16  8:36 UTC (permalink / raw)
  To: Eric Christopher; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 107 bytes --]

> No attachment... :)
It was attached in the first message, but here it is again.

> -eric

Cheers,
Rafael

[-- Attachment #2: fix.patch --]
[-- Type: text/x-patch, Size: 2320 bytes --]

Index: gcc/c-common.c
===================================================================
--- gcc/c-common.c	(revision 124741)
+++ gcc/c-common.c	(working copy)
@@ -2065,10 +2065,37 @@
 tree
 c_common_signed_or_unsigned_type (int unsignedp, tree type)
 {
+  tree type1;
   if (!INTEGRAL_TYPE_P (type)
       || TYPE_UNSIGNED (type) == unsignedp)
     return type;
 
+  type1 = TYPE_MAIN_VARIANT (type);
+  if (type1 == signed_char_type_node || type1 == char_type_node || type1 == unsigned_char_type_node)
+    return unsignedp ? unsigned_char_type_node : signed_char_type_node;
+  if (type1 == integer_type_node || type1 == unsigned_type_node)
+    return unsignedp ? unsigned_type_node : integer_type_node;
+  if (type1 == short_integer_type_node || type1 == short_unsigned_type_node)
+    return unsignedp ? short_unsigned_type_node : short_integer_type_node;
+  if (type1 == long_integer_type_node || type1 == long_unsigned_type_node)
+    return unsignedp ? long_unsigned_type_node : long_integer_type_node;
+  if (type1 == long_long_integer_type_node || type1 == long_long_unsigned_type_node)
+    return unsignedp ? long_long_unsigned_type_node : long_long_integer_type_node;
+  if (type1 == widest_integer_literal_type_node || type1 == widest_unsigned_literal_type_node)
+    return unsignedp ? widest_unsigned_literal_type_node : widest_integer_literal_type_node;
+#if HOST_BITS_PER_WIDE_INT >= 64
+  if (type1 == intTI_type_node || type1 == unsigned_intTI_type_node)
+    return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
+#endif
+  if (type1 == intDI_type_node || type1 == unsigned_intDI_type_node)
+    return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
+  if (type1 == intSI_type_node || type1 == unsigned_intSI_type_node)
+    return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
+  if (type1 == intHI_type_node || type1 == unsigned_intHI_type_node)
+    return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
+  if (type1 == intQI_type_node || type1 == unsigned_intQI_type_node)
+    return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
+
   /* For ENUMERAL_TYPEs in C++, must check the mode of the types, not
      the precision; they have precision set to match their range, but
      may use a wider mode to match an ABI.  If we change modes, we may

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

end of thread, other threads:[~2007-05-16  8:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-15 15:12 [PATCH] fix bootstrap on i686 Rafael Espindola
2007-05-15 17:37 ` Rafael Espindola
2007-05-15 19:47   ` Rafael Espindola
2007-05-15 20:43     ` Rafael Espindola
2007-05-16  8:32 ` Rafael Espindola
     [not found]   ` <DB636EE3-9C83-416A-93A2-29FE55DD082D@apple.com>
2007-05-16  8:36     ` Rafael Espindola

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