[PATCH] PR 65867 - bootstrap fails for mingw32 due to missing header in ssp.c

2015-04-25 Thread daniel . f . starke

Hello,

This patch works around a missing include in windows.h (mingw.org) for 
ssp.c.


ChangeLog

2015-04-25  Daniel Starke  daniel.f.sta...@freenet.de

* libssp/ssp.c: Added wincrypt.h include for Windows targets.

Bootstrapped i686-pc-mingw32 (mingw32 version 3.20).

Regards,
Daniel

diff -uart gcc-5.1.0-orig/libssp/ssp.c gcc-5.1.0/libssp/ssp.c
--- gcc-5.1.0-orig/libssp/ssp.c 2015-04-22 20:15:21 +
+++ gcc-5.1.0/libssp/ssp.c  2015-04-22 20:15:32 +
@@ -56,6 +56,7 @@
to the console using  CONOUT$   */
 #if defined (_WIN32)  !defined (__CYGWIN__)
 #include windows.h
+#include wincrypt.h
 # define _PATH_TTY CONOUT$
 #else
 # define _PATH_TTY /dev/tty


[PATCH]: Fix for PR 55707 bootstrap fails in gcc/graphite-dependences.c error cast loses precision

2013-01-03 Thread Rainer Emrich
Hello,

this trivial patch fixes a bootstrap issue on LLP64 hosts.

PR 55707
* graphite-dependences.c (hash_poly_ddr_p): Cast from pointer via
intptr_t.

Tested for x86_64-w64-mingw32 and x86_64-unknown-gnu-linux.

If OK for apply, Kai please commit.

Regards,

Rainer

Index: graphite-dependences.c
===
--- graphite-dependences.c  (Revision 194638)
+++ graphite-dependences.c  (Arbeitskopie)
@@ -56,7 +56,7 @@ hash_poly_ddr_p (const void *pddr)
 {
   const struct poly_ddr *p = (const struct poly_ddr *) pddr;

-  return (hashval_t) ((long) PDDR_SOURCE (p) + (long) PDDR_SINK (p));
+  return (hashval_t) ((intptr_t) PDDR_SOURCE (p) + (intptr_t) PDDR_SINK (p));
 }

 /* Returns true when PDDR has no dependence.  */


Re: [PATCH]: Fix for PR 55707 bootstrap fails in gcc/graphite-dependences.c error cast loses precision

2013-01-03 Thread Richard Biener
On Thu, Jan 3, 2013 at 1:08 PM, Rainer Emrich
rai...@emrich-ebersheim.de wrote:
 Hello,

 this trivial patch fixes a bootstrap issue on LLP64 hosts.

 PR 55707
 * graphite-dependences.c (hash_poly_ddr_p): Cast from pointer via
 intptr_t.

 Tested for x86_64-w64-mingw32 and x86_64-unknown-gnu-linux.

 If OK for apply, Kai please commit.

Ok.

Thanks,
Richard.

 Regards,

 Rainer

 Index: graphite-dependences.c
 ===
 --- graphite-dependences.c  (Revision 194638)
 +++ graphite-dependences.c  (Arbeitskopie)
 @@ -56,7 +56,7 @@ hash_poly_ddr_p (const void *pddr)
  {
const struct poly_ddr *p = (const struct poly_ddr *) pddr;

 -  return (hashval_t) ((long) PDDR_SOURCE (p) + (long) PDDR_SINK (p));
 +  return (hashval_t) ((intptr_t) PDDR_SOURCE (p) + (intptr_t) PDDR_SINK (p));
  }

  /* Returns true when PDDR has no dependence.  */


Re: [PATCH]: Fix for PR 55707 bootstrap fails in gcc/graphite-dependences.c error cast loses precision

2013-01-03 Thread Kai Tietz
Hi Rainer,

applied at rev 194859.

Thanks,
Kai


Re: [patch stmt.c]: 6 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-12-10 Thread Richard Biener
On Sun, Dec 9, 2012 at 4:58 PM, NightStrike nightstr...@gmail.com wrote:
 On Sat, Dec 1, 2012 at 11:13 PM, Kai Tietz ktiet...@googlemail.com wrote:
 Ping

 2012/11/29 Kai Tietz ktiet...@googlemail.com:
 Hello,

 this trivial patch fixes a bootstrap issue on LLP64 hosts.

 ChangeLog

 2012-11-29 Kai Tietz

 PR target/53912
 * stmt.c (compute_cases_per_edge): Cast from pointer via intptr_t.
 (expand_case): Likewise.

 Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
 x86_64-unknown-gnu-linux. Ok for apply?

 Regards,
 Kai

 Index: stmt.c
 ===
 --- stmt.c  (Revision 193925)
 +++ stmt.c  (Arbeitskopie)
 @@ -2061,7 +2061,7 @@ compute_cases_per_edge (gimple stmt)
tree lab = CASE_LABEL (elt);
basic_block case_bb = label_to_block_fn (cfun, lab);
edge case_edge = find_edge (bb, case_bb);
 -  case_edge-aux = (void *)((long)(case_edge-aux) + 1);
 +  case_edge-aux = (void *)((intptr_t)(case_edge-aux) + 1);
  }
  }

 @@ -2176,7 +2176,7 @@ expand_case (gimple stmt)
edge case_edge = find_edge (bb, case_bb);
case_list = add_case_node (
case_list, low, high, lab,
 -  case_edge-probability / (long)(case_edge-aux),
 +  case_edge-probability / (intptr_t)(case_edge-aux),
case_node_pool);
  }
pointer_set_destroy (seen_labels);

 Ping x2

Ok.

Thanks,
Richard.


Re: [patch print-tree.c]: 5 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-12-10 Thread Richard Biener
On Sun, Dec 9, 2012 at 5:18 PM, NightStrike nightstr...@gmail.com wrote:
 On Sat, Dec 1, 2012 at 11:12 PM, Kai Tietz ktiet...@googlemail.com wrote:
 Ping

 2012/11/29 Kai Tietz ktiet...@googlemail.com:
 Hello,

 this trivial patch fixes a bootstrap issue on LLP64 hosts.

 ChangeLog

 2012-11-29 Kai Tietz

 PR target/53912
 * print-tree.c (print_node): Cast from pointer via uintptr_t.

 Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
 x86_64-unknown-gnu-linux. Ok for apply?

 Regards,
 Kai

 Index: print-tree.c
 ===
 --- print-tree.c(Revision 193925)
 +++ print-tree.c(Arbeitskopie)
 @@ -255,7 +255,7 @@ print_node (FILE *file, const char *prefix, tree n
/* Allow this function to be called if the table is not there.  */
if (table)
  {
 -  hash = ((unsigned long) node) % HASH_SIZE;
 +  hash = ((uintptr_t) node) % HASH_SIZE;

/* If node is in the table, just mention its address.  */
for (b = table[hash]; b; b = b-next)

 Ping.

Ok.

Thanks,
Richard.


Re: [patch stmt.c]: 6 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-12-09 Thread NightStrike
On Sat, Dec 1, 2012 at 11:13 PM, Kai Tietz ktiet...@googlemail.com wrote:
 Ping

 2012/11/29 Kai Tietz ktiet...@googlemail.com:
 Hello,

 this trivial patch fixes a bootstrap issue on LLP64 hosts.

 ChangeLog

 2012-11-29 Kai Tietz

 PR target/53912
 * stmt.c (compute_cases_per_edge): Cast from pointer via intptr_t.
 (expand_case): Likewise.

 Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
 x86_64-unknown-gnu-linux. Ok for apply?

 Regards,
 Kai

 Index: stmt.c
 ===
 --- stmt.c  (Revision 193925)
 +++ stmt.c  (Arbeitskopie)
 @@ -2061,7 +2061,7 @@ compute_cases_per_edge (gimple stmt)
tree lab = CASE_LABEL (elt);
basic_block case_bb = label_to_block_fn (cfun, lab);
edge case_edge = find_edge (bb, case_bb);
 -  case_edge-aux = (void *)((long)(case_edge-aux) + 1);
 +  case_edge-aux = (void *)((intptr_t)(case_edge-aux) + 1);
  }
  }

 @@ -2176,7 +2176,7 @@ expand_case (gimple stmt)
edge case_edge = find_edge (bb, case_bb);
case_list = add_case_node (
case_list, low, high, lab,
 -  case_edge-probability / (long)(case_edge-aux),
 +  case_edge-probability / (intptr_t)(case_edge-aux),
case_node_pool);
  }
pointer_set_destroy (seen_labels);

Ping x2


Re: [patch print-tree.c]: 5 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-12-09 Thread NightStrike
On Sat, Dec 1, 2012 at 11:12 PM, Kai Tietz ktiet...@googlemail.com wrote:
 Ping

 2012/11/29 Kai Tietz ktiet...@googlemail.com:
 Hello,

 this trivial patch fixes a bootstrap issue on LLP64 hosts.

 ChangeLog

 2012-11-29 Kai Tietz

 PR target/53912
 * print-tree.c (print_node): Cast from pointer via uintptr_t.

 Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
 x86_64-unknown-gnu-linux. Ok for apply?

 Regards,
 Kai

 Index: print-tree.c
 ===
 --- print-tree.c(Revision 193925)
 +++ print-tree.c(Arbeitskopie)
 @@ -255,7 +255,7 @@ print_node (FILE *file, const char *prefix, tree n
/* Allow this function to be called if the table is not there.  */
if (table)
  {
 -  hash = ((unsigned long) node) % HASH_SIZE;
 +  hash = ((uintptr_t) node) % HASH_SIZE;

/* If node is in the table, just mention its address.  */
for (b = table[hash]; b; b = b-next)

Ping.


Re: [patch]: 2 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-12-02 Thread Kai Tietz
Ping

2012/11/29 Kai Tietz ktiet...@googlemail.com:
 Hello,

 this trivial patch fixes a bootstrap issue on LLP64 hosts.

 ChangeLog

 2012-11-29 Kai Tietz

 PR target/53912
 * ggc-common.c (POINTER_HASH): Cast from pointer via intptr_t.

 Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
 x86_64-unknown-gnu-linux. Ok for apply?

 Regards,
 Kai

 Index: ggc-common.c
 ===
 --- ggc-common.c(Revision 193925)
 +++ ggc-common.c(Arbeitskopie)
 @@ -304,7 +304,7 @@ struct ptr_data
enum gt_types_enum type;
  };

 -#define POINTER_HASH(x) (hashval_t)((long)x  3)
 +#define POINTER_HASH(x) (hashval_t)((intptr_t)x  3)

  /* Register an object in the hash table.  */



-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| ()_() him gain world domination


Re: [patch]: 3 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-12-02 Thread Kai Tietz
Ping

2012/11/29 Kai Tietz ktiet...@googlemail.com:
 Hello,

 this trivial patch fixes a bootstrap issue on LLP64 hosts.

 ChangeLog

 2012-11-29 Kai Tietz

 PR target/53912
 * pointer-set.c (hash1): Cast from pointer via uintptr_t.

 Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
 x86_64-unknown-gnu-linux. Ok for apply?

 Regards,
 Kai

 Index: pointer-set.c
 ===
 --- pointer-set.c   (Revision 193925)
 +++ pointer-set.c   (Arbeitskopie)
 @@ -64,7 +64,7 @@ hash1 (const void *p, unsigned long max, unsigned
  #endif
const unsigned long shift = HOST_BITS_PER_LONG - logmax;

 -  return ((A * (unsigned long) p)  shift)  (max - 1);
 +  return ((A * (uintptr_t) p)  shift)  (max - 1);
  }

  /* Allocate an empty pointer set.  */



-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| ()_() him gain world domination


Re: [patch tree-dump.c]: 7 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-12-02 Thread Kai Tietz
Ping

2012/11/29 Kai Tietz ktiet...@googlemail.com:
 Updated variant using HOST_WIDE_INT_PRINT.

 Tested for i686-w64-mingw32 and x86_64-w64-mingw32.  Ok for apply?

 Kai

 Index: tree-dump.c
 ===
 --- tree-dump.c (Revision 193925)
 +++ tree-dump.c (Arbeitskopie)
 @@ -177,7 +177,8 @@ void
  dump_pointer (dump_info_p di, const char *field, void *ptr)
  {
dump_maybe_newline (di);
 -  fprintf (di-stream, %-4s: %-8lx , field, (unsigned long) ptr);
 +  fprintf (di-stream, %-4s: %-8 HOST_WIDE_INT_PRINT x , field,
 +  (HOST_WIDE_INT) (uintptr_t) ptr);
di-column += 15;
  }



-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| ()_() him gain world domination


Re: [patch print-tree.c]: 5 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-12-02 Thread Kai Tietz
Ping

2012/11/29 Kai Tietz ktiet...@googlemail.com:
 Hello,

 this trivial patch fixes a bootstrap issue on LLP64 hosts.

 ChangeLog

 2012-11-29 Kai Tietz

 PR target/53912
 * print-tree.c (print_node): Cast from pointer via uintptr_t.

 Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
 x86_64-unknown-gnu-linux. Ok for apply?

 Regards,
 Kai

 Index: print-tree.c
 ===
 --- print-tree.c(Revision 193925)
 +++ print-tree.c(Arbeitskopie)
 @@ -255,7 +255,7 @@ print_node (FILE *file, const char *prefix, tree n
/* Allow this function to be called if the table is not there.  */
if (table)
  {
 -  hash = ((unsigned long) node) % HASH_SIZE;
 +  hash = ((uintptr_t) node) % HASH_SIZE;

/* If node is in the table, just mention its address.  */
for (b = table[hash]; b; b = b-next)



-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| ()_() him gain world domination


Re: [patch stmt.c]: 6 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-12-02 Thread Kai Tietz
Ping

2012/11/29 Kai Tietz ktiet...@googlemail.com:
 Hello,

 this trivial patch fixes a bootstrap issue on LLP64 hosts.

 ChangeLog

 2012-11-29 Kai Tietz

 PR target/53912
 * stmt.c (compute_cases_per_edge): Cast from pointer via intptr_t.
 (expand_case): Likewise.

 Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
 x86_64-unknown-gnu-linux. Ok for apply?

 Regards,
 Kai

 Index: stmt.c
 ===
 --- stmt.c  (Revision 193925)
 +++ stmt.c  (Arbeitskopie)
 @@ -2061,7 +2061,7 @@ compute_cases_per_edge (gimple stmt)
tree lab = CASE_LABEL (elt);
basic_block case_bb = label_to_block_fn (cfun, lab);
edge case_edge = find_edge (bb, case_bb);
 -  case_edge-aux = (void *)((long)(case_edge-aux) + 1);
 +  case_edge-aux = (void *)((intptr_t)(case_edge-aux) + 1);
  }
  }

 @@ -2176,7 +2176,7 @@ expand_case (gimple stmt)
edge case_edge = find_edge (bb, case_bb);
case_list = add_case_node (
case_list, low, high, lab,
 -  case_edge-probability / (long)(case_edge-aux),
 +  case_edge-probability / (intptr_t)(case_edge-aux),
case_node_pool);
  }
pointer_set_destroy (seen_labels);



-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| ()_() him gain world domination


Re: [patch]: 3 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-12-02 Thread Ian Lance Taylor
On Thu, Nov 29, 2012 at 4:07 AM, Kai Tietz ktiet...@googlemail.com wrote:

 2012-11-29 Kai Tietz

 PR target/53912
 * pointer-set.c (hash1): Cast from pointer via uintptr_t.

This is OK.

Thanks.

Ian


Re: [patch]: 2 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-12-02 Thread Ian Lance Taylor
On Thu, Nov 29, 2012 at 4:05 AM, Kai Tietz ktiet...@googlemail.com wrote:

 2012-11-29 Kai Tietz

 PR target/53912
 * ggc-common.c (POINTER_HASH): Cast from pointer via intptr_t.

This is OK.

Thanks.

Ian


[patch c++]: 1 of 7 Fix for PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Kai Tietz
Hello,

this trivial patch fixes a bootstrap issue on LLP64 hosts.

cp/

PR target/53912
* class.c (dump_class_hierarchy_r): Cast from pointer via uintptr_t.
(dump_vtable): Likewise.

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
x86_64-unknown-gnu-linux. Ok for apply?

Regards,
Kai

Index: cp/class.c
===
--- cp/class.c  (Revision 193925)
+++ cp/class.c  (Arbeitskopie)
@@ -7817,7 +7817,7 @@ dump_class_hierarchy_r (FILE *stream,
   indented = maybe_indent_hierarchy (stream, indent, 0);
   fprintf (stream, %s (0x%lx) ,
   type_as_string (BINFO_TYPE (binfo), TFF_PLAIN_IDENTIFIER),
-  (unsigned long) binfo);
+  (unsigned long) (uintptr_t) binfo);
   if (binfo != igo)
 {
   fprintf (stream, alternative-path\n);
@@ -7842,7 +7842,7 @@ dump_class_hierarchy_r (FILE *stream,
   fprintf (stream,  primary-for %s (0x%lx),
   type_as_string (BINFO_TYPE (BINFO_INHERITANCE_CHAIN (binfo)),
   TFF_PLAIN_IDENTIFIER),
-  (unsigned long)BINFO_INHERITANCE_CHAIN (binfo));
+  (unsigned long) (uintptr_t) BINFO_INHERITANCE_CHAIN (binfo));
 }
   if (BINFO_LOST_PRIMARY_P (binfo))
 {
@@ -7975,7 +7975,8 @@ dump_vtable (tree t, tree binfo, tree vtable)
   if (ctor_vtbl_p)
{
  if (!BINFO_VIRTUAL_P (binfo))
-   fprintf (stream,  (0x%lx instance), (unsigned long)binfo);
+   fprintf (stream,  (0x%lx instance), (unsigned long)
+(uintptr_t) binfo);
  fprintf (stream,  in %s, type_as_string (t, TFF_PLAIN_IDENTIFIER));
}
   fprintf (stream, \n);


[patch]: 2 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Kai Tietz
Hello,

this trivial patch fixes a bootstrap issue on LLP64 hosts.

ChangeLog

2012-11-29 Kai Tietz

PR target/53912
* ggc-common.c (POINTER_HASH): Cast from pointer via intptr_t.

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
x86_64-unknown-gnu-linux. Ok for apply?

Regards,
Kai

Index: ggc-common.c
===
--- ggc-common.c(Revision 193925)
+++ ggc-common.c(Arbeitskopie)
@@ -304,7 +304,7 @@ struct ptr_data
   enum gt_types_enum type;
 };

-#define POINTER_HASH(x) (hashval_t)((long)x  3)
+#define POINTER_HASH(x) (hashval_t)((intptr_t)x  3)

 /* Register an object in the hash table.  */


[patch]: 3 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Kai Tietz
Hello,

this trivial patch fixes a bootstrap issue on LLP64 hosts.

ChangeLog

2012-11-29 Kai Tietz

PR target/53912
* pointer-set.c (hash1): Cast from pointer via uintptr_t.

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
x86_64-unknown-gnu-linux. Ok for apply?

Regards,
Kai

Index: pointer-set.c
===
--- pointer-set.c   (Revision 193925)
+++ pointer-set.c   (Arbeitskopie)
@@ -64,7 +64,7 @@ hash1 (const void *p, unsigned long max, unsigned
 #endif
   const unsigned long shift = HOST_BITS_PER_LONG - logmax;

-  return ((A * (unsigned long) p)  shift)  (max - 1);
+  return ((A * (uintptr_t) p)  shift)  (max - 1);
 }

 /* Allocate an empty pointer set.  */


[patch prefix.c]: 4 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Kai Tietz
Hello,

this trivial patch fixes a bootstrap issue on LLP64 hosts.

ChangeLog

2012-11-29 Kai Tietz

PR target/53912
* prefix.c (lookup_key): Explicit cast return-type of xmalloc/xrealloc
to char *.

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
x86_64-unknown-gnu-linux. Ok for apply?

Regards,
Kai

Index: prefix.c
===
--- prefix.c(Revision 193925)
+++ prefix.c(Arbeitskopie)
@@ -157,12 +157,12 @@ lookup_key (char *key)
 }

   size = 32;
-  dst = xmalloc (size);
+  dst = (char *) xmalloc (size);

   res = RegQueryValueExA (reg_key, key, 0, type, (LPBYTE) dst, size);
   if (res == ERROR_MORE_DATA  type == REG_SZ)
 {
-  dst = xrealloc (dst, size);
+  dst = (char *) xrealloc (dst, size);
   res = RegQueryValueExA (reg_key, key, 0, type, (LPBYTE) dst, size);
 }


[patch print-tree.c]: 5 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Kai Tietz
Hello,

this trivial patch fixes a bootstrap issue on LLP64 hosts.

ChangeLog

2012-11-29 Kai Tietz

PR target/53912
* print-tree.c (print_node): Cast from pointer via uintptr_t.

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
x86_64-unknown-gnu-linux. Ok for apply?

Regards,
Kai

Index: print-tree.c
===
--- print-tree.c(Revision 193925)
+++ print-tree.c(Arbeitskopie)
@@ -255,7 +255,7 @@ print_node (FILE *file, const char *prefix, tree n
   /* Allow this function to be called if the table is not there.  */
   if (table)
 {
-  hash = ((unsigned long) node) % HASH_SIZE;
+  hash = ((uintptr_t) node) % HASH_SIZE;

   /* If node is in the table, just mention its address.  */
   for (b = table[hash]; b; b = b-next)


[patch stmt.c]: 6 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Kai Tietz
Hello,

this trivial patch fixes a bootstrap issue on LLP64 hosts.

ChangeLog

2012-11-29 Kai Tietz

PR target/53912
* stmt.c (compute_cases_per_edge): Cast from pointer via intptr_t.
(expand_case): Likewise.

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
x86_64-unknown-gnu-linux. Ok for apply?

Regards,
Kai

Index: stmt.c
===
--- stmt.c  (Revision 193925)
+++ stmt.c  (Arbeitskopie)
@@ -2061,7 +2061,7 @@ compute_cases_per_edge (gimple stmt)
   tree lab = CASE_LABEL (elt);
   basic_block case_bb = label_to_block_fn (cfun, lab);
   edge case_edge = find_edge (bb, case_bb);
-  case_edge-aux = (void *)((long)(case_edge-aux) + 1);
+  case_edge-aux = (void *)((intptr_t)(case_edge-aux) + 1);
 }
 }

@@ -2176,7 +2176,7 @@ expand_case (gimple stmt)
   edge case_edge = find_edge (bb, case_bb);
   case_list = add_case_node (
   case_list, low, high, lab,
-  case_edge-probability / (long)(case_edge-aux),
+  case_edge-probability / (intptr_t)(case_edge-aux),
   case_node_pool);
 }
   pointer_set_destroy (seen_labels);


[patch tree-dump.c]: 7 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Kai Tietz
Hello,

this trivial patch fixes a bootstrap issue on LLP64 hosts.

ChangeLog

2012-11-29 Kai Tietz

PR target/53912
* tree-dump.c (dump_pointer): Cast from pointer via intptr_t.

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
x86_64-unknown-gnu-linux. Ok for apply?

Regards,
Kai

Index: tree-dump.c
===
--- tree-dump.c (Revision 193925)
+++ tree-dump.c (Arbeitskopie)
@@ -177,7 +177,8 @@ void
 dump_pointer (dump_info_p di, const char *field, void *ptr)
 {
   dump_maybe_newline (di);
-  fprintf (di-stream, %-4s: %-8lx , field, (unsigned long) ptr);
+  fprintf (di-stream, %-4s: %-8lx , field,
+  (unsigned long) (uintptr_t) ptr);
   di-column += 15;
 }


Re: [patch c++]: 1 of 7 Fix for PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Pedro Alves
On 11/29/2012 12:03 PM, Kai Tietz wrote:
 Hello,
 
 this trivial patch fixes a bootstrap issue on LLP64 hosts.

But it's trivial at the expense of truncating the pointer.
Looking around, I'd think that something like casting to hwi (after uintptr_t),
and then use HOST_WIDE_INT_PRINT_HEX as format would be the gcc way.

 Index: cp/class.c
 ===
 --- cp/class.c  (Revision 193925)
 +++ cp/class.c  (Arbeitskopie)
 @@ -7817,7 +7817,7 @@ dump_class_hierarchy_r (FILE *stream,
indented = maybe_indent_hierarchy (stream, indent, 0);
fprintf (stream, %s (0x%lx) ,
type_as_string (BINFO_TYPE (binfo), TFF_PLAIN_IDENTIFIER),
 -  (unsigned long) binfo);
 +  (unsigned long) (uintptr_t) binfo);

-- 
Pedro Alves


Re: [patch c++]: 1 of 7 Fix for PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Kai Tietz
2012/11/29 Pedro Alves pal...@redhat.com:
 On 11/29/2012 12:03 PM, Kai Tietz wrote:
 Hello,

 this trivial patch fixes a bootstrap issue on LLP64 hosts.

 But it's trivial at the expense of truncating the pointer.
 Looking around, I'd think that something like casting to hwi (after 
 uintptr_t),
 and then use HOST_WIDE_INT_PRINT_HEX as format would be the gcc way.

 Index: cp/class.c
 ===
 --- cp/class.c  (Revision 193925)
 +++ cp/class.c  (Arbeitskopie)
 @@ -7817,7 +7817,7 @@ dump_class_hierarchy_r (FILE *stream,
indented = maybe_indent_hierarchy (stream, indent, 0);
fprintf (stream, %s (0x%lx) ,
type_as_string (BINFO_TYPE (binfo), TFF_PLAIN_IDENTIFIER),
 -  (unsigned long) binfo);
 +  (unsigned long) (uintptr_t) binfo);

 --
 Pedro Alves

Well, hwi format is of course the way to display pointer complete.  On
the other hand are in most cases lower 32-bit sufficent on
debug-output.

Kai


Re: [patch c++]: 1 of 7 Fix for PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Pedro Alves
On 11/29/2012 12:45 PM, Kai Tietz wrote:
 2012/11/29 Pedro Alves pal...@redhat.com:
 On 11/29/2012 12:03 PM, Kai Tietz wrote:
 Hello,

 this trivial patch fixes a bootstrap issue on LLP64 hosts.

 But it's trivial at the expense of truncating the pointer.
 Looking around, I'd think that something like casting to hwi (after 
 uintptr_t),
 and then use HOST_WIDE_INT_PRINT_HEX as format would be the gcc way.

 Index: cp/class.c
 ===
 --- cp/class.c  (Revision 193925)
 +++ cp/class.c  (Arbeitskopie)
 @@ -7817,7 +7817,7 @@ dump_class_hierarchy_r (FILE *stream,
indented = maybe_indent_hierarchy (stream, indent, 0);
fprintf (stream, %s (0x%lx) ,
type_as_string (BINFO_TYPE (binfo), TFF_PLAIN_IDENTIFIER),
 -  (unsigned long) binfo);
 +  (unsigned long) (uintptr_t) binfo);


 Well, hwi format is of course the way to display pointer complete.  On
 the other hand are in most cases lower 32-bit sufficent on
 debug-output.

But what's the point of not making it complete?  It's not like we're talking
about a large amount of work to get it right.  It should be a two-line patch?

-- 
Pedro Alves



Re: [patch tree-dump.c]: 7 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Kai Tietz
Updated variant using HOST_WIDE_INT_PRINT.

Tested for i686-w64-mingw32 and x86_64-w64-mingw32.  Ok for apply?

Kai

Index: tree-dump.c
===
--- tree-dump.c (Revision 193925)
+++ tree-dump.c (Arbeitskopie)
@@ -177,7 +177,8 @@ void
 dump_pointer (dump_info_p di, const char *field, void *ptr)
 {
   dump_maybe_newline (di);
-  fprintf (di-stream, %-4s: %-8lx , field, (unsigned long) ptr);
+  fprintf (di-stream, %-4s: %-8 HOST_WIDE_INT_PRINT x , field,
+  (HOST_WIDE_INT) (uintptr_t) ptr);
   di-column += 15;
 }


Re: [patch prefix.c]: 4 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Ian Lance Taylor
On Thu, Nov 29, 2012 at 4:09 AM, Kai Tietz ktiet...@googlemail.com wrote:

 ChangeLog

 2012-11-29 Kai Tietz

 PR target/53912
 * prefix.c (lookup_key): Explicit cast return-type of xmalloc/xrealloc
 to char *.

 Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
 x86_64-unknown-gnu-linux. Ok for apply?

 Regards,
 Kai

 Index: prefix.c
 ===
 --- prefix.c(Revision 193925)
 +++ prefix.c(Arbeitskopie)
 @@ -157,12 +157,12 @@ lookup_key (char *key)
  }

size = 32;
 -  dst = xmalloc (size);
 +  dst = (char *) xmalloc (size);

res = RegQueryValueExA (reg_key, key, 0, type, (LPBYTE) dst, size);
if (res == ERROR_MORE_DATA  type == REG_SZ)
  {
 -  dst = xrealloc (dst, size);
 +  dst = (char *) xrealloc (dst, size);
res = RegQueryValueExA (reg_key, key, 0, type, (LPBYTE) dst, size);
  }


This code should be using the XNEWVEC and XRESIZEVEC macros.

Ian


Re: [patch prefix.c]: 4 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Kai Tietz
Fine.  Tested patch using XNEWVEC/XRESIZEVEC for this.  Ok for apply?

Kai

Index: prefix.c
===
--- prefix.c(Revision 193939)
+++ prefix.c(Arbeitskopie)
@@ -157,12 +157,12 @@ lookup_key (char *key)
 }

   size = 32;
-  dst = xmalloc (size);
+  dst = XNEWVEC (char, size);

   res = RegQueryValueExA (reg_key, key, 0, type, (LPBYTE) dst, size);
   if (res == ERROR_MORE_DATA  type == REG_SZ)
 {
-  dst = xrealloc (dst, size);
+  dst = XRESIZEVEC (char, dst, size);
   res = RegQueryValueExA (reg_key, key, 0, type, (LPBYTE) dst, size);
 }


Re: [patch prefix.c]: 4 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

2012-11-29 Thread Ian Lance Taylor
On Thu, Nov 29, 2012 at 10:27 AM, Kai Tietz ktiet...@googlemail.com wrote:
 Fine.  Tested patch using XNEWVEC/XRESIZEVEC for this.  Ok for apply?

This is OK with a ChangeLog entry.

Thanks.

Ian

 Index: prefix.c
 ===
 --- prefix.c(Revision 193939)
 +++ prefix.c(Arbeitskopie)
 @@ -157,12 +157,12 @@ lookup_key (char *key)
  }

size = 32;
 -  dst = xmalloc (size);
 +  dst = XNEWVEC (char, size);

res = RegQueryValueExA (reg_key, key, 0, type, (LPBYTE) dst, size);
if (res == ERROR_MORE_DATA  type == REG_SZ)
  {
 -  dst = xrealloc (dst, size);
 +  dst = XRESIZEVEC (char, dst, size);
res = RegQueryValueExA (reg_key, key, 0, type, (LPBYTE) dst, size);
  }


Bootstrap fails (was: Remove unnecessary VEC function overloads.)

2012-09-11 Thread Tobias Burnus

On 09/11/2012 01:52 AM, Diego Novillo wrote:

Remove unnecessary VEC function overloads.

Several VEC member functions that accept an element 'T' used to have
two overloads: one taking 'T', the second taking 'T *'.


They might be unnecessary,  but with your patch bootstrapping fails here 
with the following failure.


Did you test with or without Graphite?

Tobias


/home/tob/projects/gcc-git/gcc/gcc/graphite-scop-detection.c: In 
function ‘void move_sd_regions(vec_tsd_region_p**, vec_tsd_region_p**)’:
/home/tob/projects/gcc-git/gcc/gcc/vec.h:408:63: error: no matching 
function for call to 
‘vec_tsd_region_p::safe_push(vec_tsd_region_p**, sd_region*, const 
char [61], int, const char [16])’

  (vec_tT::safe_pushA ((V), O VEC_CHECK_INFO MEM_STAT_INFO))
   ^
/home/tob/projects/gcc-git/gcc/gcc/graphite-scop-detection.c:146:5: 
note: in expansion of macro 'VEC_safe_push'

 VEC_safe_push (sd_region, heap, *target, s);
 ^
/home/tob/projects/gcc-git/gcc/gcc/vec.h:408:63: note: candidate is:
  (vec_tT::safe_pushA ((V), O VEC_CHECK_INFO MEM_STAT_INFO))



Re: Bootstrap fails (was: Remove unnecessary VEC function overloads.)

2012-09-11 Thread Richard Guenther
On Tue, Sep 11, 2012 at 9:58 AM, Tobias Burnus bur...@net-b.de wrote:
 On 09/11/2012 01:52 AM, Diego Novillo wrote:

 Remove unnecessary VEC function overloads.

 Several VEC member functions that accept an element 'T' used to have
 two overloads: one taking 'T', the second taking 'T *'.


 They might be unnecessary,  but with your patch bootstrapping fails here
 with the following failure.

 Did you test with or without Graphite?

Fixed with the attached.

Richard.

 Tobias


 /home/tob/projects/gcc-git/gcc/gcc/graphite-scop-detection.c: In function
 ‘void move_sd_regions(vec_tsd_region_p**, vec_tsd_region_p**)’:
 /home/tob/projects/gcc-git/gcc/gcc/vec.h:408:63: error: no matching function
 for call to ‘vec_tsd_region_p::safe_push(vec_tsd_region_p**,
 sd_region*, const char [61], int, const char [16])’
   (vec_tT::safe_pushA ((V), O VEC_CHECK_INFO MEM_STAT_INFO))
^
 /home/tob/projects/gcc-git/gcc/gcc/graphite-scop-detection.c:146:5: note: in
 expansion of macro 'VEC_safe_push'
  VEC_safe_push (sd_region, heap, *target, s);
  ^
 /home/tob/projects/gcc-git/gcc/gcc/vec.h:408:63: note: candidate is:
   (vec_tT::safe_pushA ((V), O VEC_CHECK_INFO MEM_STAT_INFO))



p
Description: Binary data


Re: Bootstrap fails (was: Remove unnecessary VEC function overloads.)

2012-09-11 Thread Dominique Dhumieres
 Fixed with the attached.

Followed by the same failure on darwin. Fixed with

--- ../_clean/gcc/config/darwin.c   2012-07-09 22:06:21.0 +0200
+++ ../p_work/gcc/config/darwin.c   2012-09-11 11:53:02.0 +0200
@@ -1878,7 +1878,7 @@ darwin_asm_named_section (const char *na
  the assumption of how this is done.  */
   if (lto_section_names == NULL)
 lto_section_names = VEC_alloc (darwin_lto_section_e, gc, 16);
-  VEC_safe_push (darwin_lto_section_e, gc, lto_section_names, e);
+  VEC_safe_push (darwin_lto_section_e, gc, lto_section_names, e);
}
   else if (strncmp (name, __DWARF,, 8) == 0)
 darwin_asm_dwarf_section (name, flags, decl);
@@ -2698,7 +2698,7 @@ darwin_asm_dwarf_section (const char *na
   fprintf (asm_out_file, Lsection%.*s:\n, namelen, sname);
   e.count = 1;
   e.name = xstrdup (sname);
-  VEC_safe_push (dwarf_sect_used_entry, gc, dwarf_sect_names_table, e);
+  VEC_safe_push (dwarf_sect_used_entry, gc, dwarf_sect_names_table, e);
 }
 }
 
(now at stage 2).

TIA

Dominique


Re: Bootstrap fails

2012-09-11 Thread Diego Novillo

On 2012-09-11 03:58 , Tobias Burnus wrote:


Did you test with or without Graphite?


I tested with and without release checking, all languages and all 
targets that use VEC.  So many combinations... how is graphite enabled?



Diego.


Re: Bootstrap fails

2012-09-11 Thread Diego Novillo

On 2012-09-11 05:35 , Richard Guenther wrote:

On Tue, Sep 11, 2012 at 9:58 AM, Tobias Burnus bur...@net-b.de wrote:

On 09/11/2012 01:52 AM, Diego Novillo wrote:


Remove unnecessary VEC function overloads.

Several VEC member functions that accept an element 'T' used to have
two overloads: one taking 'T', the second taking 'T *'.



They might be unnecessary,  but with your patch bootstrapping fails here
with the following failure.

Did you test with or without Graphite?


Fixed with the attached.


Thanks!


Diego.


Re: Bootstrap fails

2012-09-11 Thread Richard Guenther
On Tue, Sep 11, 2012 at 1:41 PM, Diego Novillo dnovi...@google.com wrote:
 On 2012-09-11 03:58 , Tobias Burnus wrote:

 Did you test with or without Graphite?


 I tested with and without release checking, all languages and all targets
 that use VEC.  So many combinations... how is graphite enabled?

By having its prerequesites available (cloog and isl).

Richard.


 Diego.


Re: Bootstrap fails (was: Remove unnecessary VEC function overloads.)

2012-09-11 Thread Diego Novillo

On 2012-09-11 06:12 , Dominique Dhumieres wrote:

Fixed with the attached.


Followed by the same failure on darwin. Fixed with

--- ../_clean/gcc/config/darwin.c   2012-07-09 22:06:21.0 +0200
+++ ../p_work/gcc/config/darwin.c   2012-09-11 11:53:02.0 +0200
@@ -1878,7 +1878,7 @@ darwin_asm_named_section (const char *na
   the assumption of how this is done.  */
if (lto_section_names == NULL)
  lto_section_names = VEC_alloc (darwin_lto_section_e, gc, 16);
-  VEC_safe_push (darwin_lto_section_e, gc, lto_section_names, e);
+  VEC_safe_push (darwin_lto_section_e, gc, lto_section_names, e);
 }
else if (strncmp (name, __DWARF,, 8) == 0)
  darwin_asm_dwarf_section (name, flags, decl);
@@ -2698,7 +2698,7 @@ darwin_asm_dwarf_section (const char *na
fprintf (asm_out_file, Lsection%.*s:\n, namelen, sname);
e.count = 1;
e.name = xstrdup (sname);
-  VEC_safe_push (dwarf_sect_used_entry, gc, dwarf_sect_names_table, e);
+  VEC_safe_push (dwarf_sect_used_entry, gc, dwarf_sect_names_table, e);
  }
  }


Gah, my grep did not include config/*.c.

This is ok, of course.


Diego.



Re: Bootstrap fails

2012-09-11 Thread Tobias Burnus

On 09/11/2012 01:41 PM, Diego Novillo wrote:

On 2012-09-11 03:58 , Tobias Burnus wrote:


Did you test with or without Graphite?


I tested with and without release checking, all languages and all 
targets that use VEC.  So many combinations...


There is unfortunately always an N+1 configuration which one hasn't 
tested ...




how is graphite enabled?


I think it is automatically enabled when the libraries are found; at 
least I didn't specify anything special and just see the following 
configure output:


checking for version 0.10 of ISL... yes
checking for version 0.17.0 of CLooG... yes

Consequently (cf. toplevel configure):
# Treat either --without-cloog or --without-isl as a request to disable
# GRAPHITE support and skip all following checks.

If you don't have them in the default tree: See 
http://gcc.gnu.org/install/prerequisites.html and 
http://gcc.gnu.org/install/configure.html  Both also build in tree.



Tobias

PS: Thanks for the clean up patch.


Re: Bootstrap fails (was: Remove unnecessary VEC function overloads.)

2012-09-11 Thread Dominique Dhumieres
 This is ok, of course.

Then could you please commit it (I don't have write access)?

TIA

Dominique


Re: Bootstrap fails (was: Remove unnecessary VEC function overloads.)

2012-09-11 Thread Diego Novillo

On 2012-09-11 08:42 , Dominique Dhumieres wrote:

This is ok, of course.


Then could you please commit it (I don't have write access)?


Done.  Rev 191192.


2012-09-11  Dominique Dhumieres  domi...@lps.ens.fr

* config/darwin.c (darwin_asm_named_section): Adjust for
VEC changes.
(darwin_asm_dwarf_section): Likewise.

diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 33a831f..54c92d1 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1878,7 +1878,7 @@ darwin_asm_named_section (const char *name,
  the assumption of how this is done.  */
   if (lto_section_names == NULL)
 lto_section_names = VEC_alloc (darwin_lto_section_e, gc, 16);
-  VEC_safe_push (darwin_lto_section_e, gc, lto_section_names, e);
+  VEC_safe_push (darwin_lto_section_e, gc, lto_section_names, e);
}
   else if (strncmp (name, __DWARF,, 8) == 0)
 darwin_asm_dwarf_section (name, flags, decl);
@@ -2698,7 +2698,7 @@ darwin_asm_dwarf_section (const char *name, 
unsigned int flags,

   fprintf (asm_out_file, Lsection%.*s:\n, namelen, sname);
   e.count = 1;
   e.name = xstrdup (sname);
-  VEC_safe_push (dwarf_sect_used_entry, gc, dwarf_sect_names_table, 
e);

+  VEC_safe_push (dwarf_sect_used_entry, gc, dwarf_sect_names_table, e);
 }
 }



[PATCH, i386]: Fix target/48860: bootstrap fails on x86_64-apple-darwin10; broken assembler edition.

2011-05-04 Thread Uros Bizjak
Hello!

Oh well... some broken assemblers got confused with movq %reg, %xmm
DImode move mnemonic. movd works correctly as well, so use this form
instead.

2011-05-04  Uros Bizjak  ubiz...@gmail.com

PR target/48860
* config/i386/i386.md (*movdi_internal_rex64) Use %vmovd
for reg-xmm moves.
* config/i386/sse.md (*vec_concatv2di_rex64_sse4_1): Ditto.
(vec_concatv2di_rex64_sse): Ditto.
(*sse2_storeq_rex64): Do not emit %v prefix for mov{q} mnemonic.
(*vec_extractv2di_1_rex64): Ditto.

Revert:
2011-05-02  Uros Bizjak  ubiz...@gmail.com

* config/i386/mmx.md (*movmode_internal_rex64): Use %vmovq for
reg-xmm moves.
(*movv2sf_internal_rex64): Use %vmovq for reg-xmm moves.

Tested on x86_64-pc-linux-gnu, committed to mainline SVN. I will audit
movq usage in other release branches as well.

Uros.
Index: config/i386/i386.md
===
--- config/i386/i386.md (revision 173353)
+++ config/i386/i386.md (working copy)
@@ -2001,11 +2001,13 @@
 case TYPE_SSEMOV:
   if (get_attr_mode (insn) == MODE_TI)
return %vmovdqa\t{%1, %0|%0, %1};
+  /* Handle broken assemblers that reqire movd instead of movq.  */
+  if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1]))
+   return %vmovd\t{%1, %0|%0, %1};
   return %vmovq\t{%1, %0|%0, %1};
 
 case TYPE_MMXMOV:
-  /* Moves from and into integer register is done using movd
-opcode with REX prefix.  */
+  /* Handle broken assemblers that reqire movd instead of movq.  */
   if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1]))
return movd\t{%1, %0|%0, %1};
   return movq\t{%1, %0|%0, %1};
@@ -3018,7 +3020,8 @@
 
 case 11:
 case 12:
-return %vmovd\t{%1, %0|%0, %1};
+  /* Handle broken assemblers that reqire movd instead of movq.  */
+  return %vmovd\t{%1, %0|%0, %1};
 
 default:
   gcc_unreachable();
@@ -3494,12 +3497,13 @@
 
 case 9: case 10: case 14: case 15:
   return movd\t{%1, %0|%0, %1};
-case 12: case 13:
-  return %vmovd\t{%1, %0|%0, %1};
 
 case 11:
   return movq\t{%1, %0|%0, %1};
 
+case 12: case 13:
+  return %vmovd\t{%1, %0|%0, %1};
+
 default:
   gcc_unreachable ();
 }
Index: config/i386/mmx.md
===
--- config/i386/mmx.md  (revision 173353)
+++ config/i386/mmx.md  (working copy)
@@ -63,6 +63,7 @@
   DONE;
 })
 
+;; movd instead of movq is required to handle broken assemblers.
 (define_insn *movmode_internal_rex64
   [(set (match_operand:MMXMODEI8 0 nonimmediate_operand
 =rm,r,!?y,!y,!?y,m  ,!y ,*Y2,x,x ,m,r ,Yi)
@@ -82,8 +83,8 @@
 %vpxor\t%0, %d0
 %vmovq\t{%1, %0|%0, %1}
 %vmovq\t{%1, %0|%0, %1}
-%vmovq\t{%1, %0|%0, %1}
-%vmovq\t{%1, %0|%0, %1}
+%vmovd\t{%1, %0|%0, %1}
+%vmovd\t{%1, %0|%0, %1}
   [(set_attr type 
imov,imov,mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,ssemov)
(set_attr unit *,*,*,*,*,*,mmx,mmx,*,*,*,*,*)
(set_attr prefix_rep *,*,*,*,*,*,1,1,*,1,*,*,*)
@@ -155,6 +156,7 @@
   DONE;
 })
 
+;; movd instead of movq is required to handle broken assemblers.
 (define_insn *movv2sf_internal_rex64
   [(set (match_operand:V2SF 0 nonimmediate_operand
 =rm,r,!?y,!y,!?y,m  ,!y ,*Y2,x,x,x,m,r ,Yi)
@@ -175,8 +177,8 @@
 %vmovaps\t{%1, %0|%0, %1}
 %vmovlps\t{%1, %d0|%d0, %1}
 %vmovlps\t{%1, %0|%0, %1}
-%vmovq\t{%1, %0|%0, %1}
-%vmovq\t{%1, %0|%0, %1}
+%vmovd\t{%1, %0|%0, %1}
+%vmovd\t{%1, %0|%0, %1}
   [(set_attr type 
imov,imov,mmx,mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,sselog1,ssemov,ssemov,ssemov,ssemov)
(set_attr unit *,*,*,*,*,*,mmx,mmx,*,*,*,*,*,*)
(set_attr prefix_rep *,*,*,*,*,*,1,1,*,*,*,*,*,*)
Index: config/i386/sse.md
===
--- config/i386/sse.md  (revision 173353)
+++ config/i386/sse.md  (working copy)
@@ -6479,9 +6479,8 @@
   @
#
#
-   %vmov{q}\t{%1, %0|%0, %1}
+   mov{q}\t{%1, %0|%0, %1}
   [(set_attr type *,*,imov)
-   (set_attr prefix *,*,maybe_vex)
(set_attr mode *,*,DI)])
 
 (define_insn *sse2_storeq
@@ -6516,12 +6515,12 @@
psrldq\t{$8, %0|%0, 8}
vpsrldq\t{$8, %1, %0|%0, %1, 8}
%vmovq\t{%H1, %0|%0, %H1}
-   %vmov{q}\t{%H1, %0|%0, %H1}
+   mov{q}\t{%H1, %0|%0, %H1}
   [(set_attr isa base,noavx,avx,base,base)
(set_attr type ssemov,sseishft1,sseishft1,ssemov,imov)
(set_attr length_immediate *,1,1,*,*)
(set_attr memory *,none,none,*,*)
-   (set_attr prefix maybe_vex,orig,vex,maybe_vex,maybe_vex)
+   (set_attr prefix maybe_vex,orig,vex,maybe_vex,orig)
(set_attr mode V2SF,TI,TI,TI,DI)])
 
 (define_insn *vec_extractv2di_1_sse2
@@ -6687,6 +6686,7 @@
   [(set_attr type sselog,ssemov,ssemov)
(set_attr mode TI,V4SF,V2SF)])
 
+;; movd instead of movq is required to handle broken 

Re: [PATCH, i386]: Fix target/48860: bootstrap fails on x86_64-apple-darwin10; broken assembler edition.

2011-05-04 Thread Jakub Jelinek
On Wed, May 04, 2011 at 12:02:17PM +0200, Uros Bizjak wrote:
 Tested on x86_64-pc-linux-gnu, committed to mainline SVN. I will audit
 movq usage in other release branches as well.

s/reqire/require/g

 --- config/i386/i386.md   (revision 173353)
 +++ config/i386/i386.md   (working copy)
 @@ -2001,11 +2001,13 @@
  case TYPE_SSEMOV:
if (get_attr_mode (insn) == MODE_TI)
   return %vmovdqa\t{%1, %0|%0, %1};
 +  /* Handle broken assemblers that reqire movd instead of movq.  */
 +  if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1]))
 + return %vmovd\t{%1, %0|%0, %1};
return %vmovq\t{%1, %0|%0, %1};
  
  case TYPE_MMXMOV:
 -  /* Moves from and into integer register is done using movd
 -  opcode with REX prefix.  */
 +  /* Handle broken assemblers that reqire movd instead of movq.  */
if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1]))
   return movd\t{%1, %0|%0, %1};
return movq\t{%1, %0|%0, %1};
 @@ -3018,7 +3020,8 @@
  
  case 11:
  case 12:
 -return %vmovd\t{%1, %0|%0, %1};
 +  /* Handle broken assemblers that reqire movd instead of movq.  */
 +  return %vmovd\t{%1, %0|%0, %1};
  
  default:
gcc_unreachable();

Jakub