This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/4465: Segementation fault with h8300-hms-gcc



>Number:         4465
>Category:       c
>Synopsis:       Segementation fault with h8300-hms-gcc
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 03 22:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     paulc@hydraelectroniics.com.au
>Release:        gcc-3.0.1
>Organization:
>Environment:
ix86-linux i586-mingw
>Description:
tiny data attribute causes seg fault.

h8300-hms-gcc -c bug.c
bug.c: In function `a_seg_fault':
bug.c:5: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

>How-To-Repeat:
h8300-hms-gcc -c bug.c
>Fix:
fix code in gcc/config/h8300 to be like arm code

--- h8300.c~	Fri Sep 28 16:31:32 2001
+++ h8300.c	Thu Oct  4 13:02:03 2001
@@ -3149,12 +3149,13 @@
   const char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
   int len = strlen (str);
   char *newstr;
 
-  newstr = ggc_alloc_string (NULL, len + 1);
-
-  strcpy (newstr + 1, str);
+  newstr = alloca ( len + 2);
   *newstr = '&';
+  strcpy (newstr + 1, str);
+  newstr = (char *) ggc_alloc_string (newstr, len + 1);
+
   XSTR (XEXP (DECL_RTL (decl), 0), 0) = newstr;
 }
 
 const char *
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]