]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/18443 (#pragma pack(1) breaks function pointer initialization)
authorDavid Mosberger <davidm@hpl.hp.com>
Wed, 8 Dec 2004 01:49:13 +0000 (01:49 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 8 Dec 2004 01:49:13 +0000 (17:49 -0800)
        PR target/18443
        * config/ia64/ia64.c (ia64_assemble_integer): Add support for
        emitting unaligned pointer-sized integers.

From-SVN: r91846

gcc/ChangeLog
gcc/config/ia64/ia64.c

index 15d0e6fc2cdff9405e036b5992c4de8f0fc56c54..537e8f0ade26e12d9db5cf4cff174ac3bd910176 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-07  David Mosberger  <davidm@hpl.hp.com>
+
+       PR target/18443
+       * config/ia64/ia64.c (ia64_assemble_integer): Add support for
+       emitting unaligned pointer-sized integers.
+
 2004-12-07  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR middle-end/17827
index 3549c280d67a190139a24a34452d8dc367a2451d..13840459659533a4f69822411e9e462a0850a275 100644 (file)
@@ -3318,15 +3318,16 @@ static bool
 ia64_assemble_integer (rtx x, unsigned int size, int aligned_p)
 {
   if (size == POINTER_SIZE / BITS_PER_UNIT
-      && aligned_p
       && !(TARGET_NO_PIC || TARGET_AUTO_PIC)
       && GET_CODE (x) == SYMBOL_REF
       && SYMBOL_REF_FUNCTION_P (x))
     {
-      if (POINTER_SIZE == 32)
-       fputs ("\tdata4\t@fptr(", asm_out_file);
-      else
-       fputs ("\tdata8\t@fptr(", asm_out_file);
+      static const char * const directive[2][2] = {
+         /* 64-bit pointer */  /* 32-bit pointer */
+       { "\tdata8.ua\t@fptr(", "\tdata4.ua\t@fptr("},  /* unaligned */
+       { "\tdata8\t@fptr(",    "\tdata4\t@fptr("}      /* aligned */
+      };
+      fputs (directive[(aligned_p != 0)][POINTER_SIZE == 32], asm_out_file);
       output_addr_const (asm_out_file, x);
       fputs (")\n", asm_out_file);
       return true;