[Bug fortran/33001] error with hexadecimal DATA

2007-08-09 Thread burnus at gcc dot gnu dot org


--- Comment #8 from burnus at gcc dot gnu dot org  2007-08-09 21:28 ---
Subject: Bug 33001

Author: burnus
Date: Thu Aug  9 21:27:52 2007
New Revision: 127321

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=127321
Log:
2007-08-09  Tobias Burnus  [EMAIL PROTECTED]

PR fortran/33001
* arith.c (arith_error): Point in the error message
to -fno-range-check.


Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/arith.c


-- 


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



[Bug fortran/33001] error with hexadecimal DATA

2007-08-06 Thread sliwa at cft dot edu dot pl


--- Comment #1 from sliwa at cft dot edu dot pl  2007-08-06 11:03 ---
Created an attachment (id=14028)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14028action=view)
sample source that does not compile

This is a SLATEC machine file


-- 


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



[Bug fortran/33001] error with hexadecimal DATA

2007-08-06 Thread burnus at gcc dot gnu dot org


--- Comment #2 from burnus at gcc dot gnu dot org  2007-08-06 12:11 ---
  DATA LARGE(1), LARGE(2) / Z'', Z'7FEF' /  
Error: Arithmetic overflow converting INTEGER(16) to INTEGER(4) at (1)

The error message is correct: You cannot fit the number into an INTEGER(4) as
this is bigger than HUGE(0).

As the overflow is intended, one can use   -fno-range-check   to disable this
checking and thus the error message.

I think one should do here the same as in primary.c and add the following to
the error message:

--- arith.c (revision 127237)
+++ arith.c (working copy)
@@ -1983,3 +1983,4 @@ arith_error (arith rc, gfc_typespec *fro
 case ARITH_OVERFLOW:
-  gfc_error (Arithmetic overflow converting %s to %s at %L,
+  gfc_error (Arithmetic overflow converting %s to %s at %L. This check 
+can be disabled with the option -fno-range-check,
 gfc_typename (from), gfc_typename (to), where);


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||burnus at gcc dot gnu dot
   ||org
  GCC build triplet|x86_64-redhat-linux |
   GCC host triplet|x86_64-redhat-linux |
 GCC target triplet|x86_64-redhat-linux |


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



[Bug fortran/33001] error with hexadecimal DATA

2007-08-06 Thread sliwa at cft dot edu dot pl


--- Comment #4 from sliwa at cft dot edu dot pl  2007-08-06 12:45 ---
With -fno-range-check I get:

d1mach.f: In function 'd1mach':
d1mach.f:2: fatal error: gfc_todo: Not Implemented: Initialization of
overlapping variables
compilation terminated.

See also bug #33002.


-- 


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



[Bug fortran/33001] error with hexadecimal DATA

2007-08-06 Thread sliwa at cft dot edu dot pl


--- Comment #3 from sliwa at cft dot edu dot pl  2007-08-06 12:41 ---
1. The attached d1mach.f works fine with g77.

2. The numbers are 32-bit, so why an overflow? Maybe the number is extended as
a signed number (padded with ones), and the conversion is unsigned.


-- 


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



[Bug fortran/33001] error with hexadecimal DATA

2007-08-06 Thread burnus at gcc dot gnu dot org


--- Comment #5 from burnus at gcc dot gnu dot org  2007-08-06 13:06 ---
 The numbers are 32-bit, so why an overflow?
 huge(0): 2147483647 ! biggest (positive) number fitting into integer(4)
 Z'': 4294967295

I would argue that 4294967295 is bigger than 2147483647. If one allows the
overflow or regards it as bit pattern, one obtains -1. This is also what one
gets for -fno-range-check.

The program is simply invalid though as vendor extension many compilers allow
it. One can discuss about the default behaviour in gfortran [write to the
mailing list and not here], but the current behaviour has some merits, though I
think one should point to the option which allows the compilation (see patch in
comment #2).

-

(In reply to comment #4)
 d1mach.f:2: fatal error: gfc_todo: Not Implemented: Initialization of
 overlapping variables

This was fixed meanwhile. gfortran 4.3 does not have this error any more.
4.3 binaries are available at:  http://gcc.gnu.org/wiki/GFortranBinaries


-- 


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



[Bug fortran/33001] error with hexadecimal DATA

2007-08-06 Thread kargl at gcc dot gnu dot org


--- Comment #6 from kargl at gcc dot gnu dot org  2007-08-06 17:30 ---


*** This bug has been marked as a duplicate of 18026 ***


-- 

kargl at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE


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



[Bug fortran/33001] error with hexadecimal DATA

2007-08-06 Thread patchapp at dberlin dot org


--- Comment #7 from patchapp at dberlin dot org  2007-08-06 18:20 ---
Subject: Bug number PR33001

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg00374.html


-- 


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