[Bug fortran/34559] Regression 4.3: ICE using REPEAT on string literals

2007-12-22 Thread dfranke at gcc dot gnu dot org


--- Comment #4 from dfranke at gcc dot gnu dot org  2007-12-22 22:19 ---
Fixed in trunk. Closing.


-- 

dfranke at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34559



[Bug fortran/34559] Regression 4.3: ICE using REPEAT on string literals

2007-12-22 Thread dfranke at gcc dot gnu dot org


--- Comment #3 from dfranke at gcc dot gnu dot org  2007-12-22 22:18 ---
Subject: Bug 34559

Author: dfranke
Date: Sat Dec 22 22:18:28 2007
New Revision: 131139

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131139
Log:
gcc/fortran:
2007-12-22  Daniel Franke  <[EMAIL PROTECTED]>

PR fortran/34559
* simplify.c (gfc_simplify_repeat): Added safeguard for empty string
literals.

gcc/testsuite:
2007-12-22  Daniel Franke  <[EMAIL PROTECTED]>

PR fortran/34559
* gfortran.dg/repeat_6.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/repeat_6.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/simplify.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34559



[Bug fortran/34559] Regression 4.3: ICE using REPEAT on string literals

2007-12-22 Thread dfranke at gcc dot gnu dot org


--- Comment #2 from dfranke at gcc dot gnu dot org  2007-12-22 20:40 ---
Fixed.

Index: simplify.c
===
--- simplify.c  (revision 131122)
+++ simplify.c  (working copy)
@@ -3128,7 +3128,9 @@ gfc_simplify_repeat (gfc_expr *e, gfc_ex
   if (e->expr_type != EXPR_CONSTANT)
 return NULL;

-  if (len || mpz_sgn (e->ts.cl->length->value.integer) != 0)
+  if (len ||
+  (e->ts.cl->length &&
+   mpz_sgn (e->ts.cl->length->value.integer)) != 0)
 {
   const char *res = gfc_extract_int (n, &ncop);
   gcc_assert (res == NULL);


(not yet regression tested, obviously)


-- 

dfranke at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||dfranke at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34559



[Bug fortran/34559] Regression 4.3: ICE using REPEAT on string literals

2007-12-22 Thread tkoenig at gcc dot gnu dot org


--- Comment #1 from tkoenig at gcc dot gnu dot org  2007-12-22 20:31 ---
Confirmed.

Simplified test case:

$ cat npr.f90 
program main
  print *, repeat ("", 3)
end program main
$ gfortran npr.f90 
f951: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-12-22 20:31:59
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34559