Bug 46432 - v850-elf --enable-werror-always build fails
Summary: v850-elf --enable-werror-always build fails
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks: enable-werror-always
  Show dependency treegraph
 
Reported: 2010-11-11 12:22 UTC by Jorn Wolfgang Rennecke
Modified: 2010-11-15 14:04 UTC (History)
1 user (show)

See Also:
Host:
Target: v850-elf
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jorn Wolfgang Rennecke 2010-11-11 12:22:23 UTC
../../../gcc/gcc/final.c: In function ‘profile_function’:
../../../gcc/gcc/final.c:1627:45: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
../../../gcc/gcc/final.c:1629:46: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
../../../gcc/gcc/final.c:1636:45: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
../../../gcc/gcc/final.c:1638:44: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
Comment 1 Jorn Wolfgang Rennecke 2010-11-11 21:37:12 UTC
Does profiling actually work on the v850?
It seems strange that v850.h defines ASM_OUTPUT_REG_PUSH / ASM_OUTPUT_REG_POP
as empty - I'd expect the profiled program to suffer from
clobbered registers.
Comment 2 Jorn Wolfgang Rennecke 2010-11-12 12:10:44 UTC
FWIW, following the GNU coding standard advice on 'swallowing the semicolon'
avoids the warning:

Index: config/v850/v850.h
===================================================================
--- config/v850/v850.h  (revision 166609)
+++ config/v850/v850.h  (working copy)
@@ -888,8 +888,8 @@ #define ADDITIONAL_REGISTER_NAMES       
   { "r30",     30 },                           \
   { "lp",      LP_REGNUM} }
 
-#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)
-#define ASM_OUTPUT_REG_POP(FILE,REGNO)
+#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) do {} while (0)
+#define ASM_OUTPUT_REG_POP(FILE,REGNO) do {} while (0)
 
 /* This is how to output an element of a case-vector that is absolute.  */
Comment 3 Nick Clifton 2010-11-15 12:37:35 UTC
Hi Joern,

> FWIW, following the GNU coding standard advice on 'swallowing the semicolon'
> avoids the warning:

I think that it would be better to just delete the definitions.  They 
are bogus; the v850 does not currently support profiling, so it will be 
cleaner to just remove them.  At patch that does this is pre-approved.

Cheers
   Nick
Comment 4 Jorn Wolfgang Rennecke 2010-11-15 14:03:36 UTC
Author: amylaar
Date: Mon Nov 15 14:03:31 2010
New Revision: 166754

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166754
Log:
        PR target/46432
        * config/v850/v850.h (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Delete.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/v850/v850.h
Comment 5 Jorn Wolfgang Rennecke 2010-11-15 14:04:23 UTC
Patch has been applied to trunk.