public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/33001]  New: error with hexadecimal DATA
@ 2007-08-06 11:02 sliwa at cft dot edu dot pl
  2007-08-06 11:03 ` [Bug fortran/33001] " sliwa at cft dot edu dot pl
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: sliwa at cft dot edu dot pl @ 2007-08-06 11:02 UTC (permalink / raw)
  To: gcc-bugs

d1mach.f:90.43:

      DATA LARGE(1), LARGE(2) / Z'FFFFFFFF', Z'7FEFFFFF' /              
                                          1
Error: Arithmetic overflow converting INTEGER(16) to INTEGER(4) at (1)


-- 
           Summary: error with hexadecimal DATA
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sliwa at cft dot edu dot pl
 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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/33001] error with hexadecimal DATA
  2007-08-06 11:02 [Bug fortran/33001] New: error with hexadecimal DATA sliwa at cft dot edu dot pl
@ 2007-08-06 11:03 ` sliwa at cft dot edu dot pl
  2007-08-06 12:11 ` burnus at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sliwa at cft dot edu dot pl @ 2007-08-06 11:03 UTC (permalink / raw)
  To: gcc-bugs



------- 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=14028&action=view)
sample source that does not compile

This is a SLATEC machine file


-- 


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/33001] error with hexadecimal DATA
  2007-08-06 11:02 [Bug fortran/33001] New: error with hexadecimal DATA sliwa at cft dot edu dot pl
  2007-08-06 11:03 ` [Bug fortran/33001] " sliwa at cft dot edu dot pl
@ 2007-08-06 12:11 ` burnus at gcc dot gnu dot org
  2007-08-06 12:41 ` sliwa at cft dot edu dot pl
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-08-06 12:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2007-08-06 12:11 -------
      DATA LARGE(1), LARGE(2) / Z'FFFFFFFF', Z'7FEFFFFF' /              
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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/33001] error with hexadecimal DATA
  2007-08-06 11:02 [Bug fortran/33001] New: error with hexadecimal DATA sliwa at cft dot edu dot pl
  2007-08-06 11:03 ` [Bug fortran/33001] " sliwa at cft dot edu dot pl
  2007-08-06 12:11 ` burnus at gcc dot gnu dot org
@ 2007-08-06 12:41 ` sliwa at cft dot edu dot pl
  2007-08-06 12:45 ` sliwa at cft dot edu dot pl
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sliwa at cft dot edu dot pl @ 2007-08-06 12:41 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/33001] error with hexadecimal DATA
  2007-08-06 11:02 [Bug fortran/33001] New: error with hexadecimal DATA sliwa at cft dot edu dot pl
                   ` (2 preceding siblings ...)
  2007-08-06 12:41 ` sliwa at cft dot edu dot pl
@ 2007-08-06 12:45 ` sliwa at cft dot edu dot pl
  2007-08-06 13:06 ` burnus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sliwa at cft dot edu dot pl @ 2007-08-06 12:45 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/33001] error with hexadecimal DATA
  2007-08-06 11:02 [Bug fortran/33001] New: error with hexadecimal DATA sliwa at cft dot edu dot pl
                   ` (3 preceding siblings ...)
  2007-08-06 12:45 ` sliwa at cft dot edu dot pl
@ 2007-08-06 13:06 ` burnus at gcc dot gnu dot org
  2007-08-06 17:30 ` kargl at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-08-06 13:06 UTC (permalink / raw)
  To: gcc-bugs



------- 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'FFFFFFFF': 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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/33001] error with hexadecimal DATA
  2007-08-06 11:02 [Bug fortran/33001] New: error with hexadecimal DATA sliwa at cft dot edu dot pl
                   ` (4 preceding siblings ...)
  2007-08-06 13:06 ` burnus at gcc dot gnu dot org
@ 2007-08-06 17:30 ` kargl at gcc dot gnu dot org
  2007-08-06 18:20 ` patchapp at dberlin dot org
  2007-08-09 21:28 ` burnus at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-08-06 17:30 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/33001] error with hexadecimal DATA
  2007-08-06 11:02 [Bug fortran/33001] New: error with hexadecimal DATA sliwa at cft dot edu dot pl
                   ` (5 preceding siblings ...)
  2007-08-06 17:30 ` kargl at gcc dot gnu dot org
@ 2007-08-06 18:20 ` patchapp at dberlin dot org
  2007-08-09 21:28 ` burnus at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: patchapp at dberlin dot org @ 2007-08-06 18:20 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/33001] error with hexadecimal DATA
  2007-08-06 11:02 [Bug fortran/33001] New: error with hexadecimal DATA sliwa at cft dot edu dot pl
                   ` (6 preceding siblings ...)
  2007-08-06 18:20 ` patchapp at dberlin dot org
@ 2007-08-09 21:28 ` burnus at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-08-09 21:28 UTC (permalink / raw)
  To: gcc-bugs



------- 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=gcc&view=rev&rev=127321
Log:
2007-08-09  Tobias Burnus  <burnus@net-b.de>

        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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-08-09 21:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-06 11:02 [Bug fortran/33001] New: error with hexadecimal DATA sliwa at cft dot edu dot pl
2007-08-06 11:03 ` [Bug fortran/33001] " sliwa at cft dot edu dot pl
2007-08-06 12:11 ` burnus at gcc dot gnu dot org
2007-08-06 12:41 ` sliwa at cft dot edu dot pl
2007-08-06 12:45 ` sliwa at cft dot edu dot pl
2007-08-06 13:06 ` burnus at gcc dot gnu dot org
2007-08-06 17:30 ` kargl at gcc dot gnu dot org
2007-08-06 18:20 ` patchapp at dberlin dot org
2007-08-09 21:28 ` burnus at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).