Re: GCC: v850-elf

2021-03-18 Thread Nick Clifton via Gcc-patches

Hi JBG,


These three let it build.  One done.  Thanks for your support!


No worries.  Patch pushed.

Cheers
  Nick




Re: GCC: v850-elf

2021-03-17 Thread Jeff Law via Gcc-patches



On 3/17/2021 9:44 AM, Nick Clifton via Gcc-patches wrote:

Hi Jan-Benedict,


However, next one is:


../.././gcc/defaults.h:938: error: "PREFERRED_DEBUGGING_TYPE" 
redefined [-Werror]

   938 | #define PREFERRED_DEBUGGING_TYPE NO_DEBUG


Ah - this is the same as the fix needed for the RX target.  Please try 
the attached
patch.  It includes my original patch, your addition to the patch and 
a fix for the

above problem.


Consider all these good for the trunk.  If you could install them, it'd 
be appreciated.  I'm not quite set up for that right now.



Thanks,

Jeff



Re: GCC: v850-elf

2021-03-17 Thread Jan-Benedict Glaw
Hi Nick!

On Wed, 2021-03-17 15:44:16 +, Nick Clifton  wrote:
> > However, next one is:
> 
> > ../.././gcc/defaults.h:938: error: "PREFERRED_DEBUGGING_TYPE" redefined 
> > [-Werror]
> >938 | #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
> 
> Ah - this is the same as the fix needed for the RX target.  Please try the 
> attached
> patch.  It includes my original patch, your addition to the patch and a fix 
> for the
> above problem.

These three let it build.  One done.  Thanks for your support!

MfG, JBG

-- 


signature.asc
Description: PGP signature


Re: GCC: v850-elf

2021-03-17 Thread Nick Clifton via Gcc-patches

Hi Jan-Benedict,


However, next one is:



../.././gcc/defaults.h:938: error: "PREFERRED_DEBUGGING_TYPE" redefined 
[-Werror]
   938 | #define PREFERRED_DEBUGGING_TYPE NO_DEBUG


Ah - this is the same as the fix needed for the RX target.  Please try the 
attached
patch.  It includes my original patch, your addition to the patch and a fix for 
the
above problem.

Cheers
  Nick
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 249cb400177..e0e5005d865 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -2181,7 +2181,7 @@ construct_restore_jr (rtx op)
   unsigned long int first;
   unsigned long int last;
   int i;
-  static char buff [100]; /* XXX */
+  static char buff [256]; /* XXX */
   
   if (count <= 2)
 {
@@ -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)) 
 {
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index 23dfdf67dff..386f9f59e0b 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -700,6 +700,7 @@ typedef enum
 /* Use dwarf2 debugging info by default.  */
 #undef  PREFERRED_DEBUGGING_TYPE
 #define PREFERRED_DEBUGGING_TYPE   DWARF2_DEBUG
+#define DWARF2_DEBUGGING_INFO	   1
 
 #define DWARF2_FRAME_INFO  1
 #define DWARF2_UNWIND_INFO 0


Re: GCC: v850-elf

2021-03-17 Thread Jan-Benedict Glaw
On Tue, 2021-03-16 11:32:29 +, Nick Clifton  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

-- 


signature.asc
Description: PGP signature


Re: GCC: v850-elf

2021-03-16 Thread Jeff Law via Gcc-patches



On 3/16/2021 5:32 AM, Nick Clifton via Gcc-patches 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 ?
I suspect that construct_save_jarl has the same problem and the same 
patch should fix it.



Jeff



Re: GCC: v850-elf

2021-03-16 Thread Nick Clifton via Gcc-patches

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 ?

Cheers
  Nick
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 249cb400177..db3002a2cfb 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -2181,7 +2181,7 @@ construct_restore_jr (rtx op)
   unsigned long int first;
   unsigned long int last;
   int i;
-  static char buff [100]; /* XXX */
+  static char buff [256]; /* XXX */
   
   if (count <= 2)
 {