diff mbox

The nvptx port [10/11+] Target files

Message ID 877fxw4o6c.fsf@kepler.schwinge.homeip.net
State New
Headers show

Commit Message

Thomas Schwinge Dec. 12, 2014, 8:18 p.m. UTC
Hi!

On Mon, 10 Nov 2014 17:19:57 +0100, Bernd Schmidt <bernds@codesourcery.com> wrote:
> I've now committed it, in the following form.

> --- /dev/null
> +++ b/gcc/config/nvptx/nvptx.h
> @@ -0,0 +1,356 @@

> +#define ASM_OUTPUT_ALIGN(FILE, POWER)

Committed to trunk in r218689:

commit 61f8a1bd770ded96fcff88f3cbc426a23c413992
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Fri Dec 12 20:14:10 2014 +0000

    nvptx: Define valid ASM_OUTPUT_ALIGN.
    
    	gcc/
    	* config/nvptx/nvptx.h (ASM_OUTPUT_ALIGN): Define as a C statment.
    
        gcc/doc/tm.texi:@defmac ASM_OUTPUT_ALIGN (@var{stream}, @var{power})
        gcc/doc/tm.texi-A C statement to output to the stdio stream @var{stream} an assembler
        gcc/doc/tm.texi-command to advance the location counter to a multiple of 2 to the
        gcc/doc/tm.texi-@var{power} bytes.  @var{power} will be a C expression of type @code{int}.
        gcc/doc/tm.texi-@end defmac
    
        gcc/config/nvptx/nvptx.h:#define ASM_OUTPUT_ALIGN(FILE, POWER)
    
    "Empty" is not a C statement, and so in code such as:
    
        gcc/dwarf2out.c-              if (lsda_encoding == DW_EH_PE_aligned)
        gcc/dwarf2out.c:                ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
        gcc/dwarf2out.c-              dw2_asm_output_data (size_of_encoded_value (lsda_encoding), 0,
        gcc/dwarf2out.c-                                   "Language Specific Data Area (none)");
    
        gcc/varasm.c-      if (align > BITS_PER_UNIT)
        gcc/varasm.c:        ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
        gcc/varasm.c-      assemble_variable_contents (decl, name, dont_output_data);
    
        gcc/varasm.c-  if (align > 0)
        gcc/varasm.c:    ASM_OUTPUT_ALIGN (asm_out_file, align);
        gcc/varasm.c-
        gcc/varasm.c-  targetm.asm_out.internal_label (asm_out_file, "LTRAMP", 0);
    
        gcc/varasm.c-      if (align > BITS_PER_UNIT)
        gcc/varasm.c:        ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
        gcc/varasm.c-      assemble_constant_contents (exp, XSTR (symbol, 0), align);
    
    ..., GCC warns:
    
        [...]/source-gcc/gcc/dwarf2out.c: In function 'void output_fde(dw_fde_ref, bool, bool, char*, int, char*, bool, int)':
        [...]/source-gcc/gcc/dwarf2out.c:665:3: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
           ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
           ^
    
        [...]/source-gcc/gcc/varasm.c: In function 'void assemble_variable(tree, int, int, int)':
        [...]/source-gcc/gcc/varasm.c:2217:2: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
          ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
          ^
        [...]/source-gcc/gcc/varasm.c: In function 'rtx_def* assemble_trampoline_template()':
        [...]/source-gcc/gcc/varasm.c:2603:5: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
             ASM_OUTPUT_ALIGN (asm_out_file, align);
             ^
        [...]/source-gcc/gcc/varasm.c: In function 'void output_constant_def_contents(rtx)':
        [...]/source-gcc/gcc/varasm.c:3413:2: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
          ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
          ^
    
    Also, "use" the values, to get rid of that one:
    
        [...]/source-gcc/gcc/final.c: In function 'rtx_insn* final_scan_insn(rtx_insn*, FILE*, int, int, int*)':
        [...]/source-gcc/gcc/final.c:2450:12: warning: variable 'log_align' set but not used [-Wunused-but-set-variable]
                int log_align;
                    ^
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218689 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog            |  4 ++++
 gcc/config/nvptx/nvptx.h | 10 +++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)



Grüße,
 Thomas
diff mbox

Patch

diff --git gcc/ChangeLog gcc/ChangeLog
index 689c4fd..e5de2c6 100644
--- gcc/ChangeLog
+++ gcc/ChangeLog
@@ -1,3 +1,7 @@ 
+2014-12-12  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* config/nvptx/nvptx.h (ASM_OUTPUT_ALIGN): Define as a C statment.
+
 2014-12-12  Vladimir Makarov  <vmakarov@redhat.com>
 
 	PR target/64110
diff --git gcc/config/nvptx/nvptx.h gcc/config/nvptx/nvptx.h
index c222375..5f08ba7 100644
--- gcc/config/nvptx/nvptx.h
+++ gcc/config/nvptx/nvptx.h
@@ -281,9 +281,17 @@  struct GTY(()) machine_function
     }								\
   while (0)
 
-#define ASM_OUTPUT_ALIGN(FILE, POWER)
+#define ASM_OUTPUT_ALIGN(FILE, POWER)		\
+  do						\
+    {						\
+      (void) (FILE);				\
+      (void) (POWER);				\
+    }						\
+  while (0)
+
 #define ASM_OUTPUT_SKIP(FILE, N)		\
   nvptx_output_skip (FILE, N)
+
 #undef  ASM_OUTPUT_ASCII
 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH)			\
   nvptx_output_ascii (FILE, STR, LENGTH);