GCC: v850-elf

Jan-Benedict Glaw jbglaw@lug-owl.de
Wed Mar 17 07:51:12 GMT 2021


On Tue, 2021-03-16 11:32:29 +0000, Nick Clifton <nickc@redhat.com> wrote:
> Hi Jan-Benedict,
> 
> > With my re-started testing efforts, I've got another one for you I
> > guess (`./configure --target=v850-elf && make all-gcc`):
> > 
> > ../.././gcc/config/v850/v850.c: In function ‘char* construct_restore_jr(rtx)’:
> > ../.././gcc/config/v850/v850.c:2260:22: error: ‘%s’ directive writing up to 39 bytes into a region of size between 32 and 71 [-Werror=format-overflow=]
> >   2260 |       sprintf (buff, "movhi hi(%s), r0, r6\n\tmovea lo(%s), r6, r6\n\tjmp r6",
> >        |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >   2261 |         name, name);
> >        |               ~~~~
> 
> I could not reproduce these in my local environment, but I suspect that
> you are using a more recent version of gcc than me.  The fix looks obvious
> however, so please could you try out the attached patch and let me know
> if it resolves the problem ?

Tried your patch, it fixes the two of four warnings. This is needed
on-top of yours:


diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index db3002a2cfb..e0e5005d865 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -2286,7 +2286,7 @@ construct_save_jarl (rtx op)
   unsigned long int first;
   unsigned long int last;
   int i;
-  static char buff [100]; /* XXX */
+  static char buff [255]; /* XXX */
   
   if (count <= (TARGET_LONG_CALLS ? 3 : 2)) 
     {



However, next one is:

g++  -fno-PIE -c  -DIN_GCC_FRONTEND -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -I. -I../.././gcc -I../.././gcc/. -I../.././gcc/../include -I../.././gcc/../libcpp/include -I../.././gcc/../libcody  -I../.././gcc/../libdecnumber -I../.././gcc/../libdecnumber/dpd -I../libdecnumber -I../.././gcc/../libbacktrace   -o default-d.o -MT default-d.o -MMD -MP -MF ./.deps/default-d.TPo ../.././gcc/config/default-d.c
In file included from ./tm_d.h:9,
                 from ../.././gcc/config/default-d.c:22:
../.././gcc/defaults.h:938: error: "PREFERRED_DEBUGGING_TYPE" redefined [-Werror]
  938 | #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
      | 
In file included from ./tm_d.h:6,
                 from ../.././gcc/config/default-d.c:22:
../.././gcc/config/v850/v850.h:702: note: this is the location of the previous definition
  702 | #define PREFERRED_DEBUGGING_TYPE   DWARF2_DEBUG
      | 
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:2320: default-d.o] Error 1

MfG, JBG

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210317/272c0198/attachment-0001.sig>


More information about the Gcc-patches mailing list