public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset
@ 2015-08-19 14:27 Richard Biener
  2015-08-19 20:12 ` Mike Stump
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Richard Biener @ 2015-08-19 14:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: jason, ktietz, mikestump


This is needed so that we can output references to $early-debug-symbol + 
constant offset where $early-debug-symbol is the beginning of a 
.debug_info section containing early debug info from the compile-stage.
Constant offsets are always fine for any object formats I know, I
tested ia64-linux apart from x86_64-linux.  I have access to darwin at
home (x86_64), so can try there as well.

The question is whether we want to assemble "+" HOST_WIDE_INT_PRINT_DEC
directly for the non-ASM_OUTPUT_DWARF_OFFSET case as well as opposed
to building a PLUS (we do build a SYMBOL_REF already).

I've also refrained from changing all existing callers to
dw2_asm_output_offset to pass a 0 offset argument to avoid the
overloading - please tell me if you prefer that.  The LTO support
adds a single call here:

@@ -9064,8 +9248,12 @@ output_die (dw_die_ref die)
                    size = DWARF2_ADDR_SIZE;
                  else
                    size = DWARF_OFFSET_SIZE;
-                 dw2_asm_output_offset (size, sym, debug_info_section, 
"%s",
-                                        name);
+                 if (AT_ref (a)->with_offset)
+                   dw2_asm_output_offset (size, sym, AT_ref 
(a)->die_offset,
+                                          debug_info_section, "%s", 
name);
+                 else
+                   dw2_asm_output_offset (size, sym, debug_info_section, 
"%s",
+                                          name);
                }

(ignore that ->with_offset, it can hopefully go if die_offset is zero
for other cases - just checking with an assert right now).

Bootstrap & regtest pending on x86_64-unknown-linux-gnu.  The patch
is an effective no-op currently (the offset != 0 condition is always
false for now).

Ok?

CCing affected target maintainers - I've verified this on ia64
by just generating assembly for a simple testcase with -g and
changing one of the generated section-relative offsets in the
suggested way (adding "+4"), passing through the assembler and
inspecting the resulting relocations.

Thanks,
Richard.

2015-08-19  Richard Biener  <rguenther@suse.de>

	* dwarf2asm.h (dw2_asm_output_offset): Add overload with
	extra offset argument.
	* dwarf2asm.c (dw2_asm_output_offset): Implement that.
	* doc/tm.texi.in (ASM_OUTPUT_DWARF_OFFSET): Adjust documentation
	to reflect new offset parameter.
	* doc/tm.texi: Regenerate.
	* config/darwin.h (ASM_OUTPUT_DWARF_OFFSET): Adjust.
	* config/darwin-protos.h (darwin_asm_output_dwarf_delta): Add
	offset argument.
	(darwin_asm_output_dwarf_offset): Likewise.
	* config/darwin.c (darwin_asm_output_dwarf_delta): Add offset
	argument.
	(darwin_asm_output_dwarf_offset): Pass offset argument through.
	* config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Adjust.
	* config/i386/cygmin.h (ASM_OUTPUT_DWARF_OFFSET): Likewise.

Index: gcc/dwarf2asm.c
===================================================================
--- gcc/dwarf2asm.c	(revision 226856)
+++ gcc/dwarf2asm.c	(working copy)
@@ -33,6 +33,8 @@ along with GCC; see the file COPYING3.
 #include "dwarf2asm.h"
 #include "dwarf2.h"
 #include "tm_p.h"
+#include "function.h"
+#include "emit-rtl.h"
 
 \f
 /* Output an unaligned integer with the given value and size.  Prefer not
@@ -190,12 +192,39 @@ dw2_asm_output_offset (int size, const c
   va_start (ap, comment);
 
 #ifdef ASM_OUTPUT_DWARF_OFFSET
-  ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label, base);
+  ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label, 0, base);
 #else
   dw2_assemble_integer (size, gen_rtx_SYMBOL_REF (Pmode, label));
 #endif
 
   if (flag_debug_asm && comment)
+    {
+      fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+      vfprintf (asm_out_file, comment, ap);
+    }
+  fputc ('\n', asm_out_file);
+
+  va_end (ap);
+}
+
+void
+dw2_asm_output_offset (int size, const char *label, HOST_WIDE_INT offset,
+		       section *base ATTRIBUTE_UNUSED,
+		       const char *comment, ...)
+{
+  va_list ap;
+
+  va_start (ap, comment);
+
+#ifdef ASM_OUTPUT_DWARF_OFFSET
+  ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label, offset, base);
+#else
+  dw2_assemble_integer (size, gen_rtx_PLUS (Pmode,
+					    gen_rtx_SYMBOL_REF (Pmode, label),
+					    gen_int_mode (offset, Pmode)));
+#endif
+
+  if (flag_debug_asm && comment)
     {
       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
       vfprintf (asm_out_file, comment, ap);
Index: gcc/dwarf2asm.h
===================================================================
--- gcc/dwarf2asm.h	(revision 226856)
+++ gcc/dwarf2asm.h	(working copy)
@@ -40,6 +40,10 @@ extern void dw2_asm_output_offset (int,
 				   const char *, ...)
      ATTRIBUTE_NULL_PRINTF_4;
 
+extern void dw2_asm_output_offset (int, const char *, HOST_WIDE_INT,
+				   section *, const char *, ...)
+     ATTRIBUTE_NULL_PRINTF_5;
+
 extern void dw2_asm_output_addr (int, const char *, const char *, ...)
      ATTRIBUTE_NULL_PRINTF_3;
 
Index: gcc/doc/tm.texi.in
===================================================================
--- gcc/doc/tm.texi.in	(revision 226856)
+++ gcc/doc/tm.texi.in	(working copy)
@@ -7020,10 +7020,11 @@ between the two given labels in system d
 slots on IA64 VMS, using an integer of the given size.
 @end defmac
 
-@defmac ASM_OUTPUT_DWARF_OFFSET (@var{stream}, @var{size}, @var{label}, @var{section})
+@defmac ASM_OUTPUT_DWARF_OFFSET (@var{stream}, @var{size}, @var{label}, @var{offset}, @var{section})
 A C statement to issue assembly directives that create a
-section-relative reference to the given @var{label}, using an integer of the
-given @var{size}.  The label is known to be defined in the given @var{section}.
+section-relative reference to the given @var{label} plus @var{offset}, using
+an integer of the given @var{size}.  The label is known to be defined in the
+given @var{section}.
 @end defmac
 
 @defmac ASM_OUTPUT_DWARF_PCREL (@var{stream}, @var{size}, @var{label})
Index: gcc/config/darwin-protos.h
===================================================================
--- gcc/config/darwin-protos.h	(revision 226856)
+++ gcc/config/darwin-protos.h	(working copy)
@@ -91,9 +91,9 @@ extern void darwin_globalize_label (FILE
 extern void darwin_assemble_visibility (tree, int);
 
 extern void darwin_asm_output_dwarf_delta (FILE *, int, const char *,
-					   const char *);
+					   const char *, HOST_WIDE_INT);
 extern void darwin_asm_output_dwarf_offset (FILE *, int, const char *,
-					    section *);
+					    HOST_WIDE_INT, section *);
 
 extern void darwin_asm_declare_object_name (FILE *, const char *, tree);
 extern void darwin_asm_declare_constant_name (FILE *, const char *,
Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c	(revision 226856)
+++ gcc/config/darwin.c	(working copy)
@@ -2814,7 +2814,8 @@ static int darwin_dwarf_label_counter;
 
 void
 darwin_asm_output_dwarf_delta (FILE *file, int size,
-			       const char *lab1, const char *lab2)
+			       const char *lab1, const char *lab2,
+			       HOST_WIDE_INT offset)
 {
   int islocaldiff = (lab1[0] == '*' && lab1[1] == 'L'
 		     && lab2[0] == '*' && lab2[1] == 'L');
@@ -2828,6 +2829,8 @@ darwin_asm_output_dwarf_delta (FILE *fil
   assemble_name_raw (file, lab1);
   fprintf (file, "-");
   assemble_name_raw (file, lab2);
+  if (offset != 0)
+    fprintf (file, "+" HOST_WIDE_INT_PRINT_DEC, offset);
   if (islocaldiff)
     fprintf (file, "\n\t%s L$set$%d", directive, darwin_dwarf_label_counter++);
 }
@@ -2839,7 +2842,7 @@ darwin_asm_output_dwarf_delta (FILE *fil
 
 void
 darwin_asm_output_dwarf_offset (FILE *file, int size, const char * lab,
-				section *base)
+				HOST_WIDE_INT offset, section *base)
 {
   char sname[64];
   int namelen;
@@ -2850,7 +2853,7 @@ darwin_asm_output_dwarf_offset (FILE *fi
 
   namelen = strchr (base->named.name + 8, ',') - (base->named.name + 8);
   sprintf (sname, "*Lsection%.*s", namelen, base->named.name + 8);
-  darwin_asm_output_dwarf_delta (file, size, lab, sname);
+  darwin_asm_output_dwarf_delta (file, size, lab, sname, offset);
 }
 
 /* Called from the within the TARGET_ASM_FILE_START for each target.  */
Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h	(revision 226856)
+++ gcc/config/darwin.h	(working copy)
@@ -826,10 +826,10 @@ enum machopic_addr_class {
      ((CODE) == 1 || (GLOBAL) == 0) ? DW_EH_PE_pcrel : DW_EH_PE_absptr)
 
 #define ASM_OUTPUT_DWARF_DELTA(FILE,SIZE,LABEL1,LABEL2)  \
-  darwin_asm_output_dwarf_delta (FILE, SIZE, LABEL1, LABEL2)
+  darwin_asm_output_dwarf_delta (FILE, SIZE, LABEL1, LABEL2, 0)
 
-#define ASM_OUTPUT_DWARF_OFFSET(FILE,SIZE,LABEL,BASE)  \
-  darwin_asm_output_dwarf_offset (FILE, SIZE, LABEL, BASE)
+#define ASM_OUTPUT_DWARF_OFFSET(FILE,SIZE,LABEL,OFFSET,BASE)  \
+  darwin_asm_output_dwarf_offset (FILE, SIZE, LABEL, OFFSET, BASE)
 
 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(ASM_OUT_FILE, ENCODING, SIZE, ADDR, DONE)	\
       if (ENCODING == ASM_PREFERRED_EH_DATA_FORMAT (2, 1)) {				\
Index: gcc/config/ia64/ia64.h
===================================================================
--- gcc/config/ia64/ia64.h	(revision 226856)
+++ gcc/config/ia64/ia64.h	(working copy)
@@ -1583,11 +1583,13 @@ do {									\
 /* Use section-relative relocations for debugging offsets.  Unlike other
    targets that fake this by putting the section VMA at 0, IA-64 has
    proper relocations for them.  */
-#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION)	\
+#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, OFFSET, SECTION) \
   do {								\
     fputs (integer_asm_op (SIZE, FALSE), FILE);			\
     fputs ("@secrel(", FILE);					\
     assemble_name (FILE, LABEL);				\
+    if (offset != 0)						\
+      fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET);	\
     fputc (')', FILE);						\
   } while (0)
 
Index: gcc/config/i386/cygming.h
===================================================================
--- gcc/config/i386/cygming.h	(revision 226856)
+++ gcc/config/i386/cygming.h	(working copy)
@@ -97,13 +97,15 @@ along with GCC; see the file COPYING3.
 /* Use section relative relocations for debugging offsets.  Unlike
    other targets that fake this by putting the section VMA at 0, PE
    won't allow it.  */
-#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION)	\
+#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, OFFSET, SECTION) \
   do {								\
     switch (SIZE)						\
       {								\
       case 4:							\
 	fputs ("\t.secrel32\t", FILE);				\
 	assemble_name (FILE, LABEL);				\
+	if (offset != 0)					\
+	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, offset)	\
 	break;							\
       case 8:							\
 	/* This is a hack.  There is no 64-bit section relative	\
@@ -113,6 +115,8 @@ along with GCC; see the file COPYING3.
 	   Fake the 64-bit offset by zero-extending it.  */	\
 	fputs ("\t.secrel32\t", FILE);				\
 	assemble_name (FILE, LABEL);				\
+	if (offset != 0)					\
+	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, offset)	\
 	fputs ("\n\t.long\t0", FILE);				\
 	break;							\
       default:							\

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

* Re: [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset
  2015-08-19 14:27 [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset Richard Biener
@ 2015-08-19 20:12 ` Mike Stump
  2015-08-20  8:08   ` Richard Biener
  2016-09-15  7:53 ` Richard Biener
  2016-09-16  8:40 ` Andreas Schwab
  2 siblings, 1 reply; 10+ messages in thread
From: Mike Stump @ 2015-08-19 20:12 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, Jason Merrill, ktietz

On Aug 19, 2015, at 7:25 AM, Richard Biener <rguenther@suse.de> wrote:
> 
> This is needed so that we can output references to $early-debug-symbol + 
> constant offset where $early-debug-symbol is the beginning of a 
> .debug_info section containing early debug info from the compile-stage.
> Constant offsets are always fine for any object formats I know,

On darwin, they generally speaking, are not. subsections_via_symbols can shed some light on the topic, if one is interested all the fun.  I’ll give a quick intro below.

  foo+n

only works if there is not other label of a certain type between label and foo+4, and there are no labels of a certain type at foo+4, and foo+n refers to at least one byte after that label, and n is non-negative and …

So, for example, in

	nop
  foo:
	nop

foo+32 would be invalid as nops are 4 bytes or so, and +32 is beyond the size of the region.  foo+0 be fine.  foo+4 would be invalid, assuming nop generates 4 bytes.  foo-4 would be invalid.

In:

  foo:
	nop
  bar:
	nop

foo+4 would be invalid, as bar exists.

In:

foo:
	nop
L12:
	nop

foo+4 is fine, as local labels don’t participate.  One way to think about this is imagine that each global label points to an independent section and that section isn’t loaded unless something refers to it, and one can only have pointers to the bytes inside that section, and that sections on output can be arbitrarily ordered.

  bar: nop
  foo: nop

bar+4, even if you deferred this to running code, need not refer to foo.

I say this as background.

In the optimization where gcc tries to bunch up global variables together and form base+offset to get to the different data, this does not work on darwin because base+offset isn’t a valid way to go from one global label to the next, even in the same section.

Now, if you merely sneak in data into the section with no labels and you need to account for N extra bytes before then you can change the existing reference to what it was before + N, without any worry.  If you remove the interior labels to form your new base, and concatenate all the data together, then base+N to refer to the data is fine, if there are at least N+1 bytes of data after base.

foo: nop
bar: nop

would become:

base:
Lfoo: nop
Lbar: nop

base+0 and base+4.

So, if you confident you know and follow the rules, ok from my perspective.  If you’re unsure, I can try and read a .s file and see if it looks ok.  Testing would may not catch broken things unless you also select dead code stripping and try test cases with dead code.

> The LTO support adds a single call here:
> 
> @@ -9064,8 +9248,12 @@ output_die (dw_die_ref die)
>                    size = DWARF2_ADDR_SIZE;
>                  else
>                    size = DWARF_OFFSET_SIZE;
> -                 dw2_asm_output_offset (size, sym, debug_info_section, 
> "%s",
> -                                        name);
> +                 if (AT_ref (a)->with_offset)
> +                   dw2_asm_output_offset (size, sym, AT_ref 
> (a)->die_offset,
> +                                          debug_info_section, "%s", 
> name);
> +                 else
> +                   dw2_asm_output_offset (size, sym, debug_info_section, 
> "%s",
> +                                          name);
>                }

So, I glanced around this call site, and it would seem safe if all you’re doing is adding die_offset bytes of data or more and no global labels.

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

* Re: [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset
  2015-08-19 20:12 ` Mike Stump
@ 2015-08-20  8:08   ` Richard Biener
  2015-08-20 11:22     ` Mike Stump
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Biener @ 2015-08-20  8:08 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc-patches, Jason Merrill, ktietz

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3269 bytes --]

On Wed, 19 Aug 2015, Mike Stump wrote:

> On Aug 19, 2015, at 7:25 AM, Richard Biener <rguenther@suse.de> wrote:
> > 
> > This is needed so that we can output references to $early-debug-symbol + 
> > constant offset where $early-debug-symbol is the beginning of a 
> > .debug_info section containing early debug info from the compile-stage.
> > Constant offsets are always fine for any object formats I know,
> 
> On darwin, they generally speaking, are not. subsections_via_symbols can shed some light on the topic, if one is interested all the fun.  IÂ’ll give a quick intro below.
> 
>   foo+n
> 
> only works if there is not other label of a certain type between label and foo+4, and there are no labels of a certain type at foo+4, and foo+n refers to at least one byte after that label, and n is non-negative and Â…
> 
> So, for example, in
> 
> 	nop
>   foo:
> 	nop
> 
> foo+32 would be invalid as nops are 4 bytes or so, and +32 is beyond the size of the region.  foo+0 be fine.  foo+4 would be invalid, assuming nop generates 4 bytes.  foo-4 would be invalid.
> 
> In:
> 
>   foo:
> 	nop
>   bar:
> 	nop
> 
> foo+4 would be invalid, as bar exists.
> 
> In:
> 
> foo:
> 	nop
> L12:
> 	nop
> 
> foo+4 is fine, as local labels donÂ’t participate.  One way to think about this is imagine that each global label points to an independent section and that section isnÂ’t loaded unless something refers to it, and one can only have pointers to the bytes inside that section, and that sections on output can be arbitrarily ordered.
> 
>   bar: nop
>   foo: nop
> 
> bar+4, even if you deferred this to running code, need not refer to foo.
> 
> I say this as background.
> 
> In the optimization where gcc tries to bunch up global variables together and form base+offset to get to the different data, this does not work on darwin because base+offset isnÂ’t a valid way to go from one global label to the next, even in the same section.
> 
> Now, if you merely sneak in data into the section with no labels and you 
> need to account for N extra bytes before then you can change the 
> existing reference to what it was before + N, without any worry.  If you 
> remove the interior labels to form your new base, and concatenate all 
> the data together, then base+N to refer to the data is fine, if there 
> are at least N+1 bytes of data after base.
>
> foo: nop
> bar: nop
> 
> would become:
> 
> base:
> Lfoo: nop
> Lbar: nop
> 
> base+0 and base+4.
> 
> So, if you confident you know and follow the rules, ok from my 
> perspective.  If youÂ’re unsure, I can try and read a .s file and see if 
> it looks ok.  Testing would may not catch broken things unless you also 
> select dead code stripping and try test cases with dead code.

I believe that we in the end have

Ldebug_info_from_t1.c:
 ...
Ldebug_info_from_t2.c:
 ...
debug_info:
 refer to Ldebug_info_from_t1.c + offset
 refer to Ldebug_info_from_t2.c + offset

where the references always use positive offset and are based on the
next previous lable (so Ldebug_info_from_t1.c is not refering to
an entity at Ldebug_info_from_t2.c or beyond).  So that seems to
follow the restrictions you laid out above.

If basic testing doesn't help I'll refrain from doing it ;)  It
can only break LTO in the end.

Richard.

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

* Re: [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset
  2015-08-20  8:08   ` Richard Biener
@ 2015-08-20 11:22     ` Mike Stump
  2015-08-20 11:27       ` Richard Biener
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Stump @ 2015-08-20 11:22 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, Jason Merrill, ktietz

On Aug 20, 2015, at 12:29 AM, Richard Biener <rguenther@suse.de> wrote:
> 
> where the references always use positive offset and are based on the
> next previous lable (so Ldebug_info_from_t1.c is not refering to
> an entity at Ldebug_info_from_t2.c or beyond).  So that seems to
> follow the restrictions you laid out above.

I agree.

> If basic testing doesn't help I'll refrain from doing it ;)  It
> can only break LTO in the end.

:-)  Actually, I don’t mind.  It should be easy enough to ask a darwin person to spin it and watch for breakage if you want.  I don’t expect it to not work given your elaboration.

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

* Re: [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset
  2015-08-20 11:22     ` Mike Stump
@ 2015-08-20 11:27       ` Richard Biener
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Biener @ 2015-08-20 11:27 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc-patches, Jason Merrill, ktietz

[-- Attachment #1: Type: TEXT/PLAIN, Size: 775 bytes --]

On Thu, 20 Aug 2015, Mike Stump wrote:

> On Aug 20, 2015, at 12:29 AM, Richard Biener <rguenther@suse.de> wrote:
> > 
> > where the references always use positive offset and are based on the
> > next previous lable (so Ldebug_info_from_t1.c is not refering to
> > an entity at Ldebug_info_from_t2.c or beyond).  So that seems to
> > follow the restrictions you laid out above.
> 
> I agree.
> 
> > If basic testing doesn't help I'll refrain from doing it ;)  It
> > can only break LTO in the end.
> 
> :-)  Actually, I donÂ’t mind.  It should be easy enough to ask a darwin 
> person to spin it and watch for breakage if you want.  I donÂ’t expect it 
> to not work given your elaboration.

Err - you _are_ a darwin persion ;)  According to MAINTAINERS at least...

Richard.

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

* Re: [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset
  2015-08-19 14:27 [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset Richard Biener
  2015-08-19 20:12 ` Mike Stump
@ 2016-09-15  7:53 ` Richard Biener
  2016-09-16  8:40 ` Andreas Schwab
  2 siblings, 0 replies; 10+ messages in thread
From: Richard Biener @ 2016-09-15  7:53 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Jason Merrill, Kai Tietz, Mike Stump

On Wed, Aug 19, 2015 at 4:25 PM, Richard Biener <rguenther@suse.de> wrote:
>
> This is needed so that we can output references to $early-debug-symbol +
> constant offset where $early-debug-symbol is the beginning of a
> .debug_info section containing early debug info from the compile-stage.
> Constant offsets are always fine for any object formats I know, I
> tested ia64-linux apart from x86_64-linux.  I have access to darwin at
> home (x86_64), so can try there as well.
>
> The question is whether we want to assemble "+" HOST_WIDE_INT_PRINT_DEC
> directly for the non-ASM_OUTPUT_DWARF_OFFSET case as well as opposed
> to building a PLUS (we do build a SYMBOL_REF already).
>
> I've also refrained from changing all existing callers to
> dw2_asm_output_offset to pass a 0 offset argument to avoid the
> overloading - please tell me if you prefer that.  The LTO support
> adds a single call here:
>
> @@ -9064,8 +9248,12 @@ output_die (dw_die_ref die)
>                     size = DWARF2_ADDR_SIZE;
>                   else
>                     size = DWARF_OFFSET_SIZE;
> -                 dw2_asm_output_offset (size, sym, debug_info_section,
> "%s",
> -                                        name);
> +                 if (AT_ref (a)->with_offset)
> +                   dw2_asm_output_offset (size, sym, AT_ref
> (a)->die_offset,
> +                                          debug_info_section, "%s",
> name);
> +                 else
> +                   dw2_asm_output_offset (size, sym, debug_info_section,
> "%s",
> +                                          name);
>                 }
>
> (ignore that ->with_offset, it can hopefully go if die_offset is zero
> for other cases - just checking with an assert right now).
>
> Bootstrap & regtest pending on x86_64-unknown-linux-gnu.  The patch
> is an effective no-op currently (the offset != 0 condition is always
> false for now).
>
> Ok?
>
> CCing affected target maintainers - I've verified this on ia64
> by just generating assembly for a simple testcase with -g and
> changing one of the generated section-relative offsets in the
> suggested way (adding "+4"), passing through the assembler and
> inspecting the resulting relocations.

Given no further comments and my plan to go ahead with the early LTO debug
merge I am currently re-testing this nicely split out part and plan to commit it
once that succeeded.  This makes life a lot easier when testing the remains
as the tm.texi dance vanishes.

Richard.

> Thanks,
> Richard.
>
> 2015-08-19  Richard Biener  <rguenther@suse.de>
>
>         * dwarf2asm.h (dw2_asm_output_offset): Add overload with
>         extra offset argument.
>         * dwarf2asm.c (dw2_asm_output_offset): Implement that.
>         * doc/tm.texi.in (ASM_OUTPUT_DWARF_OFFSET): Adjust documentation
>         to reflect new offset parameter.
>         * doc/tm.texi: Regenerate.
>         * config/darwin.h (ASM_OUTPUT_DWARF_OFFSET): Adjust.
>         * config/darwin-protos.h (darwin_asm_output_dwarf_delta): Add
>         offset argument.
>         (darwin_asm_output_dwarf_offset): Likewise.
>         * config/darwin.c (darwin_asm_output_dwarf_delta): Add offset
>         argument.
>         (darwin_asm_output_dwarf_offset): Pass offset argument through.
>         * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Adjust.
>         * config/i386/cygmin.h (ASM_OUTPUT_DWARF_OFFSET): Likewise.
>
> Index: gcc/dwarf2asm.c
> ===================================================================
> --- gcc/dwarf2asm.c     (revision 226856)
> +++ gcc/dwarf2asm.c     (working copy)
> @@ -33,6 +33,8 @@ along with GCC; see the file COPYING3.
>  #include "dwarf2asm.h"
>  #include "dwarf2.h"
>  #include "tm_p.h"
> +#include "function.h"
> +#include "emit-rtl.h"
>
>
>  /* Output an unaligned integer with the given value and size.  Prefer not
> @@ -190,12 +192,39 @@ dw2_asm_output_offset (int size, const c
>    va_start (ap, comment);
>
>  #ifdef ASM_OUTPUT_DWARF_OFFSET
> -  ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label, base);
> +  ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label, 0, base);
>  #else
>    dw2_assemble_integer (size, gen_rtx_SYMBOL_REF (Pmode, label));
>  #endif
>
>    if (flag_debug_asm && comment)
> +    {
> +      fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
> +      vfprintf (asm_out_file, comment, ap);
> +    }
> +  fputc ('\n', asm_out_file);
> +
> +  va_end (ap);
> +}
> +
> +void
> +dw2_asm_output_offset (int size, const char *label, HOST_WIDE_INT offset,
> +                      section *base ATTRIBUTE_UNUSED,
> +                      const char *comment, ...)
> +{
> +  va_list ap;
> +
> +  va_start (ap, comment);
> +
> +#ifdef ASM_OUTPUT_DWARF_OFFSET
> +  ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label, offset, base);
> +#else
> +  dw2_assemble_integer (size, gen_rtx_PLUS (Pmode,
> +                                           gen_rtx_SYMBOL_REF (Pmode, label),
> +                                           gen_int_mode (offset, Pmode)));
> +#endif
> +
> +  if (flag_debug_asm && comment)
>      {
>        fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
>        vfprintf (asm_out_file, comment, ap);
> Index: gcc/dwarf2asm.h
> ===================================================================
> --- gcc/dwarf2asm.h     (revision 226856)
> +++ gcc/dwarf2asm.h     (working copy)
> @@ -40,6 +40,10 @@ extern void dw2_asm_output_offset (int,
>                                    const char *, ...)
>       ATTRIBUTE_NULL_PRINTF_4;
>
> +extern void dw2_asm_output_offset (int, const char *, HOST_WIDE_INT,
> +                                  section *, const char *, ...)
> +     ATTRIBUTE_NULL_PRINTF_5;
> +
>  extern void dw2_asm_output_addr (int, const char *, const char *, ...)
>       ATTRIBUTE_NULL_PRINTF_3;
>
> Index: gcc/doc/tm.texi.in
> ===================================================================
> --- gcc/doc/tm.texi.in  (revision 226856)
> +++ gcc/doc/tm.texi.in  (working copy)
> @@ -7020,10 +7020,11 @@ between the two given labels in system d
>  slots on IA64 VMS, using an integer of the given size.
>  @end defmac
>
> -@defmac ASM_OUTPUT_DWARF_OFFSET (@var{stream}, @var{size}, @var{label}, @var{section})
> +@defmac ASM_OUTPUT_DWARF_OFFSET (@var{stream}, @var{size}, @var{label}, @var{offset}, @var{section})
>  A C statement to issue assembly directives that create a
> -section-relative reference to the given @var{label}, using an integer of the
> -given @var{size}.  The label is known to be defined in the given @var{section}.
> +section-relative reference to the given @var{label} plus @var{offset}, using
> +an integer of the given @var{size}.  The label is known to be defined in the
> +given @var{section}.
>  @end defmac
>
>  @defmac ASM_OUTPUT_DWARF_PCREL (@var{stream}, @var{size}, @var{label})
> Index: gcc/config/darwin-protos.h
> ===================================================================
> --- gcc/config/darwin-protos.h  (revision 226856)
> +++ gcc/config/darwin-protos.h  (working copy)
> @@ -91,9 +91,9 @@ extern void darwin_globalize_label (FILE
>  extern void darwin_assemble_visibility (tree, int);
>
>  extern void darwin_asm_output_dwarf_delta (FILE *, int, const char *,
> -                                          const char *);
> +                                          const char *, HOST_WIDE_INT);
>  extern void darwin_asm_output_dwarf_offset (FILE *, int, const char *,
> -                                           section *);
> +                                           HOST_WIDE_INT, section *);
>
>  extern void darwin_asm_declare_object_name (FILE *, const char *, tree);
>  extern void darwin_asm_declare_constant_name (FILE *, const char *,
> Index: gcc/config/darwin.c
> ===================================================================
> --- gcc/config/darwin.c (revision 226856)
> +++ gcc/config/darwin.c (working copy)
> @@ -2814,7 +2814,8 @@ static int darwin_dwarf_label_counter;
>
>  void
>  darwin_asm_output_dwarf_delta (FILE *file, int size,
> -                              const char *lab1, const char *lab2)
> +                              const char *lab1, const char *lab2,
> +                              HOST_WIDE_INT offset)
>  {
>    int islocaldiff = (lab1[0] == '*' && lab1[1] == 'L'
>                      && lab2[0] == '*' && lab2[1] == 'L');
> @@ -2828,6 +2829,8 @@ darwin_asm_output_dwarf_delta (FILE *fil
>    assemble_name_raw (file, lab1);
>    fprintf (file, "-");
>    assemble_name_raw (file, lab2);
> +  if (offset != 0)
> +    fprintf (file, "+" HOST_WIDE_INT_PRINT_DEC, offset);
>    if (islocaldiff)
>      fprintf (file, "\n\t%s L$set$%d", directive, darwin_dwarf_label_counter++);
>  }
> @@ -2839,7 +2842,7 @@ darwin_asm_output_dwarf_delta (FILE *fil
>
>  void
>  darwin_asm_output_dwarf_offset (FILE *file, int size, const char * lab,
> -                               section *base)
> +                               HOST_WIDE_INT offset, section *base)
>  {
>    char sname[64];
>    int namelen;
> @@ -2850,7 +2853,7 @@ darwin_asm_output_dwarf_offset (FILE *fi
>
>    namelen = strchr (base->named.name + 8, ',') - (base->named.name + 8);
>    sprintf (sname, "*Lsection%.*s", namelen, base->named.name + 8);
> -  darwin_asm_output_dwarf_delta (file, size, lab, sname);
> +  darwin_asm_output_dwarf_delta (file, size, lab, sname, offset);
>  }
>
>  /* Called from the within the TARGET_ASM_FILE_START for each target.  */
> Index: gcc/config/darwin.h
> ===================================================================
> --- gcc/config/darwin.h (revision 226856)
> +++ gcc/config/darwin.h (working copy)
> @@ -826,10 +826,10 @@ enum machopic_addr_class {
>       ((CODE) == 1 || (GLOBAL) == 0) ? DW_EH_PE_pcrel : DW_EH_PE_absptr)
>
>  #define ASM_OUTPUT_DWARF_DELTA(FILE,SIZE,LABEL1,LABEL2)  \
> -  darwin_asm_output_dwarf_delta (FILE, SIZE, LABEL1, LABEL2)
> +  darwin_asm_output_dwarf_delta (FILE, SIZE, LABEL1, LABEL2, 0)
>
> -#define ASM_OUTPUT_DWARF_OFFSET(FILE,SIZE,LABEL,BASE)  \
> -  darwin_asm_output_dwarf_offset (FILE, SIZE, LABEL, BASE)
> +#define ASM_OUTPUT_DWARF_OFFSET(FILE,SIZE,LABEL,OFFSET,BASE)  \
> +  darwin_asm_output_dwarf_offset (FILE, SIZE, LABEL, OFFSET, BASE)
>
>  #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(ASM_OUT_FILE, ENCODING, SIZE, ADDR, DONE)    \
>        if (ENCODING == ASM_PREFERRED_EH_DATA_FORMAT (2, 1)) {                           \
> Index: gcc/config/ia64/ia64.h
> ===================================================================
> --- gcc/config/ia64/ia64.h      (revision 226856)
> +++ gcc/config/ia64/ia64.h      (working copy)
> @@ -1583,11 +1583,13 @@ do {                                                                    \
>  /* Use section-relative relocations for debugging offsets.  Unlike other
>     targets that fake this by putting the section VMA at 0, IA-64 has
>     proper relocations for them.  */
> -#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION)    \
> +#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, OFFSET, SECTION) \
>    do {                                                         \
>      fputs (integer_asm_op (SIZE, FALSE), FILE);                        \
>      fputs ("@secrel(", FILE);                                  \
>      assemble_name (FILE, LABEL);                               \
> +    if (offset != 0)                                           \
> +      fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET);     \
>      fputc (')', FILE);                                         \
>    } while (0)
>
> Index: gcc/config/i386/cygming.h
> ===================================================================
> --- gcc/config/i386/cygming.h   (revision 226856)
> +++ gcc/config/i386/cygming.h   (working copy)
> @@ -97,13 +97,15 @@ along with GCC; see the file COPYING3.
>  /* Use section relative relocations for debugging offsets.  Unlike
>     other targets that fake this by putting the section VMA at 0, PE
>     won't allow it.  */
> -#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION)    \
> +#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, OFFSET, SECTION) \
>    do {                                                         \
>      switch (SIZE)                                              \
>        {                                                                \
>        case 4:                                                  \
>         fputs ("\t.secrel32\t", FILE);                          \
>         assemble_name (FILE, LABEL);                            \
> +       if (offset != 0)                                        \
> +         fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, offset)   \
>         break;                                                  \
>        case 8:                                                  \
>         /* This is a hack.  There is no 64-bit section relative \
> @@ -113,6 +115,8 @@ along with GCC; see the file COPYING3.
>            Fake the 64-bit offset by zero-extending it.  */     \
>         fputs ("\t.secrel32\t", FILE);                          \
>         assemble_name (FILE, LABEL);                            \
> +       if (offset != 0)                                        \
> +         fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, offset)   \
>         fputs ("\n\t.long\t0", FILE);                           \
>         break;                                                  \
>        default:                                                 \

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

* Re: [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset
  2015-08-19 14:27 [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset Richard Biener
  2015-08-19 20:12 ` Mike Stump
  2016-09-15  7:53 ` Richard Biener
@ 2016-09-16  8:40 ` Andreas Schwab
  2016-09-16  8:50   ` Richard Biener
  2016-09-17 15:20   ` Andreas Schwab
  2 siblings, 2 replies; 10+ messages in thread
From: Andreas Schwab @ 2016-09-16  8:40 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, jason, ktietz, mikestump

	* config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use parameter
	OFFSET, not offset.
	* config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Likewise.

diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 228d6a2..faf8fa4 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -109,8 +109,8 @@ along with GCC; see the file COPYING3.  If not see
       case 4:							\
 	fputs ("\t.secrel32\t", FILE);				\
 	assemble_name (FILE, LABEL);				\
-	if (offset != 0)					\
-	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, offset)	\
+	if ((OFFSET) != 0)					\
+	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET)	\
 	break;							\
       case 8:							\
 	/* This is a hack.  There is no 64-bit section relative	\
@@ -120,8 +120,8 @@ along with GCC; see the file COPYING3.  If not see
 	   Fake the 64-bit offset by zero-extending it.  */	\
 	fputs ("\t.secrel32\t", FILE);				\
 	assemble_name (FILE, LABEL);				\
-	if (offset != 0)					\
-	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, offset)	\
+	if ((OFFSET) != 0)					\
+	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET)	\
 	fputs ("\n\t.long\t0", FILE);				\
 	break;							\
       default:							\
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index aab2d7a..00516bb 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1586,7 +1586,7 @@ do {									\
     fputs (integer_asm_op (SIZE, FALSE), FILE);			\
     fputs ("@secrel(", FILE);					\
     assemble_name (FILE, LABEL);				\
-    if (offset != 0)						\
+    if ((OFFSET) != 0)						\
       fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET);	\
     fputc (')', FILE);						\
   } while (0)
-- 
2.10.0


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] 10+ messages in thread

* Re: [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset
  2016-09-16  8:40 ` Andreas Schwab
@ 2016-09-16  8:50   ` Richard Biener
  2016-09-17 15:20   ` Andreas Schwab
  1 sibling, 0 replies; 10+ messages in thread
From: Richard Biener @ 2016-09-16  8:50 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gcc-patches, jason, ktietz, mikestump

On Fri, 16 Sep 2016, Andreas Schwab wrote:

> 	* config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use parameter
> 	OFFSET, not offset.
> 	* config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Likewise.

Oops.

Ok (counts as obvious).

Thanks,
Richard.

> diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
> index 228d6a2..faf8fa4 100644
> --- a/gcc/config/i386/cygming.h
> +++ b/gcc/config/i386/cygming.h
> @@ -109,8 +109,8 @@ along with GCC; see the file COPYING3.  If not see
>        case 4:							\
>  	fputs ("\t.secrel32\t", FILE);				\
>  	assemble_name (FILE, LABEL);				\
> -	if (offset != 0)					\
> -	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, offset)	\
> +	if ((OFFSET) != 0)					\
> +	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET)	\
>  	break;							\
>        case 8:							\
>  	/* This is a hack.  There is no 64-bit section relative	\
> @@ -120,8 +120,8 @@ along with GCC; see the file COPYING3.  If not see
>  	   Fake the 64-bit offset by zero-extending it.  */	\
>  	fputs ("\t.secrel32\t", FILE);				\
>  	assemble_name (FILE, LABEL);				\
> -	if (offset != 0)					\
> -	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, offset)	\
> +	if ((OFFSET) != 0)					\
> +	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET)	\
>  	fputs ("\n\t.long\t0", FILE);				\
>  	break;							\
>        default:							\
> diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
> index aab2d7a..00516bb 100644
> --- a/gcc/config/ia64/ia64.h
> +++ b/gcc/config/ia64/ia64.h
> @@ -1586,7 +1586,7 @@ do {									\
>      fputs (integer_asm_op (SIZE, FALSE), FILE);			\
>      fputs ("@secrel(", FILE);					\
>      assemble_name (FILE, LABEL);				\
> -    if (offset != 0)						\
> +    if ((OFFSET) != 0)						\
>        fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET);	\
>      fputc (')', FILE);						\
>    } while (0)
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

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

* Re: [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset
  2016-09-16  8:40 ` Andreas Schwab
  2016-09-16  8:50   ` Richard Biener
@ 2016-09-17 15:20   ` Andreas Schwab
  2016-09-17 15:30     ` Richard Biener
  1 sibling, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2016-09-17 15:20 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, jason, ktietz, mikestump

	* config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Add cast.
	* config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Likewise.

diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index faf8fa4..60e11b4 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -110,7 +110,8 @@ along with GCC; see the file COPYING3.  If not see
 	fputs ("\t.secrel32\t", FILE);				\
 	assemble_name (FILE, LABEL);				\
 	if ((OFFSET) != 0)					\
-	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET)	\
+	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC,		\
+		   (HOST_WIDE_INT) (OFFSET))			\
 	break;							\
       case 8:							\
 	/* This is a hack.  There is no 64-bit section relative	\
@@ -121,7 +122,8 @@ along with GCC; see the file COPYING3.  If not see
 	fputs ("\t.secrel32\t", FILE);				\
 	assemble_name (FILE, LABEL);				\
 	if ((OFFSET) != 0)					\
-	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET)	\
+	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC,		\
+		   (HOST_WIDE_INT) (OFFSET))			\
 	fputs ("\n\t.long\t0", FILE);				\
 	break;							\
       default:							\
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 00516bb..ac0cb86 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1587,7 +1587,8 @@ do {									\
     fputs ("@secrel(", FILE);					\
     assemble_name (FILE, LABEL);				\
     if ((OFFSET) != 0)						\
-      fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET);	\
+      fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC,		\
+	       (HOST_WIDE_INT) (OFFSET));			\
     fputc (')', FILE);						\
   } while (0)
 
-- 
2.10.0

-- 
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] 10+ messages in thread

* Re: [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset
  2016-09-17 15:20   ` Andreas Schwab
@ 2016-09-17 15:30     ` Richard Biener
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Biener @ 2016-09-17 15:30 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gcc-patches, jason, ktietz, mikestump

On September 17, 2016 11:48:37 AM GMT+02:00, Andreas Schwab <schwab@linux-m68k.org> wrote:
>	* config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Add cast.
>	* config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Likewise.

OK.

Richard.

>diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
>index faf8fa4..60e11b4 100644
>--- a/gcc/config/i386/cygming.h
>+++ b/gcc/config/i386/cygming.h
>@@ -110,7 +110,8 @@ along with GCC; see the file COPYING3.  If not see
> 	fputs ("\t.secrel32\t", FILE);				\
> 	assemble_name (FILE, LABEL);				\
> 	if ((OFFSET) != 0)					\
>-	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET)	\
>+	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC,		\
>+		   (HOST_WIDE_INT) (OFFSET))			\
> 	break;							\
>       case 8:							\
> 	/* This is a hack.  There is no 64-bit section relative	\
>@@ -121,7 +122,8 @@ along with GCC; see the file COPYING3.  If not see
> 	fputs ("\t.secrel32\t", FILE);				\
> 	assemble_name (FILE, LABEL);				\
> 	if ((OFFSET) != 0)					\
>-	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET)	\
>+	  fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC,		\
>+		   (HOST_WIDE_INT) (OFFSET))			\
> 	fputs ("\n\t.long\t0", FILE);				\
> 	break;							\
>       default:							\
>diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
>index 00516bb..ac0cb86 100644
>--- a/gcc/config/ia64/ia64.h
>+++ b/gcc/config/ia64/ia64.h
>@@ -1587,7 +1587,8 @@ do {									\
>     fputs ("@secrel(", FILE);					\
>     assemble_name (FILE, LABEL);				\
>     if ((OFFSET) != 0)						\
>-      fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, OFFSET);	\
>+      fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC,		\
>+	       (HOST_WIDE_INT) (OFFSET));			\
>     fputc (')', FILE);						\
>   } while (0)
> 


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

end of thread, other threads:[~2016-09-17 11:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-19 14:27 [PATCH][2/n] Change dw2_asm_output_offset to allow assembling extra offset Richard Biener
2015-08-19 20:12 ` Mike Stump
2015-08-20  8:08   ` Richard Biener
2015-08-20 11:22     ` Mike Stump
2015-08-20 11:27       ` Richard Biener
2016-09-15  7:53 ` Richard Biener
2016-09-16  8:40 ` Andreas Schwab
2016-09-16  8:50   ` Richard Biener
2016-09-17 15:20   ` Andreas Schwab
2016-09-17 15:30     ` 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).