PATCH, spu: adjust -mwarn-reloc behaviour

Ben Elliston
Mon Dec 1 05:03:00 GMT 2008

Currently, gcc emits a run-time relocation error whenever -mwarn-reloc
is not passed (or, when -mno-warn-reloc is passed).  There is an option
to explicitly control this behaviour, so I feel that the option should
be consulted.  :-)

Okay for mainline?

2008-12-01  Ben Elliston  <>

        * config/spu/spu.c (reloc_diagnostic): Produce a run-time
        relocations diagnostic error if the -merror-reloc option is
        enabled rather than when -mwarn-reloc is not set.
        * config/spu/spu.opt (merror-reloc): Enable by default.

Index: config/spu/spu.c
--- config/spu/spu.c    (revision 142300)
+++ config/spu/spu.c    (working copy)
@@ -4787,7 +4787,7 @@ reloc_diagnostic (rtx x)
     warning (0, msg, loc_decl, decl);
-  else
     error (msg, loc_decl, decl);
Index: config/spu/spu.opt
--- config/spu/spu.opt  (revision 142300)
+++ config/spu/spu.opt  (working copy)
@@ -20,7 +20,7 @@ Target Report Mask(WARN_RELOC)
 Emit warnings when run-time relocations are generated
-Target Report Mask(ERROR_RELOC)
+Target Report Mask(ERROR_RELOC) Init(1)
 Emit errors when run-time relocations are generated

More information about the Gcc-patches mailing list